]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/internal/man3/evp_keymgmt_util_export_to_provider.pod
Refactor evp_pkey_make_provided() to do legacy to provider export
[thirdparty/openssl.git] / doc / internal / man3 / evp_keymgmt_util_export_to_provider.pod
CommitLineData
b305452f
RL
1=pod
2
3=head1 NAME
4
5evp_keymgmt_util_export_to_provider,
6evp_keymgmt_util_clear_pkey_cache,
7evp_keymgmt_util_cache_pkey,
8evp_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
24evp_keymgmt_util_export_to_provider() exports cached key material
25(provider side key material) from the given key I<pk> to a provider
26via a B<EVP_KEYMGMT> interface, if this hasn't already been done.
b305452f 27It maintains a cache of provider key references in I<pk> to keep track
3f7ce7f1 28of all provider side keys.
b305452f 29
3f7ce7f1
RL
30To export a legacy key, use L<evp_pkey_make_provided(3)> instead, as
31this function deals purely with provider side keys and will not care
32to look at any legacy key.
b305452f
RL
33
34evp_keymgmt_util_clear_pkey_cache() can be used to explicitly clear
35the cache of provider key references.
36
37evp_keymgmt_util_cache_pkey() can be used to assign a provider key
38object to a specific cache slot in the given I<target>.
39I<Use with extreme care>.
40
41evp_keymgmt_util_fromdata() can be used to add key object data to a
42given key I<target> via a B<EVP_KEYMGMT> interface. This is used as a
43helper for L<EVP_PKEY_fromdata(3)>.
44
45=head1 RETURN VALUES
46
47evp_keymgmt_export_to_provider() and evp_keymgmt_util_fromdata()
48return a pointer to the appropriate provider side key (created or
49found 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
54B<EVP_PKEY> with EVP_PKEY_assign_RSA() and similar functions.
55
56=head1 SEE ALSO
57
58L<EVP_PKEY_ASN1_METHOD(3)>, L<EVP_PKEY_assign_RSA(3)>
59
60=head1 COPYRIGHT
61
62Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
63
64Licensed under the Apache License 2.0 (the "License"). You may not use
65this file except in compliance with the License. You can obtain a copy
66in the file LICENSE in the source distribution or at
67L<https://www.openssl.org/source/license.html>.
68
69=cut