Add type_name member to provided methods and use it
[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_name, 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  const char *EVP_KEYEXCH_name(const EVP_KEYEXCH *exchange);
24  void EVP_KEYEXCH_do_all_provided(OSSL_LIB_CTX *libctx,
25                                   void (*fn)(EVP_KEYEXCH *exchange, void *arg),
26                                   void *arg);
27  int EVP_KEYEXCH_names_do_all(const EVP_KEYEXCH *exchange,
28                               void (*fn)(const char *name, void *data),
29                               void *data);
30  const char *EVP_KEYEXCH_description(const EVP_KEYEXCH *keyexch);
31  const OSSL_PARAM *EVP_KEYEXCH_gettable_ctx_params(const EVP_KEYEXCH *keyexch);
32  const OSSL_PARAM *EVP_KEYEXCH_settable_ctx_params(const EVP_KEYEXCH *keyexch);
33
34 =head1 DESCRIPTION
35
36 EVP_KEYEXCH_fetch() fetches the key exchange implementation for the given
37 I<algorithm> from any provider offering it, within the criteria given
38 by the I<properties>.
39 See L<crypto(7)/ALGORITHM FETCHING> for further information.
40
41 The returned value must eventually be freed with EVP_KEYEXCH_free().
42
43 EVP_KEYEXCH_free() decrements the reference count for the B<EVP_KEYEXCH>
44 structure. Typically this structure will have been obtained from an earlier call
45 to EVP_KEYEXCH_fetch(). If the reference count drops to 0 then the
46 structure is freed.
47
48 EVP_KEYEXCH_up_ref() increments the reference count for an B<EVP_KEYEXCH>
49 structure.
50
51 EVP_KEYEXCH_provider() returns the provider that I<exchange> was fetched from.
52
53 EVP_KEYEXCH_is_a() checks if I<exchange> is an implementation of an
54 algorithm that's identifiable with I<name>.
55
56 EVP_KEYEXCH_number() returns the internal dynamic number assigned to
57 the I<exchange>.
58
59 EVP_KEYEXCH_name() returns the algorithm name from the provided
60 implementation for the given I<exchange>. Note that the I<exchange> may have
61 multiple synonyms associated with it. In this case the first name from the
62 algorithm definition is returned. Ownership of the returned string is retained
63 by the I<exchange> object and should not be freed by the caller.
64
65 EVP_KEYEXCH_names_do_all() traverses all names for the I<exchange>, and
66 calls I<fn> with each name and I<data>.
67
68 EVP_KEYEXCH_description() returns a description of the I<keyexch>, meant for
69 display and human consumption.  The description is at the discretion of the
70 I<keyexch> implementation.
71
72 EVP_KEYEXCH_do_all_provided() traverses all key exchange implementations by
73 all activated providers in the library context I<libctx>, and for each
74 of the implementations, calls I<fn> with the implementation method and
75 I<data> as arguments.
76
77 EVP_KEYEXCH_gettable_ctx_params() and EVP_KEYEXCH_settable_ctx_params() return
78 a constant B<OSSL_PARAM> array that describes the names and types of key
79 parameters that can be retrieved or set by a key exchange algorithm using
80 L<EVP_PKEY_CTX_get_params(3)> and L<EVP_PKEY_CTX_set_params(3)>.
81
82 =head1 RETURN VALUES
83
84 EVP_KEYEXCH_fetch() returns a pointer to a B<EVP_KEYEXCH> for success
85 or NULL for failure.
86
87 EVP_KEYEXCH_up_ref() returns 1 for success or 0 otherwise.
88
89 EVP_KEYEXCH_names_do_all() returns 1 if the callback was called for all
90 names. A return value of 0 means that the callback was not called for any names.
91
92 EVP_KEYEXCH_is_a() returns 1 of I<exchange> was identifiable,
93 otherwise 0.
94
95 EVP_KEYEXCH_number() returns an integer.
96
97 EVP_KEYEXCH_gettable_ctx_params() and EVP_KEYEXCH_settable_ctx_params() return
98 a constant B<OSSL_PARAM> array or NULL on error.
99
100 =head1 SEE ALSO
101
102 L<crypto(7)/ALGORITHM FETCHING>, L<OSSL_PROVIDER(3)>
103
104 =head1 HISTORY
105
106 The functions described here were added in OpenSSL 3.0.
107
108 =head1 COPYRIGHT
109
110 Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
111
112 Licensed under the Apache License 2.0 (the "License").  You may not use
113 this file except in compliance with the License.  You can obtain a copy
114 in the file LICENSE in the source distribution or at
115 L<https://www.openssl.org/source/license.html>.
116
117 =cut