ECDsa.VerifyHash Method

Definition

Overloads

VerifyHash(Byte[], Byte[], DSASignatureFormat)

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

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

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

VerifyHash(Byte[], Byte[])

Verifies that a digital signature is appropriate for the current key and provided data hash.

VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

Verifies that a digital signature is appropriate for the current key and provided data hash.

VerifyHash(Byte[], Byte[], DSASignatureFormat)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

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

public bool VerifyHash (byte[] hash, byte[] signature, System.Security.Cryptography.DSASignatureFormat signatureFormat);

Parameters

hash
Byte[]

The signed hash.

signature
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

hash or signature is null.

signatureFormat is not a known format.

An error occurred in the verification operation.

Applies to

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

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

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

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

public bool VerifyHash (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 9 and other versions
Product Versions
.NET 5, 6, 7, 8, 9

VerifyHash(Byte[], Byte[])

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

Verifies that a digital signature is appropriate for the current key and provided data hash.

public abstract bool VerifyHash (byte[] hash, byte[] signature);

Parameters

hash
Byte[]

The hash value of the data to be verified.

signature
Byte[]

The digital signature of the data to be verified against the hash value.

Returns

true if the signature is valid; otherwise, false.

Exceptions

hash or signature is null.

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 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 1.4, 1.6, 2.0, 2.1

VerifyHash(ReadOnlySpan<Byte>, ReadOnlySpan<Byte>)

Source:
ECDsa.cs
Source:
ECDsa.cs
Source:
ECDsa.cs

Verifies that a digital signature is appropriate for the current key and provided data hash.

public virtual bool VerifyHash (ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature);

Parameters

hash
ReadOnlySpan<Byte>

The hash value of the data to be verified.

signature
ReadOnlySpan<Byte>

The digital signature of the data to be verified against the hash value.

Returns

true if the signature is valid; otherwise, false.

Applies to

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