RSA::VerifyData Method (array<Byte>^, Int32, Int32, array<Byte>^, HashAlgorithmName, RSASignaturePadding^)

 

Verifies that a digital signature is valid by calculating the hash value of the data in a portion of a byte array using the specified hash algorithm and padding, and comparing it to the provided signature.

Namespace:   System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

public:
virtual bool VerifyData(
	array<unsigned char>^ data,
	int offset,
	int count,
	array<unsigned char>^ signature,
	HashAlgorithmName hashAlgorithm,
	RSASignaturePadding^ padding
)

Parameters

data
Type: array<System::Byte>^

The signed data.

offset
Type: System::Int32

The starting index at which to compute the hash.

count
Type: System::Int32

The number of bytes to hash.

signature
Type: array<System::Byte>^

The signature data to be verified.

hashAlgorithm
Type: System.Security.Cryptography::HashAlgorithmName

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

padding
Type: System.Security.Cryptography::RSASignaturePadding^

The padding mode.

Return Value

Type: System::Boolean

true if the signature is valid; otherwise, false.

Exception Condition
ArgumentNullException

data is null.

-or-

signature is null.

-or-

padding is null.

ArgumentException

hashAlgorithm.Name is null or String::Empty.

ArgumentOutOfRangeException

offset is less than zero.

-or-

count is less than zero.

-or-

offset + count – 1 results in an index that is beyond the upper bound of data.

.NET Framework
Available since 4.6
Return to top
Show: