1=pod
2
3=head1 NAME
4
5EVP_PKEY_copy_parameters, EVP_PKEY_missing_parameters, EVP_PKEY_cmp_parameters,
6EVP_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
20The function EVP_PKEY_missing_parameters() returns 1 if the public key
21parameters of B<pkey> are missing and 0 if they are present or the algorithm
22doesn't use parameters.
23
24The function EVP_PKEY_copy_parameters() copies the parameters from key
25B<from> to key B<to>. An error is returned if the parameters are missing in
26B<from> or present in both B<from> and B<to> and mismatch. If the parameters
27in B<from> and B<to> are both present and match this function has no effect.
28
29The function EVP_PKEY_cmp_parameters() compares the parameters of keys
30B<a> and B<b>.
31
32The 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
37The main purpose of the functions EVP_PKEY_missing_parameters() and
38EVP_PKEY_copy_parameters() is to handle public keys in certificates where the
39parameters are sometimes omitted from a public key if they are inherited from
40the CA that signed it.
41
42Since OpenSSL private keys contain public key components too the function
43EVP_PKEY_cmp() can also be used to determine if a private key matches
44a public key.
45
46=head1 RETURN VALUES
47
48The function EVP_PKEY_missing_parameters() returns 1 if the public key
49parameters of B<pkey> are missing and 0 if they are present or the algorithm
50doesn't use parameters.
51
52These functions EVP_PKEY_copy_parameters() returns 1 for success and 0 for
53failure.
54
55The function EVP_PKEY_cmp_parameters() and EVP_PKEY_cmp() return 1 if the
56keys 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
61L<EVP_PKEY_CTX_new(3)>,
62L<EVP_PKEY_keygen(3)>
63
64=head1 COPYRIGHT
65
66Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
67
68Licensed under the OpenSSL license (the "License").  You may not use
69this file except in compliance with the License.  You can obtain a copy
70in the file LICENSE in the source distribution or at
71L<https://www.openssl.org/source/license.html>.
72
73=cut
74