DSA.VerifySignature Method

Definition

Overloads

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[])

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

public:
 abstract bool VerifySignature(cli::array <System::Byte> ^ rgbHash, cli::array <System::Byte> ^ rgbSignature);
public abstract bool VerifySignature (byte[] rgbHash, byte[] rgbSignature);
abstract member VerifySignature : byte[] * byte[] -> bool
Public MustOverride Function VerifySignature (rgbHash As Byte(), rgbSignature As Byte()) As Boolean

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

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

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

public:
 virtual bool VerifySignature(ReadOnlySpan<System::Byte> hash, ReadOnlySpan<System::Byte> signature);
public virtual bool VerifySignature (ReadOnlySpan<byte> hash, ReadOnlySpan<byte> signature);
abstract member VerifySignature : ReadOnlySpan<byte> * ReadOnlySpan<byte> -> bool
override this.VerifySignature : ReadOnlySpan<byte> * ReadOnlySpan<byte> -> bool
Public Overridable Function VerifySignature (hash As ReadOnlySpan(Of Byte), signature As ReadOnlySpan(Of Byte)) As Boolean

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