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