5 provider - OpenSSL operation implementation providers
11 #include <openssl/provider.h>
17 This page contains information useful to provider authors.
19 A I<provider>, in OpenSSL terms, is a unit of code that provides one
20 or more implementations for various operations for diverse algorithms
21 that one might want to perform.
23 An I<operation> is something one wants to do, such as encryption and
24 decryption, key derivation, MAC calculation, signing and verification,
27 An I<algorithm> is a named method to perform an operation.
28 Very often, the algorithms revolve around cryptographic operations,
29 but may also revolve around other types of operation, such as managing
30 certain types of objects.
32 See L<crypto(7)> for further details.
36 A I<provider> offers an initialization function, as a set of base
37 functions in the form of an L<OSSL_DISPATCH(3)> array, and by extension,
38 a set of L<OSSL_ALGORITHM(3)>s (see L<openssl-core.h(7)>).
39 It may be a dynamically loadable module, or may be built-in, in
40 OpenSSL libraries or in the application.
41 If it's a dynamically loadable module, the initialization function
42 must be named C<OSSL_provider_init> and must be exported.
43 If it's built-in, the initialization function may have any name.
45 The initialization function must have the following signature:
47 int NAME(const OSSL_CORE_HANDLE *handle,
48 const OSSL_DISPATCH *in, const OSSL_DISPATCH **out,
51 I<handle> is the OpenSSL library object for the provider, and works
52 as a handle for everything the OpenSSL libraries need to know about
54 For the provider itself, it is passed to some of the functions given in the
57 I<in> is a dispatch array of base functions offered by the OpenSSL
58 libraries, and the available functions are further described in
61 I<*out> must be assigned a dispatch array of base functions that the
62 provider offers to the OpenSSL libraries.
63 The functions that may be offered are further described in
64 L<provider-base(7)>, and they are the central means of communication
65 between the OpenSSL libraries and the provider.
67 I<*provctx> should be assigned a provider specific context to allow
68 the provider multiple simultaneous uses.
69 This pointer will be passed to various operation functions offered by
72 Note that the provider will not be made available for applications to use until
73 the initialization function has completed and returned successfully.
75 One of the functions the provider offers to the OpenSSL libraries is
76 the central mechanism for the OpenSSL libraries to get access to
77 operation implementations for diverse algorithms.
78 Its referred to with the number B<OSSL_FUNC_PROVIDER_QUERY_OPERATION>
79 and has the following signature:
81 const OSSL_ALGORITHM *provider_query_operation(void *provctx,
85 I<provctx> is the provider specific context that was passed back by
86 the initialization function.
88 I<operation_id> is an operation identity (see L</Operations> below).
90 I<no_store> is a flag back to the OpenSSL libraries which, when
91 nonzero, signifies that the OpenSSL libraries will not store a
92 reference to the returned data in their internal store of
95 The returned L<OSSL_ALGORITHM(3)> is the foundation of any OpenSSL
96 library API that uses providers for their implementation, most
97 commonly in the I<fetching> type of functions
98 (see L<crypto(7)/ALGORITHM FETCHING>).
102 Operations are referred to with numbers, via macros with names
103 starting with C<OSSL_OP_>.
105 With each operation comes a set of defined function types that a
106 provider may or may not offer, depending on its needs.
108 Currently available operations are:
114 In the OpenSSL libraries, the corresponding method object is
116 The number for this operation is B<OSSL_OP_DIGEST>.
117 The functions the provider can offer are described in
118 L<provider-digest(7)>.
120 =item Symmetric ciphers
122 In the OpenSSL libraries, the corresponding method object is
124 The number for this operation is B<OSSL_OP_CIPHER>.
125 The functions the provider can offer are described in
126 L<provider-cipher(7)>.
128 =item Message Authentication Code (MAC)
130 In the OpenSSL libraries, the corresponding method object is
132 The number for this operation is B<OSSL_OP_MAC>.
133 The functions the provider can offer are described in
136 =item Key Derivation Function (KDF)
138 In the OpenSSL libraries, the corresponding method object is
140 The number for this operation is B<OSSL_OP_KDF>.
141 The functions the provider can offer are described in
146 In the OpenSSL libraries, the corresponding method object is
148 The number for this operation is B<OSSL_OP_KEYEXCH>.
149 The functions the provider can offer are described in
150 L<provider-keyexch(7)>.
152 =item Asymmetric Ciphers
154 In the OpenSSL libraries, the corresponding method object is
156 The number for this operation is B<OSSL_OP_ASYM_CIPHER>.
157 The functions the provider can offer are described in
158 L<provider-asym_cipher(7)>.
160 =item Asymmetric Key Encapsulation
162 In the OpenSSL libraries, the corresponding method object is B<EVP_KEM>.
163 The number for this operation is B<OSSL_OP_KEM>.
164 The functions the provider can offer are described in L<provider-kem(7)>.
168 In the OpenSSL libraries, the corresponding method object is
170 The number for this operation is B<OSSL_OP_ENCODER>.
171 The functions the provider can offer are described in
172 L<provider-encoder(7)>.
176 In the OpenSSL libraries, the corresponding method object is
178 The number for this operation is B<OSSL_OP_DECODER>.
179 The functions the provider can offer are described in
180 L<provider-decoder(7)>.
182 =item Random Number Generation
184 The number for this operation is B<OSSL_OP_RAND>.
185 The functions the provider can offer for random number generation are described
186 in L<provider-rand(7)>.
190 The number for this operation is B<OSSL_OP_KEYMGMT>.
191 The functions the provider can offer for key management are described in
192 L<provider-keymgmt(7)>.
194 =item Signing and Signature Verification
196 The number for this operation is B<OSSL_OP_SIGNATURE>.
197 The functions the provider can offer for digital signatures are described in
198 L<provider-signature(7)>.
200 =item Store Management
202 The number for this operation is B<OSSL_OP_STORE>.
203 The functions the provider can offer for store management are described in
204 L<provider-storemgmt(7)>.
208 =head3 Algorithm naming
210 Algorithm names are case insensitive. Any particular algorithm can have multiple
211 aliases associated with it. The canonical OpenSSL naming scheme follows this
214 ALGNAME[VERSION?][-SUBNAME[VERSION?]?][-SIZE?][-MODE?]
216 VERSION is only present if there are multiple versions of an algorithm (e.g.
217 MD2, MD4, MD5). It may be omitted if there is only one version.
219 SUBNAME may be present where multiple algorithms are combined together,
222 SIZE is only present if multiple versions of an algorithm exist with different
223 sizes (e.g. AES-128-CBC, AES-256-CBC)
225 MODE is only present where applicable.
227 Other aliases may exist for example where standards bodies or common practice
228 use alternative names or names that OpenSSL has used historically.
230 =head1 OPENSSL PROVIDERS
232 OpenSSL provides a number of its own providers. These are the default, base,
233 fips, legacy and null providers. See L<crypto(7)> for an overview of these
238 L<EVP_DigestInit_ex(3)>, L<EVP_EncryptInit_ex(3)>,
240 L<EVP_set_default_properties(3)>,
242 L<EVP_CIPHER_fetch(3)>,
243 L<EVP_KEYMGMT_fetch(3)>,
244 L<openssl-core.h(7)>,
246 L<provider-digest(7)>,
247 L<provider-cipher(7)>,
248 L<provider-keyexch(7)>
252 The concept of providers and everything surrounding them was
253 introduced in OpenSSL 3.0.
257 Copyright 2019-2022 The OpenSSL Project Authors. All Rights Reserved.
259 Licensed under the Apache License 2.0 (the "License"). You may not use
260 this file except in compliance with the License. You can obtain a copy
261 in the file LICENSE in the source distribution or at
262 L<https://www.openssl.org/source/license.html>.