mention what happens if OPENSSL_NO_RC2 is defined
[openssl.git] / doc / man3 / EVP_KEYMGMT.pod
1 =pod
2
3 =head1 NAME
4
5 EVP_KEYMGMT,
6 EVP_KEYMGMT_fetch,
7 EVP_KEYMGMT_up_ref,
8 EVP_KEYMGMT_free,
9 EVP_KEYMGMT_provider
10 - EVP key management routines
11
12 =head1 SYNOPSIS
13
14  #include <openssl/evp.h>
15
16  typedef struct evp_keymgmt_st EVP_KEYMGMT;
17
18  EVP_KEYMGMT *EVP_KEYMGMT_fetch(OPENSSL_CTX *ctx, const char *algorithm,
19                                 const char *properties);
20  int EVP_KEYMGMT_up_ref(EVP_KEYMGMT *keymgmt);
21  void EVP_KEYMGMT_free(EVP_KEYMGMT *keymgmt);
22  const OSSL_PROVIDER *EVP_KEYMGMT_provider(const EVP_KEYMGMT *keymgmt);
23
24 =head1 DESCRIPTION
25
26 B<EVP_KEYMGMT> is a method object that represents key management
27 implementations for different cryptographic algorithms.
28 This method object provides functionality to have providers import key
29 material from the outside, as well as export key material to the
30 outside.
31 Most of the functionality can only be used internally and has no
32 public interface, this object is simply passed into other functions
33 when needed.
34
35 EVP_KEYMGMT_fetch() looks for an algorithm within the provider that
36 has been loaded into the B<OPENSSL_CTX> given by I<ctx>, having the
37 name given by I<algorithm> and the properties given by I<properties>.
38
39 EVP_KEYMGMT_up_ref() increments the reference count for the given
40 B<EVP_KEYMGMT> I<keymgmt>.
41
42 EVP_KEYMGMT_free() decrements the reference count for the given
43 B<EVP_KEYMGMT> I<keymgmt>, and when the count reaches zero, frees it.
44
45 EVP_KEYMGMT_provider() returns the provider that has this particular
46 implementation.
47
48 =head1 NOTES
49
50 EVP_KEYMGMT_fetch() may be called implicitly by other fetching
51 functions, using the same library context and properties.
52 Any other API that uses keys will typically do this.
53
54 =head1 RETURN VALUES
55
56 EVP_KEYMGMT_fetch() returns a pointer to the key management
57 implementation represented by an EVP_KEYMGMT object, or NULL on
58 error.
59
60 EVP_KEYMGMT_up_ref() returns 1 on success, or 0 on error.
61
62 EVP_KEYMGMT_free() doesn't return any value.
63
64 EVP_KEYMGMT_provider() returns a pointer to a provider object, or NULL
65 on error.
66
67 =head1 SEE ALSO
68
69 L<EVP_MD_fetch(3)>, L<OPENSSL_CTX(3)>
70
71 =head1 HISTORY
72
73 The functions described here were added in OpenSSL 3.0.
74
75 =head1 COPYRIGHT
76
77 Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
78
79 Licensed under the Apache License 2.0 (the "License").  You may not use
80 this file except in compliance with the License.  You can obtain a copy
81 in the file LICENSE in the source distribution or at
82 L<https://www.openssl.org/source/license.html>.
83
84 =cut