Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Security.​Cryptography.​CompositeMLDsa
Assembly: System.Security.Cryptography
Inheritance: object → CompositeMLDsa
Represents a Composite ML-DSA key.
Properties
public
CompositeMLDsaAlgorithm
Algorithm
Gets the specific Composite ML-DSA algorithm for this key.
Methods
public
void
Dispose​()
Releases all resources used by the <see cref="T:System.Security.Cryptography.CompositeMLDsa" /> class.
protected
void
Dispose​(bool disposing)
disposing
<para>
<see langword="true" /> to release managed and unmanaged resources; <see langword="false" /> to release only unmanaged resources.</para>
<para>Called by the <see cref="M:System.Security.Cryptography.CompositeMLDsa.Dispose" /> method to release the managed and unmanaged resources used by the current instance of the <see cref="T:System.Security.Cryptography.CompositeMLDsa" /> class.</para>
public
byte[]
ExportCompositeMLDsaPrivateKey​() Returns The Composite ML-DSA private key.
Exports the private-key portion of the current key.
public
byte[]
ExportCompositeMLDsaPublicKey​() Returns The Composite ML-DSA public key.
Exports the public-key portion of the current key.
public
byte[]
ExportEncryptedPkcs8PrivateKey​(ReadOnlySpan`1 passwordBytes,
PbeParameters pbeParameters)
public
byte[]
ExportEncryptedPkcs8PrivateKey​(ReadOnlySpan`1 password,
PbeParameters pbeParameters)
public
byte[]
ExportEncryptedPkcs8PrivateKey​(string password,
PbeParameters pbeParameters)
password
The password to use when encrypting the key material.
pbeParameters
The password-based encryption (PBE) parameters to use when encrypting the key material.
Returns A byte array containing the PKCS#8 EncryptedPrivateKeyInfo representation of the this key.
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password.
public
string
ExportEncryptedPkcs8PrivateKeyPem​(ReadOnlySpan`1 passwordBytes,
PbeParameters pbeParameters)
public
string
ExportEncryptedPkcs8PrivateKeyPem​(ReadOnlySpan`1 password,
PbeParameters pbeParameters)
public
string
ExportEncryptedPkcs8PrivateKeyPem​(string password,
PbeParameters pbeParameters)
password
The password to use when encrypting the key material.
pbeParameters
The password-based encryption (PBE) parameters to use when encrypting the key material.
Returns A string containing the PEM-encoded PKCS#8 EncryptedPrivateKeyInfo.
<p>Exports the current key in a PEM-encoded representation of the PKCS#8 EncryptedPrivateKeyInfo representation of this key, using a char-based password.</p>
public
byte[]
ExportPkcs8PrivateKey​() Returns A byte array containing the PKCS#8 PrivateKeyInfo representation of the this key.
Exports the current key in the PKCS#8 PrivateKeyInfo format.
public
string
ExportPkcs8PrivateKeyPem​() Returns <para>A string containing the PEM-encoded representation of the PKCS#8 PrivateKeyInfo representation of the public-key portion of this key.</para>
Exports the current key in a PEM-encoded representation of the PKCS#8 PrivateKeyInfo format.
public
byte[]
ExportSubjectPublicKeyInfo​() Returns A byte array containing the X.509 SubjectPublicKeyInfo representation of the public-key portion of this key.
Exports the public-key portion of the current key in the X.509 SubjectPublicKeyInfo format.
public
string
ExportSubjectPublicKeyInfoPem​() Returns <para>A string containing the PEM-encoded representation of the X.509 SubjectPublicKeyInfo representation of the public-key portion of this key.</para>
<para>Exports the public-key portion of the current key in a PEM-encoded representation of the X.509 SubjectPublicKeyInfo format.</para>
public
byte[]
SignData​(byte[] data,
byte[] context = null)
data
The data to sign.
context
<para>An optional context-specific value to limit the scope of the signature.</para> <para>The default value is <see langword="null" />.</para>
Returns The Composite ML-DSA signature of the specified data.
Signs the specified data.
public
int
SignData​(ReadOnlySpan`1 data,
Span`1 destination,
ReadOnlySpan`1 context = null)
protected
int
SignDataCore​(ReadOnlySpan`1 data,
ReadOnlySpan`1 context,
Span`1 destination)
public
bool
TryExportCompositeMLDsaPrivateKey​(Span`1 destination,
Int32& bytesWritten)
public
bool
TryExportCompositeMLDsaPublicKey​(Span`1 destination,
Int32& bytesWritten)
public
bool
TryExportEncryptedPkcs8PrivateKey​(ReadOnlySpan`1 passwordBytes,
PbeParameters pbeParameters,
Span`1 destination,
Int32& bytesWritten)
public
bool
TryExportEncryptedPkcs8PrivateKey​(ReadOnlySpan`1 password,
PbeParameters pbeParameters,
Span`1 destination,
Int32& bytesWritten)
public
bool
TryExportEncryptedPkcs8PrivateKey​(string password,
PbeParameters pbeParameters,
Span`1 destination,
Int32& bytesWritten)
protected
bool
TryExportPkcs8PrivateKeyCore​(Span`1 destination,
Int32& bytesWritten)
public
bool
VerifyData​(byte[] data,
byte[] signature,
byte[] context = null)
data
The data to verify.
signature
The signature to verify.
context
<para>The context value which was provided during signing.</para> <para>The default value is <see langword="null" />.</para>
Returns <see langword="true" /> if the signature validates the data; otherwise, <see langword="false" /> .
Verifies that the specified signature is valid for this key and the provided data.
public
bool
VerifyData​(ReadOnlySpan`1 data,
ReadOnlySpan`1 signature,
ReadOnlySpan`1 context = null)
protected
bool
VerifyDataCore​(ReadOnlySpan`1 data,
ReadOnlySpan`1 context,
ReadOnlySpan`1 signature)
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object