Add support for passing the libctx to the config loader
[openssl.git] / doc / man3 / EVP_PKEY_fromdata.pod
1 =pod
2
3 =head1 NAME
4
5 EVP_PKEY_param_fromdata_init, EVP_PKEY_key_fromdata_init, EVP_PKEY_fromdata,
6 EVP_PKEY_param_fromdata_settable, EVP_PKEY_key_fromdata_settable
7 - functions to create key parameters and keys from user data
8
9 =head1 SYNOPSIS
10
11  #include <openssl/evp.h>
12
13  int EVP_PKEY_param_fromdata_init(EVP_PKEY_CTX *ctx);
14  int EVP_PKEY_key_fromdata_init(EVP_PKEY_CTX *ctx);
15  int EVP_PKEY_fromdata(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey, OSSL_PARAM params[]);
16  const OSSL_PARAM *EVP_PKEY_param_fromdata_settable(EVP_PKEY_CTX *ctx);
17  const OSSL_PARAM *EVP_PKEY_key_fromdata_settable(EVP_PKEY_CTX *ctx);
18
19 =head1 DESCRIPTION
20
21 EVP_PKEY_param_fromdata_init() initializes a public key algorithm context
22 for creating key parameters from user data.
23
24 EVP_PKEY_key_fromdata_init() initializes a public key algorithm context for
25 creating a key from user data.
26
27 EVP_PKEY_fromdata() creates key parameters or a key, given data from
28 I<params> and a context that's been initialized with
29 EVP_PKEY_param_fromdata_init() or EVP_PKEY_key_fromdata_init().  The result is
30 written to I<*ppkey>. The parameters that can be used for various types of key
31 are as described in the "Built-in RSA Import/Export Types" section on the
32 L<provider-keymgmt(7)> page.
33
34 EVP_PKEY_param_fromdata_settable() and EVP_PKEY_key_fromdata_settable()
35 get a constant B<OSSL_PARAM> array that describes the settable parameters
36 that can be used with EVP_PKEY_fromdata().
37 See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor.
38
39 =head1 NOTES
40
41 These functions only work with key management methods coming from a
42 provider.
43
44 =for comment We may choose to make this available for legacy methods too... 
45
46 =head1 RETURN VALUES
47
48 EVP_PKEY_key_fromdata_init(), EVP_PKEY_param_fromdata_init() and
49 EVP_PKEY_fromdata() return 1 for success and 0 or a negative value for
50 failure.  In particular a return value of -2 indicates the operation is
51 not supported by the public key algorithm.
52
53 =head1 SEE ALSO
54
55 L<EVP_PKEY_CTX_new(3)>, L<provider(7)>
56
57 =head1 HISTORY
58
59 These functions were added in OpenSSL 3.0.
60
61 =head1 COPYRIGHT
62
63 Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
64
65 Licensed under the Apache License 2.0 (the "License").  You may not use
66 this file except in compliance with the License.  You can obtain a copy
67 in the file LICENSE in the source distribution or at
68 L<https://www.openssl.org/source/license.html>.
69
70 =cut
71