Edit

Share via


RSAOpenSsl.VerifyHash Method

Definition

Verifies that a digital signature is valid by determining the hash value in the signature using the specified hash algorithm and padding, and comparing it to the provided hash value.

public:
 override bool VerifyHash(cli::array <System::Byte> ^ hash, cli::array <System::Byte> ^ signature, System::Security::Cryptography::HashAlgorithmName hashAlgorithm, System::Security::Cryptography::RSASignaturePadding ^ padding);
public override bool VerifyHash (byte[] hash, byte[] signature, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.RSASignaturePadding padding);
override this.VerifyHash : byte[] * byte[] * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.RSASignaturePadding -> bool
Public Overrides Function VerifyHash (hash As Byte(), signature As Byte(), hashAlgorithm As HashAlgorithmName, padding As RSASignaturePadding) As Boolean

Parameters

hash
Byte[]

The hash value of the signed data.

signature
Byte[]

The signature data to be verified.

hashAlgorithm
HashAlgorithmName

The hash algorithm used to create the hash value.

padding
RSASignaturePadding

The padding mode.

Returns

true if the signature is valid; otherwise, false.

Exceptions

hash or padding is null.

hashAlgorithm.Name is null or Empty.

padding is unknown, or not supported by this implementation.

Applies to