EVPKey::Verify (open)

Verify a signature

Syntax

LOADLIB "wh::crypto.whlib";

BOOLEAN FUNCTION Verify(STRING data, STRING signature, STRING alg)

Parameters

STRING data

The data to verify the signature for

STRING signature

The signature to verify

STRING alg

The hashing algorithm to use ("MD5", "SHA-1", "SHA-256", "SHA-384", "SHA-512")

Return value

BOOLEAN

If the signature is valid for the given data

Description

This function verifies a signature for the given data, using the public key and the given hashing algorithm. For EC keys, this function expects the signature to be a BER-encoded ASN.1 sequence containing the r and s signature values. You can use EncodeECSignature to create a verifiable signature.