StaticnewGenerate a new random MLKEMPrivateKey with the specified security level.
The ML-KEM security level (default: MLKEM768)
StaticnewGenerate a new random MLKEMPrivateKey using the provided RNG.
The ML-KEM security level
Random number generator
StaticfromCreate an MLKEMPrivateKey from raw bytes.
The ML-KEM security level
The private key bytes
StatickeypairGenerate a keypair and return both private and public keys.
The ML-KEM security level (default: MLKEM768)
Tuple of [privateKey, publicKey]
StatickeypairGenerate a keypair using the provided RNG.
The ML-KEM security level
Random number generator
Tuple of [privateKey, publicKey]
Returns the security level of this key.
Returns the raw key bytes.
Returns a copy of the raw key bytes.
Returns the size of the key in bytes.
Decapsulate a shared secret from a ciphertext.
The ML-KEM ciphertext
The decapsulated shared secret as a SymmetricKey
Derives and returns the corresponding public key.
In ML-KEM (FIPS 203), the decapsulation key contains the encapsulation key (public key) embedded within it. This method extracts that public key.
The corresponding MLKEMPublicKey
Get string representation (truncated for security).
Returns the CBOR tags associated with MLKEMPrivateKey.
Returns the untagged CBOR encoding.
Format: [level, key_bytes]
Returns the tagged CBOR encoding.
Returns the tagged value in CBOR binary representation.
Creates an MLKEMPrivateKey by decoding it from untagged CBOR.
Creates an MLKEMPrivateKey by decoding it from tagged CBOR.
StaticfromStaticfromStatic method to decode from tagged CBOR binary data.
StaticfromStatic method to decode from untagged CBOR binary data.
Returns the UR representation.
Returns the UR string representation.
StaticfromStaticfrom
MLKEMPrivateKey - Post-quantum key decapsulation private key using ML-KEM.