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

public Class ECIESKeyEncapsulation

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.ECKeyParameters, .ECPrivateKeyParameters, .ECPublicKeyParameters, .KeyParameter, org.bouncycastle.util.Arrays

Deprecated

use ECIESKEMGenerator, ECIESKEMExtractor

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

Field Summary

Modifier and TypeField and Description
private boolean
private DerivationFunction
private ECKeyParameters
private boolean
private SecureRandom
private boolean

Constructor Summary

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

Set up the ECIES-KEM.

public
ECIESKeyEncapsulation(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
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.

Deprecated use ECIESKEMExtractor

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
)
Deprecated use ECIESKEMExtractor

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 session key.
keyLen
)

Implements org.bouncycastle.crypto.KeyEncapsulation.encrypt.

Deprecated use ECIESKEMGenerator

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 session key.
keyLen
)
Deprecated use ECIESKEMGenerator

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 ECIES-KEM.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CofactorModeback to summary
private boolean CofactorMode
kdfback to summary
private DerivationFunction kdf
keyback to summary
private ECKeyParameters key
OldCofactorModeback to summary
private boolean OldCofactorMode
rndback to summary
private SecureRandom rnd
SingleHashModeback to summary
private boolean SingleHashMode

Constructor Detail

ECIESKeyEncapsulationback to summary
public ECIESKeyEncapsulation(DerivationFunction kdf, SecureRandom rnd)

Set up the ECIES-KEM.

Parameters
kdf:DerivationFunction

the key derivation function to be used.

rnd:SecureRandom

the random source for the session key.

ECIESKeyEncapsulationback to summary
public ECIESKeyEncapsulation(DerivationFunction kdf, SecureRandom rnd, boolean cofactorMode, boolean oldCofactorMode, boolean singleHashMode)

Set up the ECIES-KEM.

Parameters
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

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

Implements org.bouncycastle.crypto.KeyEncapsulation.decrypt.

Deprecated

use ECIESKEMExtractor

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)

Deprecated

use ECIESKEMExtractor

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.

Deprecated

use ECIESKEMGenerator

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 session key.

Returns:CipherParameters

the random session key.

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

Deprecated

use ECIESKEMGenerator

Generate and encapsulate a random session key.

Parameters
out:byte[]

the output buffer for the encapsulated key.

keyLen:int

the length of the 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 ECIES-KEM.

Parameters
key:CipherParameters

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