Edit

Share via


DSACryptoServiceProvider.VerifyHash(Byte[], String, Byte[]) Method

Definition

Verifies the specified signature data by comparing it to the signature computed for the specified hash value.

public:
 bool VerifyHash(cli::array <System::Byte> ^ rgbHash, System::String ^ str, cli::array <System::Byte> ^ rgbSignature);
public bool VerifyHash (byte[] rgbHash, string? str, byte[] rgbSignature);
public bool VerifyHash (byte[] rgbHash, string str, byte[] rgbSignature);
member this.VerifyHash : byte[] * string * byte[] -> bool
Public Function VerifyHash (rgbHash As Byte(), str As String, rgbSignature As Byte()) As Boolean

Parameters

rgbHash
Byte[]

The hash value of the data to be signed.

str
String

The name of the hash algorithm used to create the hash value of the data.

rgbSignature
Byte[]

The signature data to be verified.

Returns

true if the signature verifies as valid; otherwise, false.

Exceptions

The rgbHash parameter is null.

-or-

The rgbSignature parameter is null.

The cryptographic service provider (CSP) cannot be acquired.

-or-

The signature cannot be verified.

Remarks

This method verifies the DSA digital signature produced by SignHash.

If the str parameter is null, the default hash algorithm (SHA1) is used. The valid hash algorithms is SHA1.

Due to collision problems with SHA1, Microsoft recommends a security model based on SHA256 or better.

Applies to

See also