System.Security.Cryptography.CompositeMLKem
Represents a Composite ML-KEM key.
Gets the specific Composite ML-KEM algorithm for this key.
Initializes a new instance of the CompositeMLKem class.
Generates a new Composite ML-KEM key.
public static CompositeMLKem ImportDecapsulationKey(CompositeMLKemAlgorithm algorithm, byte[] source)
Imports a Composite ML-KEM key from a decapsulation key.
public static CompositeMLKem ImportDecapsulationKey(CompositeMLKemAlgorithm algorithm, ReadOnlySpan<byte> source)
Imports a Composite ML-KEM key from a decapsulation key.
public static CompositeMLKem ImportEncapsulationKey(CompositeMLKemAlgorithm algorithm, byte[] source)
Imports a Composite ML-KEM key from an encapsulation key.
public static CompositeMLKem ImportEncapsulationKey(CompositeMLKemAlgorithm algorithm, ReadOnlySpan<byte> source)
Imports a Composite ML-KEM key from an encapsulation key.
Imports a Composite ML-KEM decapsulation key from a PKCS#8 EncryptedPrivateKeyInfo structure.
public static CompositeMLKem ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<byte> source)
Imports a Composite ML-KEM decapsulation key from a PKCS#8 EncryptedPrivateKeyInfo structure.
public static CompositeMLKem ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, ReadOnlySpan<byte> source)
Imports a Composite ML-KEM decapsulation key from a PKCS#8 EncryptedPrivateKeyInfo structure.
Imports a Composite ML-KEM key from an encrypted RFC 7468 PEM-encoded string.
public static CompositeMLKem ImportFromEncryptedPem(ReadOnlySpan<char> source, ReadOnlySpan<char> password)
Imports a Composite ML-KEM key from an encrypted RFC 7468 PEM-encoded string.
Imports a Composite ML-KEM key from an encrypted RFC 7468 PEM-encoded string.
public static CompositeMLKem ImportFromEncryptedPem(ReadOnlySpan<char> source, ReadOnlySpan<byte> passwordBytes)
Imports a Composite ML-KEM key from an encrypted RFC 7468 PEM-encoded string.
Imports a Composite ML-KEM key from an RFC 7468 PEM-encoded string.
Imports a Composite ML-KEM key from an RFC 7468 PEM-encoded string.
Imports a Composite ML-KEM decapsulation key from a PKCS#8 PrivateKeyInfo structure.
Imports a Composite ML-KEM decapsulation key from a PKCS#8 PrivateKeyInfo structure.
Imports a Composite ML-KEM encapsulation key from an X.509 SubjectPublicKeyInfo structure.
Imports a Composite ML-KEM encapsulation key from an X.509 SubjectPublicKeyInfo structure.
Determines whether the specified algorithm is supported by the current platform.
Decapsulates a shared secret from a provided ciphertext.
Decapsulates a shared secret from a provided ciphertext, writing it into the provided buffer.
When overridden in a derived class, decapsulates a shared secret from a provided ciphertext.
Releases all resources used by the CompositeMLKem class.
Called by the Dispose method to release the managed and unmanaged
resources used by the current instance of the CompositeMLKem class.
Creates an encapsulation ciphertext and shared secret.
Creates an encapsulation ciphertext and shared secret, writing them into the provided buffers.
When overridden in a derived class, creates an encapsulation ciphertext and shared secret, writing them
into the provided buffers.
Exports the decapsulation key.
Exports the decapsulation key into the provided buffer.
When overridden in a derived class, exports the decapsulation key into the provided buffer.
Exports the encapsulation key.
Exports the encapsulation key into the provided buffer.
When overridden in a derived class, exports the encapsulation key into the provided buffer.
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-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.
public byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters)
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a byte-based password.
Exports the current key in a PEM-encoded representation of the PKCS#8 EncryptedPrivateKeyInfo
representation of this key, using a string 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.
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.
Exports 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 encapsulation key portion of the current key in the X.509 SubjectPublicKeyInfo format.
Exports the encapsulation key portion of the current key in a PEM-encoded representation of
the X.509 SubjectPublicKeyInfo format.
Attempts to export the decapsulation key into the provided buffer.
Attempts to export the encapsulation key into the provided buffer.
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<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(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 encapsulation key portion of the current key in the X.509 SubjectPublicKeyInfo format
into the provided buffer.