System.Security.Cryptography.MLKem
Represents an ML-KEM key.
Gets a value that indicates whether the algorithm is supported on the current platform.
Gets the specific ML-KEM algorithm for this key.
Initializes a new instance of the MLKem class.
Generates a new ML-KEM key.
Imports an ML-KEM key from a decapsulation key.
Imports an ML-KEM key from a decapsulation key.
Imports an ML-KEM key from a encapsulation key.
Imports an ML-KEM key from a encapsulation key.
public static MLKem ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, ReadOnlySpan<byte> source)
Imports an ML-KEM private key from a PKCS#8 EncryptedPrivateKeyInfo structure.
public static MLKem ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<byte> source)
Imports an ML-KEM private key from a PKCS#8 EncryptedPrivateKeyInfo structure.
Imports an ML-KEM private key from a PKCS#8 EncryptedPrivateKeyInfo structure.
Imports an ML-KEM key from an encrypted RFC 7468 PEM-encoded string.
public static MLKem ImportFromEncryptedPem(ReadOnlySpan<char> source, ReadOnlySpan<byte> passwordBytes)
Imports an ML-KEM key from an encrypted RFC 7468 PEM-encoded string.
Imports an ML-KEM key from an RFC 7468 PEM-encoded string.
Imports an ML-KEM private key from a PKCS#8 PrivateKeyInfo structure.
Imports an ML-KEM key from its private seed value.
Imports an ML-KEM key from its private seed value.
Imports an ML-KEM encapsulation key from an X.509 SubjectPublicKeyInfo structure.
Decapsulates a shared secret from a provided ciphertext.
Decapsulates a shared secret from a provided ciphertext.
When overridden in a derived class, decapsulates a shared secret from a provided ciphertext.
Releases all resources used by the MLKem class.
Called by the Dispose() and Finalize() methods to release the managed and unmanaged
resources used by the current instance of the MLKem class.
Creates an encapsulation ciphertext and shared secret, writing them into the provided buffers.
Creates an encapsulation ciphertext and shared secret.
When overridden in a derived class, creates an encapsulation ciphertext and shared secret, writing them
into the provided buffers.
Exports the decapsulation key into the provided buffer.
Exports the decapsulation key.
When overridden in a derived class, exports the decapsulation key into the provided buffer.
Exports the encapsulation key into the provided buffer.
Exports the encapsulation key.
When overridden in a derived class, exports the encapsulation key into the provided buffer.
public byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters)
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a byte-based password.
public byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, PbeParameters pbeParameters)
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password.
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password.
public string ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters)
Exports the current key in a PEM-encoded representation of the PKCS#8 EncryptedPrivateKeyInfo
representation of this key, using a byte-based password.
public string ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<char> password, PbeParameters pbeParameters)
Exports the current key in a PEM-encoded representation of the PKCS#8 EncryptedPrivateKeyInfo
representation of this key, using a char-based password.
Exports the current key in a PEM-encoded representation of the PKCS#8 EncryptedPrivateKeyInfo
representation of this key, using a string password.
Export the current key in the PKCS#8 PrivateKeyInfo format.
Exports the current key in a PEM-encoded representation of the PKCS#8 PrivateKeyInfo format.
Exports the private seed into the provided buffer.
Exports the private seed.
When overridden in a derived class, exports the private seed into the provided buffer.
Exports the public-key portion of the current key in the X.509 SubjectPublicKeyInfo format.
Exports the public-key portion of the current key in a PEM-encoded representation of
the X.509 SubjectPublicKeyInfo format.
public bool TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, PbeParameters pbeParameters, Span<byte> destination, out int bytesWritten)
Attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo format into a provided buffer,
using a char-based password.
public bool TryExportEncryptedPkcs8PrivateKey(string password, PbeParameters pbeParameters, Span<byte> destination, out int bytesWritten)
Attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo format into a provided buffer,
using a char-based password.
public bool TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters, Span<byte> destination, out int bytesWritten)
Attempts to export the current key in the PKCS#8 EncryptedPrivateKeyInfo format into a provided buffer,
using a byte-based password.
Attempts to export the current key in the PKCS#8 PrivateKeyInfo format
into the provided buffer.
When overridden in a derived class, attempts to export the current key in the PKCS#8 PrivateKeyInfo format
into the provided buffer.
Attempts to export the public-key portion of the current key in the X.509 SubjectPublicKeyInfo format
into the provided buffer.