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

public Class ECIESKEMGenerator

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, .ECDomainParameters, .ECKeyParameters, .ECPublicKeyParameters, .KDFParameters, org.bouncycastle.math.ec.ECCurve, .ECMultiplier, .ECPoint, .FixedPointCombMultiplier, org.bouncycastle.util.Arrays, .BigIntegers

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

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
ECIESKEMGenerator(int
size of the key to be generated (in bytes).
keySize
,
DerivationFunction
the key derivation function to be used.
kdf
,
SecureRandom
the random source for the session key.
rnd
)

Set up the ECIES-KEM.

public
ECIESKEMGenerator(int
length in bytes of key to generate
keyLen
,
DerivationFunction
the key derivation function to be used.
kdf
,
SecureRandom
the random source for the session key.
rnd
,
boolean
if true use the new cofactor ECDH.
cofactorMode
,
boolean
if true use the old cofactor ECDH.
oldCofactorMode
,
boolean
if true use single hash mode.
singleHashMode
)

Set up the ECIES-KEM.

Method Summary

Modifier and TypeMethod and Description
private ECMultiplier
pack-priv static byte[]
deriveKey(boolean SingleHashMode, DerivationFunction kdf, int keyLen, byte[] C, byte[] PEH)

public SecretWithEncapsulation
generateEncapsulated(AsymmetricKeyParameter recipientKey)

Implements org.bouncycastle.crypto.EncapsulatedSecretGenerator.generateEncapsulated.

Generate secret/encapsulation based on the recipient public key.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CofactorModeback to summary
private boolean CofactorMode
kdfback to summary
private DerivationFunction kdf
keySizeback to summary
private final int keySize
OldCofactorModeback to summary
private boolean OldCofactorMode
ONEback to summary
private static final BigInteger ONE
rndback to summary
private SecureRandom rnd
SingleHashModeback to summary
private boolean SingleHashMode

Constructor Detail

ECIESKEMGeneratorback to summary
public ECIESKEMGenerator(int keySize, DerivationFunction kdf, SecureRandom rnd)

Set up the ECIES-KEM.

Parameters
keySize:int

size of the key to be generated (in bytes).

kdf:DerivationFunction

the key derivation function to be used.

rnd:SecureRandom

the random source for the session key.

ECIESKEMGeneratorback to summary
public ECIESKEMGenerator(int keyLen, DerivationFunction kdf, SecureRandom rnd, boolean cofactorMode, boolean oldCofactorMode, boolean singleHashMode)

Set up the ECIES-KEM.

Parameters
keyLen:int

length in bytes of key to generate

kdf:DerivationFunction

the key derivation function to be used.

rnd:SecureRandom

the random source for the session key.

cofactorMode:boolean

if true use the new cofactor ECDH.

oldCofactorMode:boolean

if true use the old cofactor ECDH.

singleHashMode:boolean

if true use single hash mode.

Method Detail

createBasePointMultiplierback to summary
private ECMultiplier createBasePointMultiplier()
deriveKeyback to summary
pack-priv static byte[] deriveKey(boolean SingleHashMode, DerivationFunction kdf, int keyLen, byte[] C, byte[] PEH)
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.