![]() | ![]() | |||||||||||||||||||
| ||||||||||||||||||||
| EVP_SignInit(3)
NAMEEVP_SignInit, EVP_SignUpdate, EVP_SignFinal - EVP signing functions
SYNOPSIS#include <openssl/evp.h> int EVP_SignInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); int EVP_SignUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt); int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *sig,unsigned int *s, EVP_PKEY *pkey); void EVP_SignInit(EVP_MD_CTX *ctx, const EVP_MD *type); int EVP_PKEY_size(EVP_PKEY *pkey);
DESCRIPTIONThe EVP signature routines are a high level interface to digital signatures.
RETURN VALUES
The error codes can be obtained by ERR_get_error(3).
NOTESThe EVP interface to digital signatures should almost always be used in preference to the low level interfaces. This is because the code then becomes transparent to the algorithm used and much more flexible. Due to the link between message digests and public key algorithms the correct digest algorithm must be used with the correct public key type. A list of algorithms and associated public key algorithms appears in EVP_DigestInit(3). When signing with DSA private keys the random number generator must be seeded or the operation will fail. The random number generator does not need to be seeded for RSA signatures.
The call to
Since only a copy of the digest context is ever finalized the context must
be cleaned up after use by calling
BUGS
Older versions of this documentation wrongly stated that calls to
Since the private key is passed in the call to It is not possible to change the signing parameters using these function. The previous two bugs are fixed in the newer EVP_SignDigest*() function.
SEE ALSOEVP_VerifyInit(3), EVP_DigestInit(3), err(3), evp(3), hmac(3), md2(3), md5(3), mdc2(3), ripemd(3), sha(3), dgst(1)
HISTORY
| |||||||||||||||||||