org.bouncycastle.crypto.encodings

Class PKCS1Encoding

public class PKCS1Encoding extends Object implements AsymmetricBlockCipher

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.
Field Summary
static StringSTRICT_LENGTH_ENABLED_PROPERTY
some providers fail to include the leading zero in PKCS1 encoded blocks.
Constructor Summary
PKCS1Encoding(AsymmetricBlockCipher cipher)
Basic constructor.
Method Summary
intgetInputBlockSize()
intgetOutputBlockSize()
AsymmetricBlockCiphergetUnderlyingCipher()
voidinit(boolean forEncryption, CipherParameters param)
byte[]processBlock(byte[] in, int inOff, int inLen)

Field Detail

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.

Constructor Detail

PKCS1Encoding

public PKCS1Encoding(AsymmetricBlockCipher cipher)
Basic constructor.

Parameters: cipher

Method Detail

getInputBlockSize

public int getInputBlockSize()

getOutputBlockSize

public int getOutputBlockSize()

getUnderlyingCipher

public AsymmetricBlockCipher getUnderlyingCipher()

init

public void init(boolean forEncryption, CipherParameters param)

processBlock

public byte[] processBlock(byte[] in, int inOff, int inLen)