Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-29 08:27:28

0001 /*
0002  * Copyright 2019-2025 The OpenSSL Project Authors. All Rights Reserved.
0003  *
0004  * Licensed under the Apache License 2.0 (the "License").  You may not use
0005  * this file except in compliance with the License.  You can obtain a copy
0006  * in the file LICENSE in the source distribution or at
0007  * https://www.openssl.org/source/license.html
0008  */
0009 
0010 #ifndef OPENSSL_PROVIDER_H
0011 # define OPENSSL_PROVIDER_H
0012 # pragma once
0013 
0014 # include <openssl/core.h>
0015 
0016 # ifdef __cplusplus
0017 extern "C" {
0018 # endif
0019 
0020 /* Set and Get a library context search path */
0021 int OSSL_PROVIDER_set_default_search_path(OSSL_LIB_CTX *, const char *path);
0022 const char *OSSL_PROVIDER_get0_default_search_path(OSSL_LIB_CTX *libctx);
0023 
0024 /* Load and unload a provider */
0025 OSSL_PROVIDER *OSSL_PROVIDER_load(OSSL_LIB_CTX *, const char *name);
0026 OSSL_PROVIDER *OSSL_PROVIDER_load_ex(OSSL_LIB_CTX *, const char *name,
0027                                      OSSL_PARAM *params);
0028 OSSL_PROVIDER *OSSL_PROVIDER_try_load(OSSL_LIB_CTX *, const char *name,
0029                                       int retain_fallbacks);
0030 OSSL_PROVIDER *OSSL_PROVIDER_try_load_ex(OSSL_LIB_CTX *, const char *name,
0031                                          OSSL_PARAM *params,
0032                                          int retain_fallbacks);
0033 int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov);
0034 int OSSL_PROVIDER_available(OSSL_LIB_CTX *, const char *name);
0035 int OSSL_PROVIDER_do_all(OSSL_LIB_CTX *ctx,
0036                          int (*cb)(OSSL_PROVIDER *provider, void *cbdata),
0037                          void *cbdata);
0038 
0039 const OSSL_PARAM *OSSL_PROVIDER_gettable_params(const OSSL_PROVIDER *prov);
0040 int OSSL_PROVIDER_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[]);
0041 int OSSL_PROVIDER_self_test(const OSSL_PROVIDER *prov);
0042 int OSSL_PROVIDER_get_capabilities(const OSSL_PROVIDER *prov,
0043                                    const char *capability,
0044                                    OSSL_CALLBACK *cb,
0045                                    void *arg);
0046 
0047 /*-
0048  * Provider configuration parameters are normally set in the configuration file,
0049  * but can also be set early in the main program before a provider is in use by
0050  * multiple threads.
0051  *
0052  * Only UTF8-string values are supported.
0053  */
0054 int OSSL_PROVIDER_add_conf_parameter(OSSL_PROVIDER *prov, const char *name,
0055                                      const char *value);
0056 /*
0057  * Retrieves any of the requested configuration parameters for the given
0058  * provider that were set in the configuration file or via the above
0059  * OSSL_PROVIDER_add_parameter() function.
0060  *
0061  * The |params| array elements MUST have type OSSL_PARAM_UTF8_PTR, values are
0062  * returned by reference, not as copies.
0063  */
0064 int OSSL_PROVIDER_get_conf_parameters(const OSSL_PROVIDER *prov,
0065                                       OSSL_PARAM params[]);
0066 /*
0067  * Parse a provider configuration parameter as a boolean value,
0068  * or return a default value if unable to retrieve the parameter.
0069  * Values like "1", "yes", "true", ... are true (nonzero).
0070  * Values like "0", "no", "false", ... are false (zero).
0071  */
0072 int OSSL_PROVIDER_conf_get_bool(const OSSL_PROVIDER *prov,
0073                                 const char *name, int defval);
0074 
0075 const OSSL_ALGORITHM *OSSL_PROVIDER_query_operation(const OSSL_PROVIDER *prov,
0076                                                     int operation_id,
0077                                                     int *no_cache);
0078 void OSSL_PROVIDER_unquery_operation(const OSSL_PROVIDER *prov,
0079                                      int operation_id, const OSSL_ALGORITHM *algs);
0080 void *OSSL_PROVIDER_get0_provider_ctx(const OSSL_PROVIDER *prov);
0081 const OSSL_DISPATCH *OSSL_PROVIDER_get0_dispatch(const OSSL_PROVIDER *prov);
0082 
0083 /* Add a built in providers */
0084 int OSSL_PROVIDER_add_builtin(OSSL_LIB_CTX *, const char *name,
0085                               OSSL_provider_init_fn *init_fn);
0086 
0087 /* Information */
0088 const char *OSSL_PROVIDER_get0_name(const OSSL_PROVIDER *prov);
0089 
0090 # ifdef __cplusplus
0091 }
0092 # endif
0093 
0094 #endif