man: fix typo in OPENSSL_fork_prepare.pod
[openssl.git] / doc / man3 / EVP_PKEY_cmp.pod
1 =pod
2
3 =head1 NAME
4
5 EVP_PKEY_copy_parameters, EVP_PKEY_missing_parameters, EVP_PKEY_cmp_parameters,
6 EVP_PKEY_cmp - public key parameter and comparison functions
7
8 =head1 SYNOPSIS
9
10  #include <openssl/evp.h>
11
12  int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey);
13  int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from);
14
15  int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b);
16  int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b);
17
18 =head1 DESCRIPTION
19
20 The function EVP_PKEY_missing_parameters() returns 1 if the public key
21 parameters of B<pkey> are missing and 0 if they are present or the algorithm
22 doesn't use parameters.
23
24 The function EVP_PKEY_copy_parameters() copies the parameters from key
25 B<from> to key B<to>. An error is returned if the parameters are missing in
26 B<from> or present in both B<from> and B<to> and mismatch. If the parameters
27 in B<from> and B<to> are both present and match this function has no effect.
28
29 The function EVP_PKEY_cmp_parameters() compares the parameters of keys
30 B<a> and B<b>.
31
32 The function EVP_PKEY_cmp() compares the public key components and parameters
33 (if present) of keys B<a> and B<b>.
34
35 =head1 NOTES
36
37 The main purpose of the functions EVP_PKEY_missing_parameters() and
38 EVP_PKEY_copy_parameters() is to handle public keys in certificates where the
39 parameters are sometimes omitted from a public key if they are inherited from
40 the CA that signed it.
41
42 Since OpenSSL private keys contain public key components too the function
43 EVP_PKEY_cmp() can also be used to determine if a private key matches
44 a public key.
45
46 =head1 RETURN VALUES
47
48 The function EVP_PKEY_missing_parameters() returns 1 if the public key
49 parameters of B<pkey> are missing and 0 if they are present or the algorithm
50 doesn't use parameters.
51
52 These functions EVP_PKEY_copy_parameters() returns 1 for success and 0 for
53 failure.
54
55 The function EVP_PKEY_cmp_parameters() and EVP_PKEY_cmp() return 1 if the
56 keys match, 0 if they don't match, -1 if the key types are different and
57 -2 if the operation is not supported.
58
59 =head1 SEE ALSO
60
61 L<EVP_PKEY_CTX_new(3)>,
62 L<EVP_PKEY_keygen(3)>
63
64 =head1 COPYRIGHT
65
66 Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
67
68 Licensed under the Apache License 2.0 (the "License").  You may not use
69 this file except in compliance with the License.  You can obtain a copy
70 in the file LICENSE in the source distribution or at
71 L<https://www.openssl.org/source/license.html>.
72
73 =cut