]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/EVP_PKEY_cmp.pod
Implement EVP_MAC_do_all_ex()
[thirdparty/openssl.git] / doc / man3 / EVP_PKEY_cmp.pod
CommitLineData
8211a33c
DSH
1=pod
2
3=head1 NAME
4
9d22666e
F
5EVP_PKEY_copy_parameters, EVP_PKEY_missing_parameters, EVP_PKEY_cmp_parameters,
6EVP_PKEY_cmp - public key parameter and comparison functions
8211a33c
DSH
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
f72f00d4
DSH
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.
8211a33c 28
478b50cf 29The function EVP_PKEY_cmp_parameters() compares the parameters of keys
8211a33c
DSH
30B<a> and B<b>.
31
1afd7fa9 32The function EVP_PKEY_cmp() compares the public key components and parameters
8211a33c
DSH
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
9b86974e 61L<EVP_PKEY_CTX_new(3)>,
1bc74519 62L<EVP_PKEY_keygen(3)>
8211a33c 63
e2f92610
RS
64=head1 COPYRIGHT
65
66Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
67
4746f25a 68Licensed under the Apache License 2.0 (the "License"). You may not use
e2f92610
RS
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