1EVP_VerifyInit(3)                   OpenSSL                  EVP_VerifyInit(3)
2
3
4

NAME

6       EVP_VerifyInit, EVP_VerifyUpdate, EVP_VerifyFinal - EVP signature
7       verification functions
8

SYNOPSIS

10        #include <openssl/evp.h>
11
12        int EVP_VerifyInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl);
13        int EVP_VerifyUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt);
14        int EVP_VerifyFinal(EVP_MD_CTX *ctx,unsigned char *sigbuf, unsigned int siglen,EVP_PKEY *pkey);
15
16        int EVP_VerifyInit(EVP_MD_CTX *ctx, const EVP_MD *type);
17

DESCRIPTION

19       The EVP signature verification routines are a high level interface to
20       digital signatures.
21
22       EVP_VerifyInit_ex() sets up verification context ctx to use digest type
23       from ENGINE impl. ctx must be initialized by calling EVP_MD_CTX_init()
24       before calling this function.
25
26       EVP_VerifyUpdate() hashes cnt bytes of data at d into the verification
27       context ctx. This function can be called several times on the same ctx
28       to include additional data.
29
30       EVP_VerifyFinal() verifies the data in ctx using the public key pkey
31       and against the siglen bytes at sigbuf.
32
33       EVP_VerifyInit() initializes verification context ctx to use the
34       default implementation of digest type.
35

RETURN VALUES

37       EVP_VerifyInit_ex() and EVP_VerifyUpdate() return 1 for success and 0
38       for failure.
39
40       EVP_VerifyFinal() returns 1 for a correct signature, 0 for failure and
41       -1 if some other error occurred.
42
43       The error codes can be obtained by ERR_get_error(3).
44

NOTES

46       The EVP interface to digital signatures should almost always be used in
47       preference to the low level interfaces. This is because the code then
48       becomes transparent to the algorithm used and much more flexible.
49
50       Due to the link between message digests and public key algorithms the
51       correct digest algorithm must be used with the correct public key type.
52       A list of algorithms and associated public key algorithms appears in
53       EVP_DigestInit(3).
54
55       The call to EVP_VerifyFinal() internally finalizes a copy of the digest
56       context.  This means that calls to EVP_VerifyUpdate() and
57       EVP_VerifyFinal() can be called later to digest and verify additional
58       data.
59
60       Since only a copy of the digest context is ever finalized the context
61       must be cleaned up after use by calling EVP_MD_CTX_cleanup() or a
62       memory leak will occur.
63

BUGS

65       Older versions of this documentation wrongly stated that calls to
66       EVP_VerifyUpdate() could not be made after calling EVP_VerifyFinal().
67
68       Since the public key is passed in the call to EVP_SignFinal() any error
69       relating to the private key (for example an unsuitable key and digest
70       combination) will not be indicated until after potentially large
71       amounts of data have been passed through EVP_SignUpdate().
72
73       It is not possible to change the signing parameters using these
74       function.
75
76       The previous two bugs are fixed in the newer EVP_VerifyDigest*()
77       function.
78

SEE ALSO

80       evp(3), EVP_SignInit(3), EVP_DigestInit(3), err(3), evp(3), hmac(3),
81       md2(3), md5(3), mdc2(3), ripemd(3), sha(3), dgst(1)
82

HISTORY

84       EVP_VerifyInit(), EVP_VerifyUpdate() and EVP_VerifyFinal() are
85       available in all versions of SSLeay and OpenSSL.
86
87       EVP_VerifyInit_ex() was added in OpenSSL 0.9.7
88
89
90
911.0.1e                            2013-02-11                 EVP_VerifyInit(3)
Impressum