1EVP_KEYMGMT(3ossl)                  OpenSSL                 EVP_KEYMGMT(3ossl)
2
3
4

NAME

6       EVP_KEYMGMT, EVP_KEYMGMT_fetch, EVP_KEYMGMT_up_ref, EVP_KEYMGMT_free,
7       EVP_KEYMGMT_get0_provider, EVP_KEYMGMT_is_a,
8       EVP_KEYMGMT_get0_description, EVP_KEYMGMT_get0_name,
9       EVP_KEYMGMT_do_all_provided, EVP_KEYMGMT_names_do_all,
10       EVP_KEYMGMT_gettable_params, EVP_KEYMGMT_settable_params,
11       EVP_KEYMGMT_gen_settable_params - EVP key management routines
12

SYNOPSIS

14        #include <openssl/evp.h>
15
16        typedef struct evp_keymgmt_st EVP_KEYMGMT;
17
18        EVP_KEYMGMT *EVP_KEYMGMT_fetch(OSSL_LIB_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_get0_provider(const EVP_KEYMGMT *keymgmt);
23        int EVP_KEYMGMT_is_a(const EVP_KEYMGMT *keymgmt, const char *name);
24        const char *EVP_KEYMGMT_get0_name(const EVP_KEYMGMT *keymgmt);
25        const char *EVP_KEYMGMT_get0_description(const EVP_KEYMGMT *keymgmt);
26
27        void EVP_KEYMGMT_do_all_provided(OSSL_LIB_CTX *libctx,
28                                         void (*fn)(EVP_KEYMGMT *keymgmt, void *arg),
29                                         void *arg);
30        int EVP_KEYMGMT_names_do_all(const EVP_KEYMGMT *keymgmt,
31                                     void (*fn)(const char *name, void *data),
32                                     void *data);
33        const OSSL_PARAM *EVP_KEYMGMT_gettable_params(const EVP_KEYMGMT *keymgmt);
34        const OSSL_PARAM *EVP_KEYMGMT_settable_params(const EVP_KEYMGMT *keymgmt);
35        const OSSL_PARAM *EVP_KEYMGMT_gen_settable_params(const EVP_KEYMGMT *keymgmt);
36

DESCRIPTION

38       EVP_KEYMGMT is a method object that represents key management
39       implementations for different cryptographic algorithms.  This method
40       object provides functionality to have providers import key material
41       from the outside, as well as export key material to the outside.  Most
42       of the functionality can only be used internally and has no public
43       interface, this object is simply passed into other functions when
44       needed.
45
46       EVP_KEYMGMT_fetch() looks for an algorithm within the provider that has
47       been loaded into the OSSL_LIB_CTX given by ctx, having the name given
48       by algorithm and the properties given by properties.
49
50       EVP_KEYMGMT_up_ref() increments the reference count for the given
51       EVP_KEYMGMT keymgmt.
52
53       EVP_KEYMGMT_free() decrements the reference count for the given
54       EVP_KEYMGMT keymgmt, and when the count reaches zero, frees it.
55
56       EVP_KEYMGMT_get0_provider() returns the provider that has this
57       particular implementation.
58
59       EVP_KEYMGMT_is_a() checks if keymgmt is an implementation of an
60       algorithm that's identifiable with name.
61
62       EVP_KEYMGMT_get0_name() returns the algorithm name from the provided
63       implementation for the given keymgmt. Note that the keymgmt may have
64       multiple synonyms associated with it. In this case the first name from
65       the algorithm definition is returned. Ownership of the returned string
66       is retained by the keymgmt object and should not be freed by the
67       caller.
68
69       EVP_KEYMGMT_names_do_all() traverses all names for the keymgmt, and
70       calls fn with each name and data.
71
72       EVP_KEYMGMT_get0_description() returns a description of the keymgmt,
73       meant for display and human consumption.  The description is at the
74       discretion of the keymgmt implementation.
75
76       EVP_KEYMGMT_do_all_provided() traverses all key keymgmt implementations
77       by all activated providers in the library context libctx, and for each
78       of the implementations, calls fn with the implementation method and
79       data as arguments.
80
81       EVP_KEYMGMT_gettable_params() and EVP_KEYMGMT_settable_params() return
82       a constant OSSL_PARAM(3) array that describes the names and types of
83       key parameters that can be retrieved or set.
84       EVP_KEYMGMT_gettable_params() is used by EVP_PKEY_gettable_params(3).
85
86       EVP_KEYMGMT_gen_settable_params() returns a constant OSSL_PARAM(3)
87       array that describes the names and types of key generation parameters
88       that can be set via EVP_PKEY_CTX_set_params(3).
89

NOTES

91       EVP_KEYMGMT_fetch() may be called implicitly by other fetching
92       functions, using the same library context and properties.  Any other
93       API that uses keys will typically do this.
94

RETURN VALUES

96       EVP_KEYMGMT_fetch() returns a pointer to the key management
97       implementation represented by an EVP_KEYMGMT object, or NULL on error.
98
99       EVP_KEYMGMT_up_ref() returns 1 on success, or 0 on error.
100
101       EVP_KEYMGMT_names_do_all() returns 1 if the callback was called for all
102       names. A return value of 0 means that the callback was not called for
103       any names.
104
105       EVP_KEYMGMT_free() doesn't return any value.
106
107       EVP_KEYMGMT_get0_provider() returns a pointer to a provider object, or
108       NULL on error.
109
110       EVP_KEYMGMT_is_a() returns 1 of keymgmt was identifiable, otherwise 0.
111
112       EVP_KEYMGMT_get0_name() returns the algorithm name, or NULL on error.
113
114       EVP_KEYMGMT_get0_description() returns a pointer to a description, or
115       NULL if there isn't one.
116
117       EVP_KEYMGMT_gettable_params(), EVP_KEYMGMT_settable_params() and
118       EVP_KEYMGMT_gen_settable_params() return a constant OSSL_PARAM(3) array
119       or NULL on error.
120

SEE ALSO

122       EVP_MD_fetch(3), OSSL_LIB_CTX(3)
123

HISTORY

125       The functions described here were added in OpenSSL 3.0.
126
128       Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
129
130       Licensed under the Apache License 2.0 (the "License").  You may not use
131       this file except in compliance with the License.  You can obtain a copy
132       in the file LICENSE in the source distribution or at
133       <https://www.openssl.org/source/license.html>.
134
135
136
1373.1.1                             2023-08-31                EVP_KEYMGMT(3ossl)
Impressum