1EVP_VERIFYINIT(3) OpenSSL EVP_VERIFYINIT(3)
2
3
4
6 EVP_VerifyInit_ex, EVP_VerifyInit, EVP_VerifyUpdate, EVP_VerifyFinal -
7 EVP signature verification functions
8
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,
15 EVP_PKEY *pkey);
16
17 int EVP_VerifyInit(EVP_MD_CTX *ctx, const EVP_MD *type);
18
20 The EVP signature verification routines are a high-level interface to
21 digital signatures.
22
23 EVP_VerifyInit_ex() sets up verification context ctx to use digest type
24 from ENGINE impl. ctx must be created by calling EVP_MD_CTX_new()
25 before calling this function.
26
27 EVP_VerifyUpdate() hashes cnt bytes of data at d into the verification
28 context ctx. This function can be called several times on the same ctx
29 to include additional data.
30
31 EVP_VerifyFinal() verifies the data in ctx using the public key pkey
32 and against the siglen bytes at sigbuf.
33
34 EVP_VerifyInit() initializes verification context ctx to use the
35 default implementation of digest type.
36
38 EVP_VerifyInit_ex() and EVP_VerifyUpdate() return 1 for success and 0
39 for failure.
40
41 EVP_VerifyFinal() returns 1 for a correct signature, 0 for failure and
42 -1 if some other error occurred.
43
44 The error codes can be obtained by ERR_get_error(3).
45
47 The EVP interface to digital signatures should almost always be used in
48 preference to the low-level interfaces. This is because the code then
49 becomes transparent to the algorithm used and much more flexible.
50
51 The call to EVP_VerifyFinal() internally finalizes a copy of the digest
52 context. This means that calls to EVP_VerifyUpdate() and
53 EVP_VerifyFinal() can be called later to digest and verify additional
54 data.
55
56 Since only a copy of the digest context is ever finalized the context
57 must be cleaned up after use by calling EVP_MD_CTX_free() or a memory
58 leak will occur.
59
61 Older versions of this documentation wrongly stated that calls to
62 EVP_VerifyUpdate() could not be made after calling EVP_VerifyFinal().
63
64 Since the public key is passed in the call to EVP_SignFinal() any error
65 relating to the private key (for example an unsuitable key and digest
66 combination) will not be indicated until after potentially large
67 amounts of data have been passed through EVP_SignUpdate().
68
69 It is not possible to change the signing parameters using these
70 function.
71
72 The previous two bugs are fixed in the newer EVP_DigestVerify*()
73 function.
74
76 evp(7), EVP_SignInit(3), EVP_DigestInit(3), evp(7), HMAC(3), MD2(3),
77 MD5(3), MDC2(3), RIPEMD160(3), SHA1(3), dgst(1)
78
80 Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
81
82 Licensed under the OpenSSL license (the "License"). You may not use
83 this file except in compliance with the License. You can obtain a copy
84 in the file LICENSE in the source distribution or at
85 <https://www.openssl.org/source/license.html>.
86
87
88
891.1.1k 2021-03-26 EVP_VERIFYINIT(3)