Package org.bouncycastle.crypto
Interface AsymmetricBlockCipher
- All Known Implementing Classes:
OAEPEncoding,PKCS1Encoding,RSABlindedEngine
public interface AsymmetricBlockCipher
base interface that a public/private key block cipher needs
to conform to.
-
Method Summary
Modifier and Type Method Description intgetInputBlockSize()returns the largest size an input block can be.intgetOutputBlockSize()returns 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 len)process the block of len bytes stored in in from offset inOff.
-
Method Details
-
init
initialise the cipher.- 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
int getInputBlockSize()returns the largest size an input block can be.- Returns:
- maximum size for an input block.
-
getOutputBlockSize
int getOutputBlockSize()returns the maximum size of the block produced by this cipher.- Returns:
- maximum size of the output block produced by the cipher.
-
processBlock
process the block of len bytes stored in in from offset inOff.- 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.
-