|
Bouncy Castle Cryptography 1.11 API Specification: Class OAEPEncoding
org.bouncycastle.crypto.encodings
Class OAEPEncoding
java.lang.Object
|
+--org.bouncycastle.crypto.encodings.OAEPEncoding
- All Implemented Interfaces:
- AsymmetricBlockCipher
- public class OAEPEncoding
- extends java.lang.Object
- implements AsymmetricBlockCipher
Optimal Asymmetric Encryption Padding (OAEP) - see PKCS 1 V 2.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OAEPEncoding
public OAEPEncoding(AsymmetricBlockCipher cipher)
getUnderlyingCipher
public AsymmetricBlockCipher getUnderlyingCipher()
init
public void init(boolean forEncryption,
CipherParameters param)
- Description copied from interface:
AsymmetricBlockCipher
- initialise the cipher.
- Specified by:
init in interface AsymmetricBlockCipher
- Following copied from interface:
org.bouncycastle.crypto.AsymmetricBlockCipher
- Parameters:
forEncryption - if true the cipher is initialised for
encryption, if false for decryption.param - the key and other data required by the cipher.
getInputBlockSize
public int getInputBlockSize()
- Description copied from interface:
AsymmetricBlockCipher
- returns the largest size an input block can be.
- Specified by:
getInputBlockSize in interface AsymmetricBlockCipher
- Following copied from interface:
org.bouncycastle.crypto.AsymmetricBlockCipher
- Returns:
- maximum size for an input block.
getOutputBlockSize
public int getOutputBlockSize()
- Description copied from interface:
AsymmetricBlockCipher
- returns the maximum size of the block produced by this cipher.
- Specified by:
getOutputBlockSize in interface AsymmetricBlockCipher
- Following copied from interface:
org.bouncycastle.crypto.AsymmetricBlockCipher
- Returns:
- maximum size of the output block produced by the cipher.
processBlock
public byte[] processBlock(byte[] in,
int inOff,
int inLen)
throws InvalidCipherTextException
- Description copied from interface:
AsymmetricBlockCipher
- process the block of len bytes stored in in from offset inOff.
- Specified by:
processBlock in interface AsymmetricBlockCipher
- Following copied from interface:
org.bouncycastle.crypto.AsymmetricBlockCipher
- Parameters:
in - the input datainOff - offset into the in array where the data startslen - the length of the block to be processed.- Returns:
- the resulting byte array of the encryption/decryption process.
- Throws:
InvalidCipherTextException - data decrypts improperly.DataLengthException - the input data is too large for the cipher.
encodeBlock
public byte[] encodeBlock(byte[] in,
int inOff,
int inLen)
throws InvalidCipherTextException
decodeBlock
public byte[] decodeBlock(byte[] in,
int inOff,
int inLen)
throws InvalidCipherTextException
- Throws:
InvalidCipherTextException - if the decryypted block turns out to
be badly formatted.
|