Edit

Share via


MLKem.GenerateKey(MLKemAlgorithm) Method

Definition

Generates a new ML-KEM key.

public:
 static System::Security::Cryptography::MLKem ^ GenerateKey(System::Security::Cryptography::MLKemAlgorithm ^ algorithm);
public static System.Security.Cryptography.MLKem GenerateKey(System.Security.Cryptography.MLKemAlgorithm algorithm);
static member GenerateKey : System.Security.Cryptography.MLKemAlgorithm -> System.Security.Cryptography.MLKem
Public Shared Function GenerateKey (algorithm As MLKemAlgorithm) As MLKem

Parameters

algorithm
MLKemAlgorithm

An algorithm identifying what kind of ML-KEM key to generate.

Returns

The generated key.

Exceptions

algorithm is null.

An error occurred generating the ML-KEM key.

The platform does not support ML-KEM. Callers can use the IsSupported property to determine if the platform supports ML-KEM.

Applies to