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

 

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

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

public:
bool VerifyData(
	Stream^ data,
	array<unsigned char>^ signature,
	HashAlgorithmName hashAlgorithm,
	RSASignaturePadding^ padding
)

Parameters

data
Type: System.IO::Stream^

The signed data.

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.

.NET Framework
Available since 4.6
Return to top
Show: