EVP: add name traversal functions to all fetchable types
[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, EVP_KEYEXCH_names_do_all
7 - Functions to manage EVP_KEYEXCH algorithm objects
8
9 =head1 SYNOPSIS
10
11  #include <openssl/evp.h>
12
13  EVP_KEYEXCH *EVP_KEYEXCH_fetch(OPENSSL_CTX *ctx, const char *algorithm,
14                                 const char *properties);
15  void EVP_KEYEXCH_free(EVP_KEYEXCH *exchange);
16  int EVP_KEYEXCH_up_ref(EVP_KEYEXCH *exchange);
17  OSSL_PROVIDER *EVP_KEYEXCH_provider(const EVP_KEYEXCH *exchange);
18  int EVP_KEYEXCH_is_a(const EVP_KEYEXCH *exchange, const char *name);
19  void EVP_KEYEXCH_do_all_provided(OPENSSL_CTX *libctx,
20                                   void (*fn)(EVP_KEYEXCH *exchange, void *arg),
21                                   void *arg);
22  void EVP_KEYEXCH_names_do_all(const EVP_KEYEXCH *exchange,
23                                void (*fn)(const char *name, void *data),
24                                void *data);
25
26 =head1 DESCRIPTION
27
28 EVP_KEYEXCH_fetch() fetches the key exchange implementation for the given
29 I<algorithm> from any provider offering it, within the criteria given
30 by the I<properties>.
31 See L<provider(7)/Fetching algorithms> for further information.
32
33 The returned value must eventually be freed with EVP_KEYEXCH_free().
34
35 EVP_KEYEXCH_free() decrements the reference count for the B<EVP_KEYEXCH>
36 structure. Typically this structure will have been obtained from an earlier call
37 to EVP_KEYEXCH_fetch(). If the reference count drops to 0 then the
38 structure is freed.
39
40 EVP_KEYEXCH_up_ref() increments the reference count for an B<EVP_KEYEXCH>
41 structure.
42
43 EVP_KEYEXCH_provider() returns the provider that I<exchange> was fetched from.
44
45 EVP_KEYEXCH_is_a() checks if I<exchange> is an implementation of an
46 algorithm that's identifiable with I<name>.
47
48 EVP_KEYEXCH_names_do_all() traverses all names for the I<exchange>, and
49 calls I<fn> with each name and I<data>.
50
51 EVP_KEYEXCH_do_all_provided() traverses all key exchange implementations by
52 all activated providers in the library context I<libctx>, and for each
53 of the implementations, calls I<fn> with the implementation method and
54 I<data> as arguments.
55
56 =head1 RETURN VALUES
57
58 EVP_KEYEXCH_fetch() returns a pointer to a B<EVP_KEYEXCH> for success
59 or NULL for failure.
60
61 EVP_KEYEXCH_up_ref() returns 1 for success or 0 otherwise.
62
63 EVP_KEYEXCH_is_a() returns 1 of I<exchange> was identifiable,
64 otherwise 0.
65
66 =head1 SEE ALSO
67
68 L<provider(7)/Fetching algorithms>, L<OSSL_PROVIDER(3)>
69
70 =head1 HISTORY
71
72 The functions described here were added in OpenSSL 3.0.
73
74 =head1 COPYRIGHT
75
76 Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
77
78 Licensed under the Apache License 2.0 (the "License").  You may not use
79 this file except in compliance with the License.  You can obtain a copy
80 in the file LICENSE in the source distribution or at
81 L<https://www.openssl.org/source/license.html>.
82
83 =cut