]> git.ipfire.org Git - thirdparty/openssl.git/blame - include/internal/provider.h
Replumbing: Add the Provider Object, type OSSL_PROVIDER
[thirdparty/openssl.git] / include / internal / provider.h
CommitLineData
4c2883a9
RL
1/*
2 * Copyright 2019 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 OSSL_INTERNAL_PROVIDER_H
11# define OSSL_INTERNAL_PROVIDER_H
12
13# include <openssl/core.h>
14# include "internal/dso.h"
15# include "internal/symhacks.h"
16
17# ifdef __cplusplus
18extern "C" {
19# endif
20
21/*
22 * namespaces:
23 *
24 * ossl_provider_ Provider Object internal API
25 * OSSL_PROVIDER Provider Object
26 */
27
28/* Provider Object finder, constructor and destructor */
29OSSL_PROVIDER *ossl_provider_find(OPENSSL_CTX *libctx, const char *name);
30OSSL_PROVIDER *ossl_provider_new(OPENSSL_CTX *libctx, const char *name,
31 OSSL_provider_init_fn *init_function);
32int ossl_provider_upref(OSSL_PROVIDER *prov);
33void ossl_provider_free(OSSL_PROVIDER *prov);
34
35/* Setters */
36int ossl_provider_add_module_location(OSSL_PROVIDER *prov, const char *loc);
37
38/*
39 * Activate the Provider
40 * If the Provider is a module, the module will be loaded
41 * Inactivation is done by freeing the Provider
42 */
43int ossl_provider_activate(OSSL_PROVIDER *prov);
44
45/* Getters for other library functions */
46const char *ossl_provider_name(OSSL_PROVIDER *prov);
47const DSO *ossl_provider_dso(OSSL_PROVIDER *prov);
48const char *ossl_provider_module_name(OSSL_PROVIDER *prov);
49const char *ossl_provider_module_path(OSSL_PROVIDER *prov);
50
51/* Thin wrappers around calls to the provider */
52void ossl_provider_teardown(const OSSL_PROVIDER *prov);
53const OSSL_ITEM *ossl_provider_get_param_types(const OSSL_PROVIDER *prov);
54int ossl_provider_get_params(const OSSL_PROVIDER *prov,
55 const OSSL_PARAM params[]);
56
57# ifdef __cplusplus
58}
59# endif
60
61#endif