Class OAEPEncoding
java.lang.Object
org.bouncycastle.crypto.encodings.OAEPEncoding
- All Implemented Interfaces:
AsymmetricBlockCipher
Optimal Asymmetric Encryption Padding (OAEP) - see PKCS 1 V 2.
-
Constructor Summary
ConstructorsConstructorDescriptionOAEPEncoding(AsymmetricBlockCipher cipher) OAEPEncoding(AsymmetricBlockCipher cipher, Digest hash) OAEPEncoding(AsymmetricBlockCipher cipher, Digest hash, byte[] encodingParams) OAEPEncoding(AsymmetricBlockCipher cipher, Digest hash, Digest mgf1Hash, byte[] encodingParams) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]decodeBlock(byte[] in, int inOff, int inLen) byte[]encodeBlock(byte[] in, int inOff, int inLen) intreturns the largest size an input block can be.intreturns the maximum size of the block produced by this cipher.voidinit(boolean forEncryption, CipherParameters param) initialise the cipher.byte[]processBlock(byte[] in, int inOff, int inLen) process the block of len bytes stored in in from offset inOff.
-
Constructor Details
-
OAEPEncoding
-
OAEPEncoding
-
OAEPEncoding
-
OAEPEncoding
public OAEPEncoding(AsymmetricBlockCipher cipher, Digest hash, Digest mgf1Hash, byte[] encodingParams)
-
-
Method Details
-
getUnderlyingCipher
-
init
Description copied from interface:AsymmetricBlockCipherinitialise the cipher.- Specified by:
initin interfaceAsymmetricBlockCipher- 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:AsymmetricBlockCipherreturns the largest size an input block can be.- Specified by:
getInputBlockSizein interfaceAsymmetricBlockCipher- Returns:
- maximum size for an input block.
-
getOutputBlockSize
public int getOutputBlockSize()Description copied from interface:AsymmetricBlockCipherreturns the maximum size of the block produced by this cipher.- Specified by:
getOutputBlockSizein interfaceAsymmetricBlockCipher- Returns:
- maximum size of the output block produced by the cipher.
-
processBlock
Description copied from interface:AsymmetricBlockCipherprocess the block of len bytes stored in in from offset inOff.- Specified by:
processBlockin interfaceAsymmetricBlockCipher- Parameters:
in- the input datainOff- offset into the in array where the data startsinLen- the length of the block to be processed.- Returns:
- the resulting byte array of the encryption/decryption process.
- Throws:
InvalidCipherTextException- data decrypts improperly.
-
encodeBlock
- Throws:
InvalidCipherTextException
-
decodeBlock
- Throws:
InvalidCipherTextException- if the decrypted block turns out to be badly formatted.
-