]>
Commit | Line | Data |
---|---|---|
12df11bd MC |
1 | =pod |
2 | ||
3 | =head1 NAME | |
4 | ||
251e610c | 5 | EVP_KEYEXCH_fetch, EVP_KEYEXCH_free, EVP_KEYEXCH_up_ref, EVP_KEYEXCH_provider, |
506cb0f6 | 6 | EVP_KEYEXCH_is_a, EVP_KEYEXCH_do_all_provided, |
e3efe7a5 SL |
7 | EVP_KEYEXCH_number, EVP_KEYEXCH_names_do_all, |
8 | EVP_KEYEXCH_gettable_ctx_params, EVP_KEYEXCH_settable_ctx_params | |
12df11bd MC |
9 | - Functions to manage EVP_KEYEXCH algorithm objects |
10 | ||
11 | =head1 SYNOPSIS | |
12 | ||
13 | #include <openssl/evp.h> | |
14 | ||
b4250010 | 15 | EVP_KEYEXCH *EVP_KEYEXCH_fetch(OSSL_LIB_CTX *ctx, const char *algorithm, |
2cafb1df | 16 | const char *properties); |
12df11bd MC |
17 | void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange); |
18 | int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange); | |
8b84b075 | 19 | OSSL_PROVIDER *EVP_KEYEXCH_provider(const EVP_KEYEXCH *exchange); |
251e610c | 20 | int EVP_KEYEXCH_is_a(const EVP_KEYEXCH *exchange, const char *name); |
506cb0f6 | 21 | int EVP_KEYEXCH_number(const EVP_KEYEXCH *exchange); |
b4250010 | 22 | void EVP_KEYEXCH_do_all_provided(OSSL_LIB_CTX *libctx, |
251e610c RL |
23 | void (*fn)(EVP_KEYEXCH *exchange, void *arg), |
24 | void *arg); | |
d84f5515 MC |
25 | int EVP_KEYEXCH_names_do_all(const EVP_KEYEXCH *exchange, |
26 | void (*fn)(const char *name, void *data), | |
27 | void *data); | |
e3efe7a5 SL |
28 | const OSSL_PARAM *EVP_KEYEXCH_gettable_ctx_params(const EVP_KEYEXCH *keyexch); |
29 | const OSSL_PARAM *EVP_KEYEXCH_settable_ctx_params(const EVP_KEYEXCH *keyexch); | |
12df11bd MC |
30 | |
31 | =head1 DESCRIPTION | |
32 | ||
2cafb1df | 33 | EVP_KEYEXCH_fetch() fetches the key exchange implementation for the given |
ee2161e8 RL |
34 | I<algorithm> from any provider offering it, within the criteria given |
35 | by the I<properties>. | |
2cafb1df RL |
36 | See L<provider(7)/Fetching algorithms> for further information. |
37 | ||
38 | The returned value must eventually be freed with EVP_KEYEXCH_free(). | |
39 | ||
12df11bd MC |
40 | EVP_KEYEXCH_free() decrements the reference count for the B<EVP_KEYEXCH> |
41 | structure. Typically this structure will have been obtained from an earlier call | |
2cafb1df | 42 | to EVP_KEYEXCH_fetch(). If the reference count drops to 0 then the |
12df11bd MC |
43 | structure is freed. |
44 | ||
45 | EVP_KEYEXCH_up_ref() increments the reference count for an B<EVP_KEYEXCH> | |
46 | structure. | |
47 | ||
8b84b075 RL |
48 | EVP_KEYEXCH_provider() returns the provider that I<exchange> was fetched from. |
49 | ||
251e610c RL |
50 | EVP_KEYEXCH_is_a() checks if I<exchange> is an implementation of an |
51 | algorithm that's identifiable with I<name>. | |
52 | ||
506cb0f6 RL |
53 | EVP_KEYEXCH_number() returns the internal dynamic number assigned to |
54 | the I<exchange>. | |
55 | ||
f651c727 RL |
56 | EVP_KEYEXCH_names_do_all() traverses all names for the I<exchange>, and |
57 | calls I<fn> with each name and I<data>. | |
58 | ||
251e610c RL |
59 | EVP_KEYEXCH_do_all_provided() traverses all key exchange implementations by |
60 | all activated providers in the library context I<libctx>, and for each | |
61 | of the implementations, calls I<fn> with the implementation method and | |
62 | I<data> as arguments. | |
63 | ||
e3efe7a5 SL |
64 | EVP_KEYEXCH_gettable_ctx_params() and EVP_KEYEXCH_settable_ctx_params() return |
65 | a constant B<OSSL_PARAM> array that describes the names and types of key | |
66 | parameters that can be retrieved or set by a key exchange algorithm using | |
67 | L<EVP_PKEY_CTX_get_params(3)> and L<EVP_PKEY_CTX_set_params(3)>. | |
68 | ||
12df11bd MC |
69 | =head1 RETURN VALUES |
70 | ||
2cafb1df | 71 | EVP_KEYEXCH_fetch() returns a pointer to a B<EVP_KEYEXCH> for success |
ee2161e8 | 72 | or NULL for failure. |
2cafb1df | 73 | |
12df11bd MC |
74 | EVP_KEYEXCH_up_ref() returns 1 for success or 0 otherwise. |
75 | ||
d84f5515 MC |
76 | EVP_KEYEXCH_names_do_all() returns 1 if the callback was called for all |
77 | names. A return value of 0 means that the callback was not called for any names. | |
78 | ||
251e610c RL |
79 | EVP_KEYEXCH_is_a() returns 1 of I<exchange> was identifiable, |
80 | otherwise 0. | |
81 | ||
506cb0f6 RL |
82 | EVP_KEYEXCH_number() returns an integer. |
83 | ||
e3efe7a5 SL |
84 | EVP_KEYEXCH_gettable_ctx_params() and EVP_KEYEXCH_settable_ctx_params() return |
85 | a constant B<OSSL_PARAM> array or NULL on error. | |
86 | ||
12df11bd MC |
87 | =head1 SEE ALSO |
88 | ||
8b84b075 | 89 | L<provider(7)/Fetching algorithms>, L<OSSL_PROVIDER(3)> |
12df11bd MC |
90 | |
91 | =head1 HISTORY | |
92 | ||
93 | The functions described here were added in OpenSSL 3.0. | |
94 | ||
95 | =head1 COPYRIGHT | |
96 | ||
8020d79b | 97 | Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved. |
12df11bd MC |
98 | |
99 | Licensed under the Apache License 2.0 (the "License"). You may not use | |
100 | this file except in compliance with the License. You can obtain a copy | |
101 | in the file LICENSE in the source distribution or at | |
102 | L<https://www.openssl.org/source/license.html>. | |
103 | ||
104 | =cut |