<PackageReference Include="Microsoft.Bcl.Cryptography" Version="11.0.0-rc.3.26522.148" />

System.Security.Cryptography.CompositeMLKem

public abstract class CompositeMLKem : IDisposable
Represents a Composite ML-KEM key.
namespace System.Security.Cryptography { public abstract class CompositeMLKem : IDisposable { public CompositeMLKemAlgorithm Algorithm { get; } protected CompositeMLKem(CompositeMLKemAlgorithm algorithm); public static bool IsAlgorithmSupported(CompositeMLKemAlgorithm algorithm); public static CompositeMLKem GenerateKey(CompositeMLKemAlgorithm algorithm); public void Encapsulate(out byte[] ciphertext, out byte[] sharedSecret); public void Encapsulate(Span<byte> ciphertext, Span<byte> sharedSecret); protected abstract void EncapsulateCore(Span<byte> ciphertext, Span<byte> sharedSecret); public byte[] Decapsulate(byte[] ciphertext); public void Decapsulate(ReadOnlySpan<byte> ciphertext, Span<byte> sharedSecret); protected abstract void DecapsulateCore(ReadOnlySpan<byte> ciphertext, Span<byte> sharedSecret); public static CompositeMLKem ImportEncapsulationKey(CompositeMLKemAlgorithm algorithm, byte[] source); public static CompositeMLKem ImportEncapsulationKey(CompositeMLKemAlgorithm algorithm, ReadOnlySpan<byte> source); public static CompositeMLKem ImportDecapsulationKey(CompositeMLKemAlgorithm algorithm, byte[] source); public static CompositeMLKem ImportDecapsulationKey(CompositeMLKemAlgorithm algorithm, ReadOnlySpan<byte> source); public static CompositeMLKem ImportSubjectPublicKeyInfo(byte[] source); public static CompositeMLKem ImportSubjectPublicKeyInfo(ReadOnlySpan<byte> source); public static CompositeMLKem ImportPkcs8PrivateKey(byte[] source); public static CompositeMLKem ImportPkcs8PrivateKey(ReadOnlySpan<byte> source); public static CompositeMLKem ImportEncryptedPkcs8PrivateKey(string password, byte[] source); public static CompositeMLKem ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<byte> source); public static CompositeMLKem ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, ReadOnlySpan<byte> source); public static CompositeMLKem ImportFromPem(string source); public static CompositeMLKem ImportFromPem(ReadOnlySpan<char> source); public static CompositeMLKem ImportFromEncryptedPem(string source, string password); public static CompositeMLKem ImportFromEncryptedPem(ReadOnlySpan<char> source, ReadOnlySpan<char> password); public static CompositeMLKem ImportFromEncryptedPem(string source, byte[] passwordBytes); public static CompositeMLKem ImportFromEncryptedPem(ReadOnlySpan<char> source, ReadOnlySpan<byte> passwordBytes); public string ExportEncryptedPkcs8PrivateKeyPem(string password, PbeParameters pbeParameters); public string ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<char> password, PbeParameters pbeParameters); public string ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters); public byte[] ExportEncryptedPkcs8PrivateKey(string password, PbeParameters pbeParameters); public byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, PbeParameters pbeParameters); public byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters); 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); public bool TryExportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters, Span<byte> destination, out int bytesWritten); public string ExportPkcs8PrivateKeyPem(); public byte[] ExportPkcs8PrivateKey(); public bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten); protected abstract bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten); public string ExportSubjectPublicKeyInfoPem(); public byte[] ExportSubjectPublicKeyInfo(); public bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten); public byte[] ExportEncapsulationKey(); public int ExportEncapsulationKey(Span<byte> destination); public bool TryExportEncapsulationKey(Span<byte> destination, out int bytesWritten); protected abstract int ExportEncapsulationKeyCore(Span<byte> destination); public byte[] ExportDecapsulationKey(); public int ExportDecapsulationKey(Span<byte> destination); public bool TryExportDecapsulationKey(Span<byte> destination, out int bytesWritten); protected abstract int ExportDecapsulationKeyCore(Span<byte> destination); public void Dispose(); protected virtual void Dispose(bool disposing); } }