Interface MLKEMPrivateKey
- All Superinterfaces:
EncodableKeyPREVIEW, Key, PrivateKey
MLKEMPrivateKey is a preview API of the Java Card platform.
Preview features may be removed in a future release, or upgraded to permanent features of the Java Card platform.
MLKEMPrivateKey is the base interface for ML-KEM private keys with named parameters described in NIST FIPS 203 specifications - "Chapter 8. Parameter Sets".
- Since:
- preview
-
Method Summary
Modifier and TypeMethodDescriptionshortgetPublicKey(byte[] value, short offset) Copies the encoded form of the corresponding ML-KEM public key into the supplied buffer.Methods inherited from interface EncodableKeyPREVIEW
clearKey, getEncoded, getEncodingLength, getParams, setEncodedModifier and TypeMethodDescriptionvoidclearKey()Clears the key and sets its initialized state to false.shortgetEncoded(byte[] value, short offset) Gets the key in its primary encoding format.shortReturns the length, in bytes, of the primary encoded representation, corresponding to the buffer length expected byEncodableKey.getEncoded(byte[], short)andEncodableKey.setEncoded(byte[], short, short).Returns the parameter specification associated with this key instance.voidsetEncoded(byte[] value, short offset, short length) Sets the key from its primary encoding format.
-
Method Details
-
getPublicKey
short getPublicKey(byte[] value, short offset) Copies the encoded form of the corresponding ML-KEM public key into the supplied buffer. The format matches theekvalue defined in NIST FIPS 203 - "Chapter 7.1 ML-KEM Key Generation".- Parameters:
value- the destination buffer that receives the encoded public keyoffset- the offset withinvalueat which the encoded public key shall be written- Returns:
- the offset of the first byte following the encoded public key data
-
MLKEMPrivateKeywhen preview features are enabled.