]>
Commit | Line | Data |
---|---|---|
b305452f RL |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
5 | evp_keymgmt_util_export_to_provider, | |
6 | evp_keymgmt_util_clear_pkey_cache, | |
7 | evp_keymgmt_util_cache_pkey, | |
8 | evp_keymgmt_util_fromdata | |
9 | - internal KEYMGMT utility functions | |
10 | ||
11 | =head1 SYNOPSIS | |
12 | ||
13 | #include "crypto/evp.h" | |
14 | ||
15 | void *evp_keymgmt_util_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt); | |
16 | void evp_keymgmt_util_clear_pkey_cache(EVP_PKEY *pk); | |
17 | void evp_keymgmt_util_cache_pkey(EVP_PKEY *pk, size_t index, | |
18 | EVP_KEYMGMT *keymgmt, void *keydata); | |
19 | void *evp_keymgmt_util_fromdata(EVP_PKEY *target, EVP_KEYMGMT *keymgmt, | |
20 | int selection, const OSSL_PARAM params[]); | |
21 | ||
22 | =head1 DESCRIPTION | |
23 | ||
3f7ce7f1 RL |
24 | evp_keymgmt_util_export_to_provider() exports cached key material |
25 | (provider side key material) from the given key I<pk> to a provider | |
26 | via a B<EVP_KEYMGMT> interface, if this hasn't already been done. | |
b305452f | 27 | It maintains a cache of provider key references in I<pk> to keep track |
3f7ce7f1 | 28 | of all provider side keys. |
b305452f | 29 | |
3f7ce7f1 RL |
30 | To export a legacy key, use L<evp_pkey_make_provided(3)> instead, as |
31 | this function deals purely with provider side keys and will not care | |
32 | to look at any legacy key. | |
b305452f RL |
33 | |
34 | evp_keymgmt_util_clear_pkey_cache() can be used to explicitly clear | |
35 | the cache of provider key references. | |
36 | ||
37 | evp_keymgmt_util_cache_pkey() can be used to assign a provider key | |
38 | object to a specific cache slot in the given I<target>. | |
39 | I<Use with extreme care>. | |
40 | ||
41 | evp_keymgmt_util_fromdata() can be used to add key object data to a | |
42 | given key I<target> via a B<EVP_KEYMGMT> interface. This is used as a | |
43 | helper for L<EVP_PKEY_fromdata(3)>. | |
44 | ||
45 | =head1 RETURN VALUES | |
46 | ||
47 | evp_keymgmt_export_to_provider() and evp_keymgmt_util_fromdata() | |
48 | return a pointer to the appropriate provider side key (created or | |
49 | found again), or NULL on error. | |
50 | ||
51 | =head1 NOTES | |
52 | ||
53 | "Legacy key" is the term used for any key that has been assigned to an | |
54 | B<EVP_PKEY> with EVP_PKEY_assign_RSA() and similar functions. | |
55 | ||
56 | =head1 SEE ALSO | |
57 | ||
58 | L<EVP_PKEY_ASN1_METHOD(3)>, L<EVP_PKEY_assign_RSA(3)> | |
59 | ||
60 | =head1 COPYRIGHT | |
61 | ||
62 | Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. | |
63 | ||
64 | Licensed under the Apache License 2.0 (the "License"). You may not use | |
65 | this file except in compliance with the License. You can obtain a copy | |
66 | in the file LICENSE in the source distribution or at | |
67 | L<https://www.openssl.org/source/license.html>. | |
68 | ||
69 | =cut |