5 OSSL_PROVIDER_set_default_search_path,
6 OSSL_PROVIDER, OSSL_PROVIDER_load, OSSL_PROVIDER_unload,
7 OSSL_PROVIDER_available, OSSL_PROVIDER_do_all,
8 OSSL_PROVIDER_gettable_params, OSSL_PROVIDER_get_params,
9 OSSL_PROVIDER_query_operation, OSSL_PROVIDER_add_builtin,
10 OSSL_PROVIDER_name - provider routines
14 #include <openssl/provider.h>
16 typedef struct ossl_provider_st OSSL_PROVIDER;
18 void OSSL_PROVIDER_set_default_search_path(OPENSSL_CTX *libctx,
21 OSSL_PROVIDER *OSSL_PROVIDER_load(OPENSSL_CTX *libctx, const char *name);
22 int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov);
23 int OSSL_PROVIDER_available(OPENSSL_CTX *libctx, const char *name);
24 int OSSL_PROVIDER_do_all(OPENSSL_CTX *ctx,
25 int (*cb)(OSSL_PROVIDER *provider, void *cbdata),
28 const OSSL_PARAM *OSSL_PROVIDER_gettable_params(OSSL_PROVIDER *prov);
29 int OSSL_PROVIDER_get_params(OSSL_PROVIDER *prov, OSSL_PARAM params[]);
31 const OSSL_ALGORITHM *OSSL_PROVIDER_query_operation(const OSSL_PROVIDER *prov,
35 int OSSL_PROVIDER_add_builtin(OPENSSL_CTX *libctx, const char *name,
36 ossl_provider_init_fn *init_fn);
38 const char *OSSL_PROVIDER_name(const OSSL_PROVIDER *prov);
42 B<OSSL_PROVIDER> is a type that holds internal information about
43 implementation providers (see L<provider(7)> for information on what a
45 A provider can be built in to the application or the OpenSSL
46 libraries, or can be a loadable module.
47 The functions described here handle both forms.
49 Some of these functions operate within a library context, please see
50 L<OPENSSL_CTX(3)> for further details.
54 OSSL_PROVIDER_set_default_search_path() specifies the default search B<path>
55 that is to be used for looking for providers in the specified B<libctx>.
56 If left unspecified, an environment variable and a fall back default value will
59 OSSL_PROVIDER_add_builtin() is used to add a built in provider to
60 B<OSSL_PROVIDER> store in the given library context, by associating a
61 provider name with a provider initialization function.
62 This name can then be used with OSSL_PROVIDER_load().
64 OSSL_PROVIDER_load() loads and initializes a provider.
65 This may simply initialize a provider that was previously added with
66 OSSL_PROVIDER_add_builtin() and run its given initialization function,
67 or load a provider module with the given name and run its provider
68 entry point, C<OSSL_provider_init>.
70 OSSL_PROVIDER_unload() unloads the given provider.
71 For a provider added with OSSL_PROVIDER_add_builtin(), this simply
72 runs its teardown function.
74 OSSL_PROVIDER_available() checks if a named provider is available
77 OSSL_PROVIDER_do_all() iterates over all loaded providers, calling
78 I<cb> for each one, with the current provider in I<provider> and the
79 I<cbdata> that comes from the caller.
81 OSSL_PROVIDER_gettable_params() is used to get a provider parameter
82 descriptor set as a constant B<OSSL_PARAM> array.
83 See L<OSSL_PARAM(3)> for more information.
85 OSSL_PROVIDER_get_params() is used to get provider parameter values.
86 The caller must prepare the B<OSSL_PARAM> array before calling this
87 function, and the variables acting as buffers for this parameter array
88 should be filled with data when it returns successfully.
90 OSSL_PROVIDER_query_operation() calls the provider's I<query_operation>
91 function (see L<provider(7)>), if the provider has one. It should return an
92 array of I<OSSL_ALGORITHM> for the given I<operation_id> terminated by an all
93 NULL OSSL_ALGORITHM entry. This is considered a low-level function that most
94 applications should not need to call.
96 If it is permissible to cache references to this array then I<*no_store> is set
97 to 0 or 1 otherwise. If the array is not cacheable then it should be assumed to
98 have a short lifetime.
100 OSSL_PROVIDER_name() returns the name of the given provider.
104 OSSL_PROVIDER_add() returns 1 on success, or 0 on error.
106 OSSL_PROVIDER_load() returns a pointer to a provider object on
107 success, or B<NULL> on error.
109 OSSL_PROVIDER_unload() returns 1 on success, or 0 on error.
111 OSSL_PROVIDER_available() returns 1 if the named provider is available,
114 OSSL_PROVIDER_gettable_params() returns a pointer to an array
115 of constant B<OSSL_PARAM>, or NULL if none is provided.
117 OSSL_PROVIDER_get_params() returns 1 on success, or 0 on error.
119 OSSL_PROVIDER_query_operation() returns an array of OSSL_ALGORITHM or NULL on
124 This demonstrates how to load the provider module "foo" and ask for
127 OSSL_PROVIDER *prov = NULL;
128 const char *build = NULL;
130 OSSL_PARAM request[] = {
131 { "build", OSSL_PARAM_UTF8_STRING_PTR, &build, 0, &build_l },
132 { NULL, 0, NULL, 0, NULL }
135 if ((prov = OSSL_PROVIDER_load(NULL, "foo")) != NULL
136 && OSSL_PROVIDER_get_params(prov, request))
137 printf("Provider 'foo' build %s\n", build);
139 ERR_print_errors_fp(stderr);
143 L<openssl-core.h(7)>, L<OPENSSL_CTX(3)>, L<provider(7)>
147 The type and functions described here were added in OpenSSL 3.0.
151 Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
153 Licensed under the Apache License 2.0 (the "License"). You may not use
154 this file except in compliance with the License. You can obtain a copy
155 in the file LICENSE in the source distribution or at
156 L<https://www.openssl.org/source/license.html>.