5 EVP_PKEY_todata, EVP_PKEY_export
6 - functions to return keys as an array of key parameters
10 #include <openssl/evp.h>
12 int EVP_PKEY_todata(const EVP_PKEY *pkey, int selection, OSSL_PARAM **params);
13 int EVP_PKEY_export(const EVP_PKEY *pkey, int selection,
14 OSSL_CALLBACK *export_cb, void *export_cbarg);
18 The functions described here are used to extract B<EVP_PKEY> key values as an
19 array of B<OSSL_PARAM>.
21 EVP_PKEY_todata() extracts values from a key I<pkey> using the I<selection>.
22 I<selection> is described in L<EVP_PKEY_fromdata(3)/Selections>.
23 L<OSSL_PARAM_free(3)> should be used to free the returned parameters in
26 EVP_PKEY_export() is similiar to EVP_PKEY_todata() but uses a callback
27 I<export_cb> that gets passed the value of I<export_cbarg>.
28 See L<openssl-core.h(7)> for more information about the callback. Note that the
29 B<OSSL_PARAM> array that is passed to the callback is not persistent after the
30 callback returns. The user must preserve the items of interest, or use
31 EVP_PKEY_todata() if persistence is required.
35 These functions only work with key management methods coming from a provider.
36 This is the mirror function to L<EVP_PKEY_fromdata(3)>.
40 EVP_PKEY_todata() and EVP_PKEY_export() return 1 for success and 0 for failure.
44 L<OSSL_PARAM(3)>, L<openssl-core.h(7)>,
45 L<EVP_PKEY_fromdata(3)>,
46 L<EVP_PKEY-RSA(7)>, L<EVP_PKEY-DSA(7)>, L<EVP_PKEY-DH(7)>, L<EVP_PKEY-EC(7)>,
47 L<EVP_PKEY-ED448(7)>, L<EVP_PKEY-X25519(7)>, L<EVP_PKEY-X448(7)>,
48 L<EVP_PKEY-ED25519(7)>
52 These functions were added in OpenSSL 3.0.
56 Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
58 Licensed under the Apache License 2.0 (the "License"). You may not use
59 this file except in compliance with the License. You can obtain a copy
60 in the file LICENSE in the source distribution or at
61 L<https://www.openssl.org/source/license.html>.