]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/internal/man3/evp_keymgmt_util_export_to_provider.pod
Update copyright year
[thirdparty/openssl.git] / doc / internal / man3 / evp_keymgmt_util_export_to_provider.pod
CommitLineData
b305452f
RL
1=pod
2
3=head1 NAME
4
655f73ce 5evp_keymgmt_util_export,
b305452f 6evp_keymgmt_util_export_to_provider,
64954e2f 7evp_keymgmt_util_find_operation_cache,
e32c608e
RL
8evp_keymgmt_util_clear_operation_cache,
9evp_keymgmt_util_cache_keydata,
10evp_keymgmt_util_cache_keyinfo,
64954e2f
P
11evp_keymgmt_util_fromdata,
12OP_CACHE_ELEM
b305452f
RL
13- internal KEYMGMT utility functions
14
15=head1 SYNOPSIS
16
17 #include "crypto/evp.h"
18
64954e2f
P
19 typedef struct OP_CACHE_ELEM;
20
655f73ce
RL
21 int evp_keymgmt_util_export(const EVP_PKEY *pk, int selection,
22 OSSL_CALLBACK *export_cb, void *export_cbarg);
b305452f 23 void *evp_keymgmt_util_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt);
64954e2f
P
24 OP_CACHE_ELEM *evp_keymgmt_util_find_operation_cache(EVP_PKEY *pk,
25 EVP_KEYMGMT *keymgmt);
0b07db6f 26 int evp_keymgmt_util_clear_operation_cache(EVP_PKEY *pk, int locking);
64954e2f 27 int evp_keymgmt_util_cache_keydata(EVP_PKEY *pk,
0b07db6f 28 EVP_KEYMGMT *keymgmt, void *keydata);
e32c608e 29 void evp_keymgmt_util_cache_keyinfo(EVP_PKEY *pk);
b305452f
RL
30 void *evp_keymgmt_util_fromdata(EVP_PKEY *target, EVP_KEYMGMT *keymgmt,
31 int selection, const OSSL_PARAM params[]);
32
33=head1 DESCRIPTION
34
655f73ce
RL
35evp_keymgmt_util_export() calls L<evp_keymgmt_export(3)> with the
36I<keymgmt> and I<keydata> from I<pk>. This is a convenience function.
37
3f7ce7f1
RL
38evp_keymgmt_util_export_to_provider() exports cached key material
39(provider side key material) from the given key I<pk> to a provider
40via a B<EVP_KEYMGMT> interface, if this hasn't already been done.
b305452f 41It maintains a cache of provider key references in I<pk> to keep track
3f7ce7f1 42of all provider side keys.
b305452f 43
e32c608e
RL
44To export a legacy key, use L<evp_pkey_export_to_provider(3)> instead,
45as this function ignores any legacy key data.
b305452f 46
64954e2f
P
47evp_keymgmt_util_find_operation_cache() finds
48I<keymgmt> in I<pk>'s cache of provided keys for operations.
49It should only be called while holding I<pk>'s lock (read or write).
b305452f 50
e32c608e 51evp_keymgmt_util_clear_operation_cache() can be used to explicitly
0b07db6f
MC
52clear the cache of operation key references. If I<locking> is set to 1 then
53then I<pk>'s lock will be obtained while doing the clear. Otherwise it will be
54assumed that the lock has already been obtained or is not required.
e32c608e 55
64954e2f
P
56evp_keymgmt_util_cache_keydata() can be used to add a provider key
57object to a B<PKEY>.
e32c608e
RL
58
59evp_keymgmt_util_cache_keyinfo() can be used to get all kinds of
60information from the provvider "origin" and save it in I<pk>'s
61information cache.
b305452f
RL
62
63evp_keymgmt_util_fromdata() can be used to add key object data to a
64given key I<target> via a B<EVP_KEYMGMT> interface. This is used as a
65helper for L<EVP_PKEY_fromdata(3)>.
66
67=head1 RETURN VALUES
68
69evp_keymgmt_export_to_provider() and evp_keymgmt_util_fromdata()
70return a pointer to the appropriate provider side key (created or
71found again), or NULL on error.
72
64954e2f 73evp_keymgmt_util_find_operation_cache() returns a pointer to the
e32c608e 74operation cache slot. If I<keymgmt> is NULL, or if there is no slot
64954e2f 75with a match for I<keymgmt>, NULL is returned.
e32c608e 76
0b07db6f
MC
77evp_keymgmt_util_cache_keydata() and evp_keymgmt_util_clear_operation_cache()
78return 1 on success or 0 otherwise.
79
b305452f
RL
80=head1 NOTES
81
82"Legacy key" is the term used for any key that has been assigned to an
83B<EVP_PKEY> with EVP_PKEY_assign_RSA() and similar functions.
84
85=head1 SEE ALSO
86
87L<EVP_PKEY_ASN1_METHOD(3)>, L<EVP_PKEY_assign_RSA(3)>
88
89=head1 COPYRIGHT
90
a28d06f3 91Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
b305452f
RL
92
93Licensed under the Apache License 2.0 (the "License"). You may not use
94this file except in compliance with the License. You can obtain a copy
95in the file LICENSE in the source distribution or at
96L<https://www.openssl.org/source/license.html>.
97
98=cut