public class

OAEPEncoding

extends Object
implements AsymmetricBlockCipher
java.lang.Object
   ↳ org.bouncycastle.crypto.encodings.OAEPEncoding

Class Overview

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

Summary

Public Constructors
OAEPEncoding(AsymmetricBlockCipher cipher)
OAEPEncoding(AsymmetricBlockCipher cipher, Digest hash)
OAEPEncoding(AsymmetricBlockCipher cipher, Digest hash, byte[] encodingParams)
OAEPEncoding(AsymmetricBlockCipher cipher, Digest hash, Digest mgf1Hash, byte[] encodingParams)
Public Methods
byte[] decodeBlock(byte[] in, int inOff, int inLen)
byte[] encodeBlock(byte[] in, int inOff, int inLen)
int getInputBlockSize()
returns the largest size an input block can be.
int getOutputBlockSize()
returns the maximum size of the block produced by this cipher.
AsymmetricBlockCipher getUnderlyingCipher()
void init(boolean forEncryption, CipherParameters param)
initialise the cipher.
byte[] processBlock(byte[] in, int inOff, int inLen)
process the block of len bytes stored in in from offset inOff.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.bouncycastle.crypto.AsymmetricBlockCipher

Public Constructors

public OAEPEncoding (AsymmetricBlockCipher cipher)

public OAEPEncoding (AsymmetricBlockCipher cipher, Digest hash)

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

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

Public Methods

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

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

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

public int getInputBlockSize ()

returns the largest size an input block can be.

Returns
  • maximum size for an input block.

public int getOutputBlockSize ()

returns the maximum size of the block produced by this cipher.

Returns
  • maximum size of the output block produced by the cipher.

public AsymmetricBlockCipher getUnderlyingCipher ()

public void init (boolean forEncryption, CipherParameters param)

initialise the cipher.

Parameters
forEncryption if true the cipher is initialised for encryption, if false for decryption.
param the key and other data required by the cipher.

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

process the block of len bytes stored in in from offset inOff.

Parameters
in the input data
inOff offset into the in array where the data starts
inLen the length of the block to be processed.
Returns
  • the resulting byte array of the encryption/decryption process.