Package org.bouncycastle.crypto.kems
Class ECIESKeyEncapsulation
java.lang.Object
org.bouncycastle.crypto.kems.ECIESKeyEncapsulation
- All Implemented Interfaces:
KeyEncapsulation
Deprecated.
use ECIESKEMGenerator, ECIESKEMExtractor
The ECIES Key Encapsulation Mechanism (ECIES-KEM) from ISO 18033-2.
-
Constructor Summary
ConstructorDescriptionDeprecated.Set up the ECIES-KEM.ECIESKeyEncapsulation
(DerivationFunction kdf, SecureRandom rnd, boolean cofactorMode, boolean oldCofactorMode, boolean singleHashMode) Deprecated.Set up the ECIES-KEM. -
Method Summary
Modifier and TypeMethodDescriptiondecrypt
(byte[] in, int keyLen) Deprecated.use ECIESKEMExtractordecrypt
(byte[] in, int inOff, int inLen, int keyLen) Deprecated.use ECIESKEMExtractorencrypt
(byte[] out, int keyLen) Deprecated.use ECIESKEMGeneratorencrypt
(byte[] out, int outOff, int keyLen) Deprecated.use ECIESKEMGeneratorvoid
init
(CipherParameters key) Deprecated.Initialise the ECIES-KEM.
-
Constructor Details
-
ECIESKeyEncapsulation
Deprecated.Set up the ECIES-KEM.- Parameters:
kdf
- the key derivation function to be used.rnd
- the random source for the session key.
-
ECIESKeyEncapsulation
public ECIESKeyEncapsulation(DerivationFunction kdf, SecureRandom rnd, boolean cofactorMode, boolean oldCofactorMode, boolean singleHashMode) Deprecated.Set up the ECIES-KEM.- Parameters:
kdf
- the key derivation function to be used.rnd
- the random source for the session key.cofactorMode
- if true use the new cofactor ECDH.oldCofactorMode
- if true use the old cofactor ECDH.singleHashMode
- if true use single hash mode.
-
-
Method Details
-
init
Deprecated.Initialise the ECIES-KEM.- Specified by:
init
in interfaceKeyEncapsulation
- Parameters:
key
- the recipient's public (for encryption) or private (for decryption) key.- Throws:
IllegalArgumentException
-
encrypt
Deprecated.use ECIESKEMGeneratorGenerate and encapsulate a random session key.- Specified by:
encrypt
in interfaceKeyEncapsulation
- Parameters:
out
- the output buffer for the encapsulated key.outOff
- the offset for the output buffer.keyLen
- the length of the session key.- Returns:
- the random session key.
- Throws:
IllegalArgumentException
-
encrypt
Deprecated.use ECIESKEMGeneratorGenerate and encapsulate a random session key.- Parameters:
out
- the output buffer for the encapsulated key.keyLen
- the length of the session key.- Returns:
- the random session key.
-
decrypt
public CipherParameters decrypt(byte[] in, int inOff, int inLen, int keyLen) throws IllegalArgumentException Deprecated.use ECIESKEMExtractorDecrypt an encapsulated session key.- Specified by:
decrypt
in interfaceKeyEncapsulation
- Parameters:
in
- the input buffer for the encapsulated key.inOff
- the offset for the input buffer.inLen
- the length of the encapsulated key.keyLen
- the length of the session key.- Returns:
- the session key.
- Throws:
IllegalArgumentException
-
decrypt
Deprecated.use ECIESKEMExtractorDecrypt an encapsulated session key.- Parameters:
in
- the input buffer for the encapsulated key.keyLen
- the length of the session key.- Returns:
- the session key.
-