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.​MLKemOpenSsl

Assembly: System.Security.Cryptography

Inheritance: object → MLKem → MLKemOpenSsl

Implemented Interfaces

Represents an ML-KEM key backed by OpenSSL.

Properties

Algorithm
Gets the specific ML-KEM algorithm for this key.

Methods

protected void
DecapsulateCore​(ReadOnlySpan<​byte> ciphertext, Span<​byte> sharedSecret)
protected void
Dispose​(bool disposing)
DuplicateKeyHandle​()
Gets a <see cref="T:System.Security.Cryptography.SafeEvpPKeyHandle" /> representation of the cryptographic key.
Returns A <see cref="T:System.Security.Cryptography.SafeEvpPKeyHandle" /> representation of the cryptographic key.
protected void
EncapsulateCore​(Span<​byte> ciphertext, Span<​byte> sharedSecret)
protected void
ExportDecapsulationKeyCore​(Span<​byte> destination)
protected void
ExportEncapsulationKeyCore​(Span<​byte> destination)
protected void
ExportPrivateSeedCore​(Span<​byte> destination)
protected bool
TryExportPkcs8PrivateKeyCore​(Span<​byte> destination, Int32& bytesWritten)
public byte[]
Decapsulate​(byte[] ciphertext)
Inherited from MLKem
Decapsulates a shared secret from a provided ciphertext.
Returns The shared secret.
ciphertext The ciphertext.
public void
Decapsulate​(ReadOnlySpan<​byte> ciphertext, Span<​byte> sharedSecret)
Inherited from MLKem
Decapsulates a shared secret from a provided ciphertext.
ciphertext The ciphertext.
sharedSecret The buffer to receive the shared secret.
public void
Dispose​()
Inherited from MLKem
Releases all resources used by the <see cref="T:System.Security.Cryptography.MLKem" /> class.
public void
Encapsulate​(Byte[]& ciphertext, Byte[]& sharedSecret)
Inherited from MLKem
public void
Encapsulate​(Span<​byte> ciphertext, Span<​byte> sharedSecret)
Inherited from MLKem
Creates an encapsulation ciphertext and shared secret, writing them into the provided buffers.
ciphertext The buffer to receive the ciphertext.
sharedSecret The buffer to receive the shared secret.
public byte[]
ExportDecapsulationKey​()
Inherited from MLKem
Exports the decapsulation key.
Returns The decapsulation key.
public void
ExportDecapsulationKey​(Span<​byte> destination)
Inherited from MLKem
Exports the decapsulation key into the provided buffer.
destination The buffer to receive the decapsulation key.
public byte[]
ExportEncapsulationKey​()
Inherited from MLKem
Exports the encapsulation key.
Returns The encapsulation key.
public void
ExportEncapsulationKey​(Span<​byte> destination)
Inherited from MLKem
Exports the encapsulation key into the provided buffer.
destination The buffer to receive the encapsulation key.
public byte[]
ExportEncryptedPkcs8PrivateKey​(ReadOnlySpan<​byte> passwordBytes, PbeParameters pbeParameters)
Inherited from MLKem
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a byte-based password.
Returns A byte array containing the PKCS#8 EncryptedPrivateKeyInfo representation of this key.
passwordBytes The password to use when encrypting the key material.
pbeParameters The password-based encryption (PBE) parameters to use when encrypting the key material.
public byte[]
ExportEncryptedPkcs8PrivateKey​(ReadOnlySpan<​char> password, PbeParameters pbeParameters)
Inherited from MLKem
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password.
Returns A byte array containing the PKCS#8 EncryptedPrivateKeyInfo representation of this key.
password The password to use when encrypting the key material.
pbeParameters The password-based encryption (PBE) parameters to use when encrypting the key material.
public byte[]
ExportEncryptedPkcs8PrivateKey​(string password, PbeParameters pbeParameters)
Inherited from MLKem
Exports the current key in the PKCS#8 EncryptedPrivateKeyInfo format with a char-based password.
Returns A byte array containing the PKCS#8 EncryptedPrivateKeyInfo representation of this key.
password The password to use when encrypting the key material.
pbeParameters The password-based encryption (PBE) parameters to use when encrypting the key material.
public string
ExportEncryptedPkcs8PrivateKeyPem​(ReadOnlySpan<​byte> passwordBytes, PbeParameters pbeParameters)
Inherited from MLKem
<para>Exports the current key in a PEM-encoded representation of the PKCS#8 EncryptedPrivateKeyInfo representation of this key, using a byte-based password.</para>
Returns A string containing the PEM-encoded PKCS#8 EncryptedPrivateKeyInfo.
passwordBytes The bytes to use as a password when encrypting the key material.
pbeParameters The password-based encryption (PBE) parameters to use when encrypting the key material.
public string
ExportEncryptedPkcs8PrivateKeyPem​(ReadOnlySpan<​char> password, PbeParameters pbeParameters)
Inherited from MLKem
<para>Exports the current key in a PEM-encoded representation of the PKCS#8 EncryptedPrivateKeyInfo representation of this key, using a char-based password.</para>
Returns A string containing the PEM-encoded PKCS#8 EncryptedPrivateKeyInfo.
password The password to use when encrypting the key material.
pbeParameters The password-based encryption (PBE) parameters to use when encrypting the key material.
public string
ExportEncryptedPkcs8PrivateKeyPem​(string password, PbeParameters pbeParameters)
Inherited from MLKem
<para>Exports the current key in a PEM-encoded representation of the PKCS#8 EncryptedPrivateKeyInfo representation of this key, using a string password.</para>
Returns A string containing the PEM-encoded PKCS#8 EncryptedPrivateKeyInfo.
password The password to use when encrypting the key material.
pbeParameters The password-based encryption (PBE) parameters to use when encrypting the key material.
public byte[]
ExportPkcs8PrivateKey​()
Inherited from MLKem
Export the current key in the PKCS#8 PrivateKeyInfo format.
Returns A byte array containing the PKCS#8 PrivateKeyInfo representation of this key.
public string
ExportPkcs8PrivateKeyPem​()
Inherited from MLKem
Exports the current key in a PEM-encoded representation of the PKCS#8 PrivateKeyInfo format.
Returns A string containing the PEM-encoded representation of the PKCS#8 PrivateKeyInfo.
public byte[]
ExportPrivateSeed​()
Inherited from MLKem
Exports the private seed.
Returns The private seed.
public void
ExportPrivateSeed​(Span<​byte> destination)
Inherited from MLKem
Exports the private seed into the provided buffer.
destination The buffer to receive the private seed.
public byte[]
ExportSubjectPublicKeyInfo​()
Inherited from MLKem
Exports the public-key portion of the current key in the X.509 SubjectPublicKeyInfo format.
Returns A byte array containing the X.509 SubjectPublicKeyInfo representation of the public-key portion of this key.
public string
ExportSubjectPublicKeyInfoPem​()
Inherited from MLKem
<para>Exports the public-key portion of the current key in a PEM-encoded representation of the X.509 SubjectPublicKeyInfo format.</para>
Returns <para>A string containing the PEM-encoded representation of the X.509 SubjectPublicKeyInfo representation of the public-key portion of this key.</para>
public bool
TryExportEncryptedPkcs8PrivateKey​(ReadOnlySpan<​byte> passwordBytes, PbeParameters pbeParameters, Span<​byte> destination, Int32& bytesWritten)
Inherited from MLKem
public bool
TryExportEncryptedPkcs8PrivateKey​(ReadOnlySpan<​char> password, PbeParameters pbeParameters, Span<​byte> destination, Int32& bytesWritten)
Inherited from MLKem
public bool
TryExportEncryptedPkcs8PrivateKey​(string password, PbeParameters pbeParameters, Span<​byte> destination, Int32& bytesWritten)
Inherited from MLKem
public bool
TryExportPkcs8PrivateKey​(Span<​byte> destination, Int32& bytesWritten)
Inherited from MLKem
public bool
TryExportSubjectPublicKeyInfo​(Span<​byte> destination, Int32& bytesWritten)
Inherited from MLKem
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object