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 array that describes the names and types of key
83       parameters that can be retrieved or set.  EVP_KEYMGMT_gettable_params()
84       is used by EVP_PKEY_gettable_params(3).  See OSSL_PARAM(3) for the use
85       of OSSL_PARAM as a parameter descriptor.
86
87       EVP_KEYMGMT_gen_settable_params() returns a constant OSSL_PARAM array
88       that describes the names and types of key generation parameters that
89       can be set via EVP_PKEY_CTX_set_params(3).
90

NOTES

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

RETURN VALUES

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

SEE ALSO

123       EVP_MD_fetch(3), OSSL_LIB_CTX(3)
124

HISTORY

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