<PackageReference Include="Microsoft.Bcl.Cryptography" Version="10.0.11" />

System.Security.Cryptography.SlhDsa

public abstract class SlhDsa : IDisposable
Represents an SLH-DSA key.
namespace System.Security.Cryptography { public abstract class SlhDsa : IDisposable { private delegate TResult ExportPkcs8PrivateKeyFunc<TResult> (ReadOnlySpan<byte> pkcs8); public static bool IsSupported { get; } public SlhDsaAlgorithm Algorithm { get; } protected SlhDsa(SlhDsaAlgorithm algorithm); public void Dispose(); public void SignData(ReadOnlySpan<byte> data, Span<byte> destination, ReadOnlySpan<byte> context = default(ReadOnlySpan<byte>)); public byte[] SignData(byte[] data, byte[] context = null); public bool VerifyData(ReadOnlySpan<byte> data, ReadOnlySpan<byte> signature, ReadOnlySpan<byte> context = default(ReadOnlySpan<byte>)); public bool VerifyData(byte[] data, byte[] signature, byte[] context = null); public void SignPreHash(ReadOnlySpan<byte> hash, Span<byte> destination, string hashAlgorithmOid, ReadOnlySpan<byte> context = default(ReadOnlySpan<byte>)); public byte[] SignPreHash(byte[] hash, string hashAlgorithmOid, byte[] context = null); public bool VerifyPreHash(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, string hashAlgorithmOid, ReadOnlySpan<byte> context = default(ReadOnlySpan<byte>)); public bool VerifyPreHash(byte[] hash, byte[] signature, string hashAlgorithmOid, byte[] context = null); public byte[] ExportSubjectPublicKeyInfo(); public bool TryExportSubjectPublicKeyInfo(Span<byte> destination, out int bytesWritten); public string ExportSubjectPublicKeyInfoPem(); public byte[] ExportPkcs8PrivateKey(); public bool TryExportPkcs8PrivateKey(Span<byte> destination, out int bytesWritten); protected virtual bool TryExportPkcs8PrivateKeyCore(Span<byte> destination, out int bytesWritten); public string ExportPkcs8PrivateKeyPem(); public byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, PbeParameters pbeParameters); public byte[] ExportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters); public byte[] ExportEncryptedPkcs8PrivateKey(string password, PbeParameters pbeParameters); 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 bool TryExportEncryptedPkcs8PrivateKey(string password, PbeParameters pbeParameters, Span<byte> destination, out int bytesWritten); public string ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<char> password, PbeParameters pbeParameters); public string ExportEncryptedPkcs8PrivateKeyPem(ReadOnlySpan<byte> passwordBytes, PbeParameters pbeParameters); public string ExportEncryptedPkcs8PrivateKeyPem(string password, PbeParameters pbeParameters); public void ExportSlhDsaPublicKey(Span<byte> destination); public byte[] ExportSlhDsaPublicKey(); public void ExportSlhDsaPrivateKey(Span<byte> destination); public byte[] ExportSlhDsaPrivateKey(); public static SlhDsa GenerateKey(SlhDsaAlgorithm algorithm); public static SlhDsa ImportSubjectPublicKeyInfo(ReadOnlySpan<byte> source); public static SlhDsa ImportSubjectPublicKeyInfo(byte[] source); public static SlhDsa ImportPkcs8PrivateKey(ReadOnlySpan<byte> source); public static SlhDsa ImportPkcs8PrivateKey(byte[] source); public static SlhDsa ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<byte> passwordBytes, ReadOnlySpan<byte> source); public static SlhDsa ImportEncryptedPkcs8PrivateKey(ReadOnlySpan<char> password, ReadOnlySpan<byte> source); public static SlhDsa ImportEncryptedPkcs8PrivateKey(string password, byte[] source); public static SlhDsa ImportFromPem(ReadOnlySpan<char> source); public static SlhDsa ImportFromPem(string source); public static SlhDsa ImportFromEncryptedPem(ReadOnlySpan<char> source, ReadOnlySpan<char> password); public static SlhDsa ImportFromEncryptedPem(ReadOnlySpan<char> source, ReadOnlySpan<byte> passwordBytes); public static SlhDsa ImportFromEncryptedPem(string source, string password); public static SlhDsa ImportFromEncryptedPem(string source, byte[] passwordBytes); public static SlhDsa ImportSlhDsaPublicKey(SlhDsaAlgorithm algorithm, ReadOnlySpan<byte> source); public static SlhDsa ImportSlhDsaPublicKey(SlhDsaAlgorithm algorithm, byte[] source); public static SlhDsa ImportSlhDsaPrivateKey(SlhDsaAlgorithm algorithm, ReadOnlySpan<byte> source); public static SlhDsa ImportSlhDsaPrivateKey(SlhDsaAlgorithm algorithm, byte[] source); protected virtual void Dispose(bool disposing); protected abstract void SignDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, Span<byte> destination); protected abstract bool VerifyDataCore(ReadOnlySpan<byte> data, ReadOnlySpan<byte> context, ReadOnlySpan<byte> signature); protected abstract void SignPreHashCore(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> context, string hashAlgorithmOid, Span<byte> destination); protected abstract bool VerifyPreHashCore(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> context, string hashAlgorithmOid, ReadOnlySpan<byte> signature); protected abstract void ExportSlhDsaPublicKeyCore(Span<byte> destination); protected abstract void ExportSlhDsaPrivateKeyCore(Span<byte> destination); } }