org.bouncycastle.crypto.encodings

Class PKCS1Encoding

Implemented Interfaces:
AsymmetricBlockCipher

public class PKCS1Encoding
extends java.lang.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.

Constructor Summary

PKCS1Encoding(AsymmetricBlockCipher cipher)

Method Summary

int
getInputBlockSize()
int
getOutputBlockSize()
AsymmetricBlockCipher
getUnderlyingCipher()
void
init(boolean forEncryption, CipherParameters param)
byte[]
processBlock(byte[] in, int inOff, int inLen)

Constructor Details

PKCS1Encoding

public PKCS1Encoding(AsymmetricBlockCipher cipher)

Method Details

getInputBlockSize

public int getInputBlockSize()
Specified by:
getInputBlockSize in interface AsymmetricBlockCipher

getOutputBlockSize

public int getOutputBlockSize()
Specified by:
getOutputBlockSize in interface AsymmetricBlockCipher

getUnderlyingCipher

public AsymmetricBlockCipher getUnderlyingCipher()

init

public void init(boolean forEncryption,
                 CipherParameters param)
Specified by:
init in interface AsymmetricBlockCipher

processBlock

public byte[] processBlock(byte[] in,
                           int inOff,
                           int inLen)
            throws InvalidCipherTextException
Specified by:
processBlock in interface AsymmetricBlockCipher