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

public Class RSAKEMGenerator

extends Object
implements EncapsulatedSecretGenerator
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.EncapsulatedSecretGenerator
Imports
java.math.BigInteger, java.security.SecureRandom, org.bouncycastle.crypto.CryptoServicePurpose, .CryptoServicesRegistrar, .DerivationFunction, .EncapsulatedSecretGenerator, .SecretWithEncapsulation, org.bouncycastle.crypto.constraints.ConstraintUtils, .DefaultServiceProperties, org.bouncycastle.crypto.params.AsymmetricKeyParameter, .KDFParameters, .RSAKeyParameters, org.bouncycastle.util.BigIntegers

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

Field Summary

Modifier and TypeField and Description
private DerivationFunction
private final int
private static final BigInteger
private SecureRandom
private static final BigInteger

Constructor Summary

AccessConstructor and Description
public
RSAKEMGenerator(int keyLen, 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 SecretWithEncapsulation
generateEncapsulated(AsymmetricKeyParameter recipientKey)

Implements org.bouncycastle.crypto.EncapsulatedSecretGenerator.generateEncapsulated.

Generate secret/encapsulation based on the recipient public key.
pack-priv static byte[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

kdfback to summary
private DerivationFunction kdf
keyLenback to summary
private final int keyLen
ONEback to summary
private static final BigInteger ONE
rndback to summary
private SecureRandom rnd
ZEROback to summary
private static final BigInteger ZERO

Constructor Detail

RSAKEMGeneratorback to summary
public RSAKEMGenerator(int keyLen, 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

generateEncapsulatedback to summary
public SecretWithEncapsulation generateEncapsulated(AsymmetricKeyParameter recipientKey)

Implements org.bouncycastle.crypto.EncapsulatedSecretGenerator.generateEncapsulated.

Doc from org.bouncycastle.crypto.EncapsulatedSecretGenerator.generateEncapsulated.

Generate secret/encapsulation based on the recipient public key.

Returns:SecretWithEncapsulation

An SecretWithEncapsulation derived from the recipient public key.

generateKeyback to summary
pack-priv static byte[] generateKey(DerivationFunction kdf, BigInteger n, BigInteger r, int keyLen)