EVPKey::Sign (open)

Sign data

Syntax

LOADLIB "wh::crypto.whlib";

STRING FUNCTION Sign(STRING data, STRING alg)

Parameters

STRING data

The data to sign

STRING alg

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

Return value

STRING

The raw signature value

Description

This function creates a signature for the given data, using the private key and the given hashing algorithm. For EC keys, the return value is a BER-encoded ASN.1 sequence containing the r and s signature values. You can use DecodeECSignature to get a record with the separate r and s values. Note: This function cannot be used on public-only keys!