Post-quantum support depends on the module build and the backing CryptoHub release. Confirm the mechanisms and parameter sets your deployment advertises with
C_GetMechanismList before you rely on them. The examples below reflect the build documented in Overview.Post-quantum objects and attributes
The module exposes standardized PKCS#11 v3.2 post-quantum key types and attributes:Parameter sets
Post-quantum keys are selected by parameter set throughCKA_PARAMETER_SET, not by a key length in bits:
- ML-DSA:
ML-DSA-44,ML-DSA-65,ML-DSA-87(selected withCKP_ML_DSA_44,CKP_ML_DSA_65,CKP_ML_DSA_87). - ML-KEM:
ML-KEM-512,ML-KEM-768,ML-KEM-1024(selected withCKP_ML_KEM_512,CKP_ML_KEM_768,CKP_ML_KEM_1024).
Usage requirements
- ML-DSA keys require sign and verify usage (
CKA_SIGNon the private key,CKA_VERIFYon the public key). - ML-KEM keys require the appropriate encapsulation or decapsulation usage and the correct public/private role: encapsulation uses an ML-KEM public key, and decapsulation requires the ML-KEM private key.
Discover the post-quantum mechanisms
Before you generate keys, confirm the module advertises the mechanisms and parameter sets you expect. Enumerate the mechanisms withC_GetMechanismList and inspect each one’s flags and ranges with C_GetMechanismInfo.
C
Generate an ML-DSA key pair
Generate an ML-DSA signing key pair by passingCKM_ML_DSA_KEY_PAIR_GEN and selecting the parameter set with CKA_PARAMETER_SET.
C
Sign and verify with ML-DSA
Sign with the pureCKM_ML_DSA mechanism. To sign a pre-hashed (externalized) message digest, use one of the CKM_HASH_ML_DSA* mechanisms instead and supply the matching digest.
C
Generate an ML-KEM key pair
Generate an ML-KEM key pair withCKM_ML_KEM_KEY_PAIR_GEN, selecting the parameter set with CKA_PARAMETER_SET and marking the keys for encapsulation and decapsulation.
C
Encapsulate and decapsulate with ML-KEM
ML-KEM uses the PKCS#11 v3.2C_EncapsulateKey and C_DecapsulateKey functions. Encapsulation takes the recipient’s ML-KEM public key, produces a ciphertext, and returns a handle to a freshly derived shared-secret key. Decapsulation takes the ciphertext and the recipient’s private key and returns a handle to the same shared-secret key. Use the result-key template to shape the derived key (for example, as an AES key), and handle the ciphertext-sizing call by querying the required length first.
C

