System.Security.Cryptography.CompositeMLDsa
Represents a Composite ML-DSA key.
Gets a value indicating whether the current platform supports Composite ML-DSA.
Gets the specific Composite ML-DSA algorithm for this key.
Initializes a new instance of the CompositeMLDsa class.
Generates a new Composite ML-DSA key.
public static CompositeMLDsa ImportCompositeMLDsaPrivateKey(CompositeMLDsaAlgorithm algorithm, byte[] source)
public static CompositeMLDsa ImportCompositeMLDsaPrivateKey(CompositeMLDsaAlgorithm algorithm, ReadOnlySpan<byte> source)
Imports a Composite ML-DSA private key.
public static CompositeMLDsa ImportCompositeMLDsaPublicKey(CompositeMLDsaAlgorithm algorithm, byte[] source)
public static CompositeMLDsa ImportCompositeMLDsaPublicKey(CompositeMLDsaAlgorithm algorithm, ReadOnlySpan<byte> source)
Imports a Composite ML-DSA public key.
public static CompositeMLDsa ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<byte> source)
Imports a Composite ML-DSA private key from a PKCS#8 EncryptedPrivateKeyInfo structure.
public static CompositeMLDsa ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, ReadOnlySpan<byte> source)
Imports a Composite ML-DSA private key from a PKCS#8 EncryptedPrivateKeyInfo structure.
public static CompositeMLDsa ImportFromEncryptedPem(ReadOnlySpan<char> source, ReadOnlySpan<char> password)
Imports a Composite ML-DSA key from an encrypted RFC 7468 PEM-encoded string.
public static CompositeMLDsa ImportFromEncryptedPem(ReadOnlySpan<char> source, ReadOnlySpan<byte> passwordBytes)
Imports a Composite ML-DSA key from an encrypted RFC 7468 PEM-encoded string.
Imports a Composite ML-DSA key from an RFC 7468 PEM-encoded string.
Imports a Composite ML-DSA private key from a PKCS#8 PrivateKeyInfo structure.
Imports a Composite ML-DSA public key from an X.509 SubjectPublicKeyInfo structure.
Determines whether the specified algorithm is supported by the current platform.
Releases all resources used by the CompositeMLDsa class.
Called by the Dispose method to release the managed and unmanaged
resources used by the current instance of the CompositeMLDsa class.
Exports the private-key portion of the current key.
Exports the private-key portion of the current key into the provided buffer.
When overridden in a derived class, exports the private key portion of the current key.
Exports the public-key portion of the current key.
Exports the public-key portion of the current key into the provided buffer.
When overridden in a derived class, exports the public key portion of the current key.
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.
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 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.
Signs the specified data.
public int SignData(ReadOnlySpan<byte> data, Span<byte> destination, ReadOnlySpan<byte> context = default)
Signs the specified data, writing the signature into the provided buffer.
protected abstract int SignDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, Span<byte> destination)
When overridden in a derived class, computes the signature of the specified data and context,
writing it into the provided buffer.
Attempts to export private key portion of the current key into the provided buffer.
Attempts to export public key portion of the current key into the provided buffer.
public bool TryExportEncryptedPkcs8PrivateKey(string password, PbeParameters pbeParameters, Span<byte> destination, out int bytesWritten)
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 public-key portion of the current key in the X.509 SubjectPublicKeyInfo format
into the provided buffer.
Verifies that the specified signature is valid for this key and the provided data.
public bool VerifyData(ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, ReadOnlySpan<byte> context = default)
Verifies that the specified signature is valid for this key and the provided data.
protected abstract bool VerifyDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, ReadOnlySpan<byte> signature)
When overridden in a derived class, verifies the signature of the specified data and context.