DSA.VerifySignature Method

Definition

Overloads

VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, DSASignatureFormat)

Verifies that a digital signature is valid for the provided hash.

VerifySignature(Byte[], Byte[])

When overridden in a derived class, verifies the DSA signature for the specified data.

VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

Verifies that a digital signature is valid for a provided data hash.

VerifySignature(Byte[], Byte[], DSASignatureFormat)

Verifies that a digital signature is valid for the provided hash.

VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>, DSASignatureFormat)

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs

Verifies that a digital signature is valid for the provided hash.

C#
public bool VerifySignature(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature, System.Security.Cryptography.DSASignatureFormat signatureFormat);

Parameters

hash
ReadOnlySpan<Byte>

The signed hash.

signature
ReadOnlySpan<Byte>

The signature to verify.

signatureFormat
DSASignatureFormat

The encoding format for signature.

Returns

true if the digital signature is valid for the provided data; otherwise, false.

Exceptions

signatureFormat is not a known format.

An error occurred in the verification operation.

Applies to

.NET 10 and other versions
Product Versions
.NET 5, 6, 7, 8, 9, 10

VerifySignature(Byte[], Byte[])

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs

When overridden in a derived class, verifies the DSA signature for the specified data.

C#
public abstract bool VerifySignature(byte[] rgbHash, byte[] rgbSignature);

Parameters

rgbHash
Byte[]

The hash of the data signed with rgbSignature.

rgbSignature
Byte[]

The signature to be verified for rgbData.

Returns

true if rgbSignature matches the signature computed using the specified hash algorithm and key on rgbHash; otherwise, false.

Exceptions

The implementation type only supports legacy DSA (FIPS 186-2), and the hash value is not 20 bytes long.

-or-

Verifying the signature otherwise failed.

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VerifySignature(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs

Verifies that a digital signature is valid for a provided data hash.

C#
public virtual bool VerifySignature(ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature);

Parameters

hash
ReadOnlySpan<Byte>

The data hash to verify.

signature
ReadOnlySpan<Byte>

The signature to be verify.

Returns

true if the digital signature is valid for the hash; otherwise, false.

Exceptions

The implementation type only supports legacy DSA (FIPS 186-2), and the hash value is not 20 bytes long.

-or-

Verifying the signature otherwise failed.

Remarks

The default implementation of this method calls VerifySignature(Byte[], Byte[]) after copying the spans to arrays. Derived types should override this method to avoid the intermediate array creation.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1

VerifySignature(Byte[], Byte[], DSASignatureFormat)

Source:
DSA.cs
Source:
DSA.cs
Source:
DSA.cs

Verifies that a digital signature is valid for the provided hash.

C#
public bool VerifySignature(byte[] rgbHash, byte[] rgbSignature, System.Security.Cryptography.DSASignatureFormat signatureFormat);

Parameters

rgbHash
Byte[]

The signed hash.

rgbSignature
Byte[]

The signature to verify.

signatureFormat
DSASignatureFormat

The encoding format for rgbSignature.

Returns

true if the digital signature is valid for the provided data; otherwise, false.

Exceptions

rgbHash or rgbSignature is null.

signatureFormat is not a known format.

An error occurred in the verification operation.

Applies to

.NET 10 and other versions
Product Versions
.NET 5, 6, 7, 8, 9, 10