Manual Pages for UNIX Darwin command on man EVP_SignInit
MyWebUniversity

Manual Pages for UNIX Darwin command on man EVP_SignInit

EVPSignInit(3) OpenSSL EVPSignInit(3)

NAME

EVPSignInit, EVPSignUpdate, EVPSignFinal - EVP signing functions

SYNOPSIS

#include

int EVPSignInitex(EVPMDCTX *ctx, const EVPMD *type, ENGINE *impl); int EVPSignUpdate(EVPMDCTX *ctx, const void *d, unsigned int cnt); int EVPSignFinal(EVPMDCTX *ctx,unsigned char *sig,unsigned int *s, EVPPKEY *pkey); void EVPSignInit(EVPMDCTX *ctx, const EVPMD *type); int EVPPKEYsize(EVPPKEY *pkey);

DESCRIPTION

The EVP signature routines are a high level interface to digital signatures. EVPSignInitex() sets up signing context ccttxx to use digest ttyyppee from ENGINE iimmppll. ccttxx must be initialized with EVPMDCTXinit() before calling this function. EVPSignUpdate() hashes ccnntt bytes of data at dd into the signature context ccttxx. This function can be called several times on the same ccttxx to include additional data. EVPSignFinal() signs the data in ccttxx using the private key ppkkeeyy and places the signature in ssiigg. The number of bytes of data written (i.e. the length of the signature) will be written to the integer at ss, at most EVPPKEYsize(pkey) bytes will be written. EVPSignInit() initializes a signing context ccttxx to use the default implementation of digest ttyyppee. EVPPKEYsize() returns the maximum size of a signature in bytes. The actual signature returned by EVPSignFinal() may be smaller.

RETURN VALUES

EVPSignInitex(), EVPSignUpdate() and EVPSignFinal() return 1 for success and 0 for failure. EVPPKEYsize() returns the maximum size of a signature in bytes. The error codes can be obtained by ERRgeterror(3). NNOOTTEESS The EEVVPP 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 EVPDigestInit(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 EVPSignFinal() internally finalizes a copy of the digest context. This means that calls to EVPSignUpdate() and EVPSignFinal() can be called later to digest and sign additional data. Since only a copy of the digest context is ever finalized the context must be cleaned up after use by calling EVPMDCTXcleanup() or a memory leak will occur.

BUGS

Older versions of this documentation wrongly stated that calls to EVPSignUpdate() could not be made after calling EVPSignFinal().

SEE ALSO

EVPVerifyInit(3), EVPDigestInit(3), err(3), evp(3), hmac(3), md2(3), md5(3), mdc2(3), ripemd(3), sha(3), dgst(1) HISTORY EVPSignInit(), EVPSignUpdate() and EVPSignFinal() are available in all versions of SSLeay and OpenSSL. EVPSignInitex() was added in OpenSSL 0.9.7.

0.9.7l 2005-03-22 EVPSignInit(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™