org.bouncycastle.crypto.encodings

Class OAEPEncoding

Implemented Interfaces:
AsymmetricBlockCipher

public class OAEPEncoding
extends java.lang.Object
implements AsymmetricBlockCipher

Optimal Asymmetric Encryption Padding (OAEP) - see PKCS 1 V 2.

Constructor Summary

OAEPEncoding(AsymmetricBlockCipher cipher)
OAEPEncoding(AsymmetricBlockCipher cipher, Digest hash)
OAEPEncoding(AsymmetricBlockCipher cipher, Digest hash, byte[] encodingParams)

Method Summary

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

Constructor Details

OAEPEncoding

public OAEPEncoding(AsymmetricBlockCipher cipher)


OAEPEncoding

public OAEPEncoding(AsymmetricBlockCipher cipher,
                    Digest hash)


OAEPEncoding

public OAEPEncoding(AsymmetricBlockCipher cipher,
                    Digest hash,
                    byte[] encodingParams)

Method Details

decodeBlock

public byte[] decodeBlock(byte[] in,
                          int inOff,
                          int inLen)
            throws InvalidCipherTextException

Throws:
InvalidCipherTextException - if the decrypted block turns out to be badly formatted.


encodeBlock

public byte[] encodeBlock(byte[] in,
                          int inOff,
                          int inLen)
            throws InvalidCipherTextException


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