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