Top Description Fields Constructors Methods
org.bouncycastle.crypto.kems

public Class RSAKeyEncapsulation

extends Object
implements KeyEncapsulation
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.KeyEncapsulation
Imports
java.security.SecureRandom, org.bouncycastle.crypto.CipherParameters, .CryptoServicePurpose, .CryptoServicesRegistrar, .DerivationFunction, .KeyEncapsulation, .SecretWithEncapsulation, org.bouncycastle.crypto.constraints.ConstraintUtils, .DefaultServiceProperties, org.bouncycastle.crypto.params.KeyParameter, .RSAKeyParameters, org.bouncycastle.util.Arrays

Deprecated

use RSAKEMGenerator, RSAKEMExtractor

The RSA Key Encapsulation Mechanism (RSA-KEM) from ISO 18033-2.

Field Summary

Modifier and TypeField and Description
private DerivationFunction
private RSAKeyParameters
private SecureRandom

Constructor Summary

AccessConstructor and Description
public
RSAKeyEncapsulation(DerivationFunction
the key derivation function to be used.
kdf
,
SecureRandom
the random source for the session key.
rnd
)

Set up the RSA-KEM.

Method Summary

Modifier and TypeMethod and Description
public CipherParameters

Returns:

the session key.
decrypt
(byte[]
the input buffer for the encapsulated key.
in
,
int
the offset for the input buffer.
inOff
,
int
the length of the encapsulated key.
inLen
,
int
the length of the session key.
keyLen
)

Implements org.bouncycastle.crypto.KeyEncapsulation.decrypt.

Decrypt an encapsulated session key.
public CipherParameters

Returns:

the session key.
decrypt
(byte[]
the input buffer for the encapsulated key.
in
,
int
the length of the session key.
keyLen
)

Decrypt an encapsulated session key.

public CipherParameters

Returns:

the random session key.
encrypt
(byte[]
the output buffer for the encapsulated key.
out
,
int
the offset for the output buffer.
outOff
,
int
the length of the random session key.
keyLen
)

Implements org.bouncycastle.crypto.KeyEncapsulation.encrypt.

Generate and encapsulate a random session key.
public CipherParameters

Returns:

the random session key.
encrypt
(byte[]
the output buffer for the encapsulated key.
out
,
int
the length of the random session key.
keyLen
)

Generate and encapsulate a random session key.

public void
init(CipherParameters
the recipient's public (for encryption) or private (for decryption) key.
key
)

Implements org.bouncycastle.crypto.KeyEncapsulation.init.

Initialise the RSA-KEM.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

kdfback to summary
private DerivationFunction kdf
keyback to summary
private RSAKeyParameters key
rndback to summary
private SecureRandom rnd

Constructor Detail

RSAKeyEncapsulationback to summary
public RSAKeyEncapsulation(DerivationFunction kdf, SecureRandom rnd)

Set up the RSA-KEM.

Parameters
kdf:DerivationFunction

the key derivation function to be used.

rnd:SecureRandom

the random source for the session key.

Method Detail

decryptback to summary
public CipherParameters decrypt(byte[] in, int inOff, int inLen, int keyLen) throws IllegalArgumentException

Implements org.bouncycastle.crypto.KeyEncapsulation.decrypt.

Decrypt an encapsulated session key.

Parameters
in:byte[]

the input buffer for the encapsulated key.

inOff:int

the offset for the input buffer.

inLen:int

the length of the encapsulated key.

keyLen:int

the length of the session key.

Returns:CipherParameters

the session key.

decryptback to summary
public CipherParameters decrypt(byte[] in, int keyLen)

Decrypt an encapsulated session key.

Parameters
in:byte[]

the input buffer for the encapsulated key.

keyLen:int

the length of the session key.

Returns:CipherParameters

the session key.

encryptback to summary
public CipherParameters encrypt(byte[] out, int outOff, int keyLen) throws IllegalArgumentException

Implements org.bouncycastle.crypto.KeyEncapsulation.encrypt.

Generate and encapsulate a random session key.

Parameters
out:byte[]

the output buffer for the encapsulated key.

outOff:int

the offset for the output buffer.

keyLen:int

the length of the random session key.

Returns:CipherParameters

the random session key.

encryptback to summary
public CipherParameters encrypt(byte[] out, int keyLen)

Generate and encapsulate a random session key.

Parameters
out:byte[]

the output buffer for the encapsulated key.

keyLen:int

the length of the random session key.

Returns:CipherParameters

the random session key.

initback to summary
public void init(CipherParameters key) throws IllegalArgumentException

Implements org.bouncycastle.crypto.KeyEncapsulation.init.

Initialise the RSA-KEM.

Parameters
key:CipherParameters

the recipient's public (for encryption) or private (for decryption) key.