check_chain_extensions(): Add check that Basic Constraints of CA cert are marked...
[openssl.git] / include / openssl / provider.h
1 /*
2  * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the Apache License 2.0 (the "License").  You may not use
5  * this file except in compliance with the License.  You can obtain a copy
6  * in the file LICENSE in the source distribution or at
7  * https://www.openssl.org/source/license.html
8  */
9
10 #ifndef OPENSSL_PROVIDER_H
11 # define OPENSSL_PROVIDER_H
12
13 # include <openssl/core.h>
14
15 # ifdef __cplusplus
16 extern "C" {
17 # endif
18
19 /* Set the default provider search path */
20 int OSSL_PROVIDER_set_default_search_path(OPENSSL_CTX *, const char *path);
21
22 /* Load and unload a provider */
23 OSSL_PROVIDER *OSSL_PROVIDER_load(OPENSSL_CTX *, const char *name);
24 OSSL_PROVIDER *OSSL_PROVIDER_try_load(OPENSSL_CTX *, const char *name);
25 int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov);
26 int OSSL_PROVIDER_available(OPENSSL_CTX *, const char *name);
27 int OSSL_PROVIDER_do_all(OPENSSL_CTX *ctx,
28                          int (*cb)(OSSL_PROVIDER *provider, void *cbdata),
29                          void *cbdata);
30
31 const OSSL_PARAM *OSSL_PROVIDER_gettable_params(const OSSL_PROVIDER *prov);
32 int OSSL_PROVIDER_get_params(const OSSL_PROVIDER *prov, OSSL_PARAM params[]);
33 int OSSL_PROVIDER_self_test(const OSSL_PROVIDER *prov);
34 int OSSL_PROVIDER_get_capabilities(const OSSL_PROVIDER *prov,
35                                    const char *capability,
36                                    OSSL_CALLBACK *cb,
37                                    void *arg);
38
39 const OSSL_ALGORITHM *OSSL_PROVIDER_query_operation(const OSSL_PROVIDER *prov,
40                                                     int operation_id,
41                                                     int *no_cache);
42 void *OSSL_PROVIDER_get0_provider_ctx(const OSSL_PROVIDER *prov);
43
44 /* Add a built in providers */
45 int OSSL_PROVIDER_add_builtin(OPENSSL_CTX *, const char *name,
46                               OSSL_provider_init_fn *init_fn);
47
48 /* Information */
49 const char *OSSL_PROVIDER_name(const OSSL_PROVIDER *prov);
50
51 # ifdef __cplusplus
52 }
53 # endif
54
55 #endif