<PackageReference Include="SSH.NET" Version="2024.2.0" />

DsaDigitalSignature

Implements DSA digital signature algorithm.
using Renci.SshNet.Common; using System; using System.Runtime.CompilerServices; using System.Security.Cryptography; namespace Renci.SshNet.Security.Cryptography { [NullableContext(1)] [Nullable(0)] public class DsaDigitalSignature : DigitalSignature, IDisposable { private readonly DsaKey _key; public DsaDigitalSignature(DsaKey key) { ThrowHelper.ThrowIfNull(key, "key"); _key = key; } public override bool Verify(byte[] input, byte[] signature) { return _key.DSA.VerifyData(input, signature, HashAlgorithmName.SHA1); } public override byte[] Sign(byte[] input) { return _key.DSA.SignData(input, HashAlgorithmName.SHA1); } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { } } }