RSACryptoServiceProvider.VerifyData Method
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Verifies that a digital signature is valid by determining the hash value in the signature using the provided public key and comparing it to the hash value of the provided data.
Namespace: System.Security.Cryptography
Assembly: mscorlib.Extensions (in mscorlib.Extensions.dll)
Syntax
'Declaration
<SecuritySafeCriticalAttribute> _
Public Function VerifyData ( _
buffer As Byte(), _
halg As Object, _
signature As Byte() _
) As Boolean
[SecuritySafeCriticalAttribute]
public bool VerifyData(
byte[] buffer,
Object halg,
byte[] signature
)
Parameters
- buffer
Type: array<System.Byte[]
The data that was signed.
- halg
Type: System.Object
The name of the hash algorithm used to create the hash value of the data.
- signature
Type: array<System.Byte[]
The signature data to be verified.
Return Value
Type: System.Boolean
true if the signature is valid; otherwise, false.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The halg parameter is nulla null reference (Nothing in Visual Basic). |
ArgumentException | The halg parameter is not a valid type. |
Remarks
This method verifies the RSA digital signature produced by the SignData method. The signature is verified by obtaining the hash value from the signature using the public key it was signed with, and comparing that value to the hash value of the provided data.
The halg parameter can accept a String, a HashAlgorithm, or a Type.
Version Information
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
See Also