Add EVP functionality to create domain params and keys by user data
[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 domain 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 domain 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 domain 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>.
31
32 EVP_PKEY_param_fromdata_settable() and EVP_PKEY_key_fromdata_settable()
33 get a constant B<OSSL_PARAM> array that describes the settable parameters
34 that can be used with EVP_PKEY_fromdata().
35 See L<OSSL_PARAM(3)> for the use of B<OSSL_PARAM> as parameter descriptor.
36
37 =head1 NOTES
38
39 These functions only work with key management methods coming from a
40 provider.
41
42 =for comment We may choose to make this available for legacy methods too... 
43
44 =head1 RETURN VALUES
45
46 EVP_PKEY_key_fromdata_init(), EVP_PKEY_param_fromdata_init() and
47 EVP_PKEY_fromdata() return 1 for success and 0 or a negative value for
48 failure.  In particular a return value of -2 indicates the operation is
49 not supported by the public key algorithm.
50
51 =head1 SEE ALSO
52
53 L<EVP_PKEY_CTX_new(3)>, L<provider(7)>
54
55 =head1 HISTORY
56
57 These functions were added in OpenSSL 3.0.
58
59 =head1 COPYRIGHT
60
61 Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
62
63 Licensed under the Apache License 2.0 (the "License").  You may not use
64 this file except in compliance with the License.  You can obtain a copy
65 in the file LICENSE in the source distribution or at
66 L<https://www.openssl.org/source/license.html>.
67
68 =cut
69