java.lang.Object
com.ibm.crypto.hdwrCCA.provider.MLKEMKeyAgreement
This class is a concrete implementation of the Service Provider Interface
(SPI) for key agreement using the ML-KEM key agreement algorithm.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateSecret
(String algorithm) - Creates the shared secret and returns it as a SecretKey object of the specified algorithm.void
init
(Key hybridKey, ECPrivateHWKey ecPrivKey, ECPublicKey ecPubKey, byte[] encryptedValue, byte[] iv) Initializes the MLKEMKeyAgreement object.void
init
(Key hybridKey, ECPrivateHWKey ecPrivKey, ECPublicKey ecPubKey, byte[] encryptedValue, byte[] iv, AlgorithmParameterSpec params) Initializes the MLKEMKeyAgreement object.
-
Constructor Details
-
MLKEMKeyAgreement
public MLKEMKeyAgreement()Constructor for the ML-KEM key agreement functionality.
-
-
Method Details
-
init
public void init(Key hybridKey, ECPrivateHWKey ecPrivKey, ECPublicKey ecPubKey, byte[] encryptedValue, byte[] iv, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException Initializes the MLKEMKeyAgreement object.- Parameters:
hybridKey
- A CCA AES CIPHER key or a ML-KEM private keyecPrivKey
- An ECPrivateKey created by Bob.ecPubKey
- An ECPublicKey created by Alice.aesEncryptedValue
- The encrypted AES value generated by a MLKEMDerivationInput.encrypt() call.iv
- The AES encryption initialization vectorparams
- The algorithm parameters for the key agreement operation- Throws:
InvalidKeyException
InvalidAlgorithmParameterException
-
init
public void init(Key hybridKey, ECPrivateHWKey ecPrivKey, ECPublicKey ecPubKey, byte[] encryptedValue, byte[] iv) throws InvalidKeyException Initializes the MLKEMKeyAgreement object.- Parameters:
hybridKey
- A CCA AES CIPHER key or a ML-KEM private keyecPrivKey
- An ECPrivateKey created by Bob.ecPubKey
- An ECPublicKey created by Alice.aesEncryptedValue
- The encrypted AES value generated by a MLKEMDerivationInput.encrypt() call.iv
- The AES encryption initialization vector- Throws:
InvalidKeyException
-
generateSecret
public SecretKey generateSecret(String algorithm) throws NoSuchAlgorithmException, InvalidKeyException - Creates the shared secret and returns it as a SecretKey object of the specified algorithm.- Parameters:
algorithm
-keyBitLength
-- Returns:
- Throws:
NoSuchAlgorithmException
InvalidKeyException
-