RT4593: Add space after comma (doc nits)
[openssl.git] / doc / crypto / EVP_VerifyInit.pod
1 =pod
2
3 =head1 NAME
4
5 EVP_VerifyInit_ex,
6 EVP_VerifyInit, EVP_VerifyUpdate, EVP_VerifyFinal
7 - EVP signature verification functions
8
9 =head1 SYNOPSIS
10
11  #include <openssl/evp.h>
12
13  int EVP_VerifyInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl);
14  int EVP_VerifyUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt);
15  int EVP_VerifyFinal(EVP_MD_CTX *ctx, unsigned char *sigbuf, unsigned int siglen, EVP_PKEY *pkey);
16
17  int EVP_VerifyInit(EVP_MD_CTX *ctx, const EVP_MD *type);
18
19 =head1 DESCRIPTION
20
21 The EVP signature verification routines are a high level interface to digital
22 signatures.
23
24 EVP_VerifyInit_ex() sets up verification context B<ctx> to use digest
25 B<type> from ENGINE B<impl>. B<ctx> must be created by calling
26 EVP_MD_CTX_new() before calling this function.
27
28 EVP_VerifyUpdate() hashes B<cnt> bytes of data at B<d> into the
29 verification context B<ctx>. This function can be called several times on the
30 same B<ctx> to include additional data.
31
32 EVP_VerifyFinal() verifies the data in B<ctx> using the public key B<pkey>
33 and against the B<siglen> bytes at B<sigbuf>.
34
35 EVP_VerifyInit() initializes verification context B<ctx> to use the default
36 implementation of digest B<type>.
37
38 =head1 RETURN VALUES
39
40 EVP_VerifyInit_ex() and EVP_VerifyUpdate() return 1 for success and 0 for
41 failure.
42
43 EVP_VerifyFinal() returns 1 for a correct signature, 0 for failure and -1 if some
44 other error occurred.
45
46 The error codes can be obtained by L<ERR_get_error(3)>.
47
48 =head1 NOTES
49
50 The B<EVP> interface to digital signatures should almost always be used in
51 preference to the low level interfaces. This is because the code then becomes
52 transparent to the algorithm used and much more flexible.
53
54 Due to the link between message digests and public key algorithms the correct
55 digest algorithm must be used with the correct public key type. A list of
56 algorithms and associated public key algorithms appears in
57 L<EVP_DigestInit(3)>.
58
59 The call to EVP_VerifyFinal() internally finalizes a copy of the digest context.
60 This means that calls to EVP_VerifyUpdate() and EVP_VerifyFinal() can be called
61 later to digest and verify additional data.
62
63 Since only a copy of the digest context is ever finalized the context must
64 be cleaned up after use by calling EVP_MD_CTX_cleanup() or a memory leak
65 will occur.
66
67 =head1 BUGS
68
69 Older versions of this documentation wrongly stated that calls to
70 EVP_VerifyUpdate() could not be made after calling EVP_VerifyFinal().
71
72 Since the public key is passed in the call to EVP_SignFinal() any error
73 relating to the private key (for example an unsuitable key and digest
74 combination) will not be indicated until after potentially large amounts of
75 data have been passed through EVP_SignUpdate().
76
77 It is not possible to change the signing parameters using these function.
78
79 The previous two bugs are fixed in the newer EVP_VerifyDigest*() function.
80
81 =head1 SEE ALSO
82
83 L<evp(3)>,
84 L<EVP_SignInit(3)>,
85 L<EVP_DigestInit(3)>, L<err(3)>,
86 L<evp(3)>, L<hmac(3)>, L<md2(3)>,
87 L<md5(3)>, L<mdc2(3)>, L<ripemd(3)>,
88 L<sha(3)>, L<dgst(1)>
89
90 =head1 COPYRIGHT
91
92 Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
93
94 Licensed under the OpenSSL license (the "License").  You may not use
95 this file except in compliance with the License.  You can obtain a copy
96 in the file LICENSE in the source distribution or at
97 L<https://www.openssl.org/source/license.html>.
98
99 =cut