1EVP_PKEY_TODATA(3ossl) OpenSSL EVP_PKEY_TODATA(3ossl)
2
3
4
6 EVP_PKEY_todata, EVP_PKEY_export - functions to return keys as an array
7 of key parameters
8
10 #include <openssl/evp.h>
11
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);
15
17 The functions described here are used to extract EVP_PKEY key values as
18 an array of OSSL_PARAM.
19
20 EVP_PKEY_todata() extracts values from a key pkey using the selection.
21 selection is described in "Selections" in EVP_PKEY_fromdata(3).
22 OSSL_PARAM_free(3) should be used to free the returned parameters in
23 *params.
24
25 EVP_PKEY_export() is similiar to EVP_PKEY_todata() but uses a callback
26 export_cb that gets passed the value of export_cbarg. See
27 openssl-core.h(7) for more information about the callback. Note that
28 the OSSL_PARAM array that is passed to the callback is not persistent
29 after the callback returns. The user must preserve the items of
30 interest, or use EVP_PKEY_todata() if persistence is required.
31
33 These functions only work with key management methods coming from a
34 provider. This is the mirror function to EVP_PKEY_fromdata(3).
35
37 EVP_PKEY_todata() and EVP_PKEY_export() return 1 for success and 0 for
38 failure.
39
41 OSSL_PARAM(3), openssl-core.h(7), EVP_PKEY_fromdata(3),
42 EVP_PKEY-RSA(7), EVP_PKEY-DSA(7), EVP_PKEY-DH(7), EVP_PKEY-EC(7),
43 EVP_PKEY-ED448(7), EVP_PKEY-X25519(7), EVP_PKEY-X448(7),
44 EVP_PKEY-ED25519(7)
45
47 These functions were added in OpenSSL 3.0.
48
50 Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.
51
52 Licensed under the Apache License 2.0 (the "License"). You may not use
53 this file except in compliance with the License. You can obtain a copy
54 in the file LICENSE in the source distribution or at
55 <https://www.openssl.org/source/license.html>.
56
57
58
593.0.5 2022-07-05 EVP_PKEY_TODATA(3ossl)