Show / Hide Table of Contents

VerifyData Method

VerifyData(byte[], byte[], bool)

Verify the signature using the dataToVerify. This method will digest the dataToVerify using SHA-256, SHA-384 or SHA-512, depending on the public key's curve, and then verify the signature using the digest.

C#
public bool VerifyData(byte[] dataToVerify, byte[] signature, bool isStandardSignature = true)

Parameters

Type Name Description
byte[] dataToVerify

The data data to verify. To verify an ECDSA signature, this method will digest the data using SHA-256, SHA-384 or SHA-512, depending on the public key's curve.

byte[] signature

The signature to verify.

bool isStandardSignature

true if the signature is formatted as the BER encoding specified by most standards, or false if the signature is formatted as the concatenation of r and s.

Returns

bool

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.

In this article
Back to top Generated by DocFX