org.bouncycastle.crypto.encodings
Class PKCS1Encoding
java.lang.Object
org.bouncycastle.crypto.encodings.PKCS1Encoding
- AsymmetricBlockCipher
public class PKCS1Encoding
extends java.lang.Object
this does your basic PKCS 1 v1.5 padding - whether or not you should be using this
depends on your application - see PKCS1 Version 2 for details.
STRICT_LENGTH_ENABLED_PROPERTY
public static final String STRICT_LENGTH_ENABLED_PROPERTY
some providers fail to include the leading zero in PKCS1 encoded blocks. If you need to
work with one of these set the system property org.bouncycastle.pkcs1.strict to false.
The system property is checked during construction of the encoding object, it is set to
true by default.
getOutputBlockSize
public int getOutputBlockSize()
returns the maximum size of the block produced by this cipher.
- getOutputBlockSize in interface AsymmetricBlockCipher
- maximum size of the output block produced by the cipher.
init
public void init(boolean forEncryption,
CipherParameters param)
initialise the cipher.
- init in interface AsymmetricBlockCipher
forEncryption
- if true the cipher is initialised for
encryption, if false for decryption.param
- the key and other data required by the cipher.
processBlock
public byte[] processBlock(byte[] in,
int inOff,
int inLen)
throws InvalidCipherTextException
process the block of len bytes stored in in from offset inOff.
- processBlock in interface AsymmetricBlockCipher
in
- the input datainOff
- offset into the in array where the data starts
- the resulting byte array of the encryption/decryption process.