VerifyData Method
VerifyData(Byte[], Byte[], Boolean)
Verify the signature
using the dataToVerify
. This
method will digest the dataToVerify
using SHA-256 if the
public key is P-256 and SHA-384 if the public key is P-384, and then
verify the signature using the digest.
public bool VerifyData(byte[] dataToVerify, byte[] signature, bool isStandardSignature = true)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | dataToVerify | The data data to verify. To verify an ECDSA signature, this method will digest the data using SHA-256 or SHA-384, depending on the public key's curve. |
System.Byte[] | signature | The signature to verify. |
System.Boolean | isStandardSignature |
|
Returns
A boolean, true
if the signature verifies, false
if it
does not.
Remarks
If the signature is the standard BER encoding, then pass true
for isStandardSignature
. That argument defaults to true
so if the signature is formatted in the standard way, you can call
this method with that argument missing. If the signature is the
concatenation of r
and s
, pass false
for
isStandardSignature
.