public class PKCS1Encoding extends Object implements AsymmetricBlockCipher
| Modifier and Type | Field and Description |
|---|---|
static String |
STRICT_LENGTH_ENABLED_PROPERTY
some providers fail to include the leading zero in PKCS1 encoded blocks.
|
| Constructor and Description |
|---|
PKCS1Encoding(AsymmetricBlockCipher cipher)
Basic constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getInputBlockSize()
returns the largest size an input block can be.
|
int |
getOutputBlockSize()
returns the maximum size of the block produced by this cipher.
|
AsymmetricBlockCipher |
getUnderlyingCipher() |
void |
init(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.
|
public static final String STRICT_LENGTH_ENABLED_PROPERTY
The system property is checked during construction of the encoding object, it is set to true by default.
public PKCS1Encoding(AsymmetricBlockCipher cipher)
cipher - public AsymmetricBlockCipher getUnderlyingCipher()
public void init(boolean forEncryption,
CipherParameters param)
AsymmetricBlockCipherinit in interface AsymmetricBlockCipherforEncryption - if true the cipher is initialised for
encryption, if false for decryption.param - the key and other data required by the cipher.public int getInputBlockSize()
AsymmetricBlockCiphergetInputBlockSize in interface AsymmetricBlockCipherpublic int getOutputBlockSize()
AsymmetricBlockCiphergetOutputBlockSize in interface AsymmetricBlockCipherpublic byte[] processBlock(byte[] in,
int inOff,
int inLen)
throws InvalidCipherTextException
AsymmetricBlockCipherprocessBlock in interface AsymmetricBlockCipherin - the input datainOff - offset into the in array where the data startsinLen - the length of the block to be processed.InvalidCipherTextException - data decrypts improperly.Copyright © 2015. All rights reserved.