org.bouncycastle.crypto.encodings

Class ISO9796d1Encoding

public class ISO9796d1Encoding extends Object implements AsymmetricBlockCipher

ISO 9796-1 padding. Note in the light of recent results you should only use this with RSA (rather than the "simpler" Rabin keys) and you should never use it with anything other than a hash (ie. even if the message is small don't sign the message, sign it's hash) or some "random" value. See your favorite search engine for details.
Constructor Summary
ISO9796d1Encoding(AsymmetricBlockCipher cipher)
Method Summary
intgetInputBlockSize()
return the input block size.
intgetOutputBlockSize()
return the maximum possible size for the output.
intgetPadBits()
retrieve the number of pad bits in the last decoded message.
AsymmetricBlockCiphergetUnderlyingCipher()
voidinit(boolean forEncryption, CipherParameters param)
byte[]processBlock(byte[] in, int inOff, int inLen)
voidsetPadBits(int padBits)
set the number of bits in the next message to be treated as pad bits.

Constructor Detail

ISO9796d1Encoding

public ISO9796d1Encoding(AsymmetricBlockCipher cipher)

Method Detail

getInputBlockSize

public int getInputBlockSize()
return the input block size. The largest message we can process is (key_size_in_bits + 3)/16, which in our world comes to key_size_in_bytes / 2.

getOutputBlockSize

public int getOutputBlockSize()
return the maximum possible size for the output.

getPadBits

public int getPadBits()
retrieve the number of pad bits in the last decoded message.

getUnderlyingCipher

public AsymmetricBlockCipher getUnderlyingCipher()

init

public void init(boolean forEncryption, CipherParameters param)

processBlock

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

setPadBits

public void setPadBits(int padBits)
set the number of bits in the next message to be treated as pad bits.