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