Add evp_keymgmt_export_to_provider(), for key transfer between providers
[openssl.git] / doc / internal / man3 / evp_keymgmt_export_to_provider.pod
1 =pod
2
3 =head1 NAME
4
5 evp_keymgmt_export_to_provider - key material exporter to providers for EVP
6
7 =head1 SYNOPSIS
8
9  #include "internal/evp_int.h"
10
11  void *evp_keymgmt_export_to_provider(EVP_PKEY *pk, EVP_KEYMGMT *keymgmt);
12
13 =head1 DESCRIPTION
14
15 evp_keymgmt_export_to_provider() exports the key material from the
16 given key I<pk> to a provider via a B<EVP_KEYMGMT> interface, if this
17 hasn't already been done.
18 It maintains a cache of provider key references in I<pk> to keep track
19 of all such exports.
20
21 If I<pk> has an assigned legacy key, a check is done to see if any of
22 its key material has changed since last export, i.e. the legacy key's
23 is_dirty() method returns 1.
24 If it has, the cache of already exported keys is cleared, and a new
25 export is made with the new key material.
26
27 =head1 RETURN VALUES
28
29 evp_keymgmt_export_to_provider() returns a pointer to the newly
30 created provider side key, or NULL on error.
31
32 =head1 NOTES
33
34 "Legacy key" is the term used for any key that has been assigned to an
35 B<EVP_PKEY> with EVP_PKEY_assign_RSA() and similar functions.
36
37 =head1 SEE ALSO
38
39 L<EVP_PKEY_ASN1_METHOD(3)>, L<EVP_PKEY_assign_RSA(3)>
40
41 =head1 COPYRIGHT
42
43 Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
44
45 Licensed under the Apache License 2.0 (the "License").  You may not use
46 this file except in compliance with the License.  You can obtain a copy
47 in the file LICENSE in the source distribution or at
48 L<https://www.openssl.org/source/license.html>.
49
50 =cut