Add EVP_PKEY_CTX_new_provided()
[openssl.git] / doc / man3 / EVP_PKEY_CTX_new.pod
1 =pod
2
3 =head1 NAME
4
5 EVP_PKEY_CTX_new, EVP_PKEY_CTX_new_id, EVP_PKEY_CTX_new_provided,
6 EVP_PKEY_CTX_dup, EVP_PKEY_CTX_free
7 - public key algorithm context functions
8
9 =head1 SYNOPSIS
10
11  #include <openssl/evp.h>
12
13  EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e);
14  EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e);
15  EVP_PKEY_CTX *EVP_PKEY_CTX_new_provided(const char *name,
16                                          const char *propquery);
17  EVP_PKEY_CTX *EVP_PKEY_CTX_dup(const EVP_PKEY_CTX *ctx);
18  void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx);
19
20 =head1 DESCRIPTION
21
22 The EVP_PKEY_CTX_new() function allocates public key algorithm context using
23 the algorithm specified in B<pkey> and ENGINE B<e>.
24
25 The EVP_PKEY_CTX_new_id() function allocates public key algorithm context
26 using the algorithm specified by B<id> and ENGINE B<e>.
27
28 The EVP_PKEY_CTX_new_provided() function allocates a public key
29 algorithm context using the algorithm specified by I<name> and the
30 property query I<propquery>.  The strings aren't duplicated, so they
31 must remain unchanged for the lifetime of the returned B<EVP_PKEY_CTX>
32 or of any of its duplicates.
33
34 EVP_PKEY_CTX_new_id() and EVP_PKEY_CTX_new_provided() are normally
35 used when no B<EVP_PKEY> structure is associated with the operations,
36 for example during parameter generation or key generation for some
37 algorithms.
38
39 EVP_PKEY_CTX_dup() duplicates the context B<ctx>.
40
41 EVP_PKEY_CTX_free() frees up the context B<ctx>.
42 If B<ctx> is NULL, nothing is done.
43
44 =head1 NOTES
45
46 The B<EVP_PKEY_CTX> structure is an opaque public key algorithm context used
47 by the OpenSSL high level public key API. Contexts B<MUST NOT> be shared between
48 threads: that is it is not permissible to use the same context simultaneously
49 in two threads.
50
51 =head1 RETURN VALUES
52
53 EVP_PKEY_CTX_new(), EVP_PKEY_CTX_new_id(), EVP_PKEY_CTX_dup() returns either
54 the newly allocated B<EVP_PKEY_CTX> structure of B<NULL> if an error occurred.
55
56 EVP_PKEY_CTX_free() does not return a value.
57
58 =head1 SEE ALSO
59
60 L<EVP_PKEY_new(3)>
61
62 =head1 HISTORY
63
64 These functions were added in OpenSSL 1.0.0.
65
66 =head1 COPYRIGHT
67
68 Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
69
70 Licensed under the Apache License 2.0 (the "License").  You may not use
71 this file except in compliance with the License.  You can obtain a copy
72 in the file LICENSE in the source distribution or at
73 L<https://www.openssl.org/source/license.html>.
74
75 =cut