openssl-prebuild/linux_amd64/ssl/share/doc/openssl/html/man3/OSSL_PROVIDER.html
2020-03-02 16:50:34 +00:00

159 lines
5.9 KiB
HTML
Executable File

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OSSL_PROVIDER</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>
<body style="background-color: white">
<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>
<ul>
<li><a href="#name">NAME</a></li>
<li><a href="#synopsis">SYNOPSIS</a></li>
<li><a href="#description">DESCRIPTION</a></li>
<ul>
<li><a href="#functions">Functions</a></li>
</ul>
<li><a href="#return_values">RETURN VALUES</a></li>
<li><a href="#examples">EXAMPLES</a></li>
<li><a href="#see_also">SEE ALSO</a></li>
<li><a href="#history">HISTORY</a></li>
<li><a href="#copyright">COPYRIGHT</a></li>
</ul>
<hr name="index" />
</div>
<!-- INDEX END -->
<p>
</p>
<hr />
<h1><a name="name">NAME</a></h1>
<p>OSSL_PROVIDER, OSSL_PROVIDER_load, OSSL_PROVIDER_unload,
OSSL_PROVIDER_available,
OSSL_PROVIDER_gettable_params, OSSL_PROVIDER_get_params,
OSSL_PROVIDER_add_builtin, OSSL_PROVIDER_name - provider routines</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
#include &lt;openssl/provider.h&gt;</pre>
<pre>
typedef struct ossl_provider_st OSSL_PROVIDER;</pre>
<pre>
OSSL_PROVIDER *OSSL_PROVIDER_load(OPENSSL_CTX *libctx, const char *name);
int OSSL_PROVIDER_unload(OSSL_PROVIDER *prov);
int OSSL_PROVIDER_available(OPENSSL_CTX *libctx, const char *name);</pre>
<pre>
const OSSL_PARAM *OSSL_PROVIDER_gettable_params(OSSL_PROVIDER *prov);
int OSSL_PROVIDER_get_params(OSSL_PROVIDER *prov, OSSL_PARAM params[]);</pre>
<pre>
int OSSL_PROVIDER_add_builtin(OPENSSL_CTX *libctx, const char *name,
ossl_provider_init_fn *init_fn);</pre>
<pre>
const char *OSSL_PROVIDER_name(const OSSL_PROVIDER *prov);</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p><strong>OSSL_PROVIDER</strong> is a type that holds internal information about
implementation providers (see <em>provider(7)</em> for information on what a
provider is).
A provider can be built in to the application or the OpenSSL
libraries, or can be a loadable module.
The functions described here handle both forms.</p>
<p>Some of these functions operate within a library context, please see
<em>OPENSSL_CTX(3)</em> for further details.</p>
<p>
</p>
<h2><a name="functions">Functions</a></h2>
<p><code>OSSL_PROVIDER_add_builtin()</code> is used to add a built in provider to
<strong>OSSL_PROVIDER</strong> store in the given library context, by associating a
provider name with a provider initialization function.
This name can then be used with <code>OSSL_PROVIDER_load()</code>.</p>
<p><code>OSSL_PROVIDER_load()</code> loads and initializes a provider.
This may simply initialize a provider that was previously added with
<code>OSSL_PROVIDER_add_builtin()</code> and run its given initialization function,
or load a provider module with the given name and run its provider
entry point, <code>OSSL_provider_init</code>.</p>
<p><code>OSSL_PROVIDER_unload()</code> unloads the given provider.
For a provider added with <code>OSSL_PROVIDER_add_builtin()</code>, this simply
runs its teardown function.</p>
<p><code>OSSL_PROVIDER_available()</code> checks if a named provider is available
for use.</p>
<p><code>OSSL_PROVIDER_gettable_params()</code> is used to get a provider parameter
descriptor set as a constant <strong>OSSL_PARAM</strong> array.
See <em>OSSL_PARAM(3)</em> for more information.</p>
<p><code>OSSL_PROVIDER_get_params()</code> is used to get provider parameter values.
The caller must prepare the <strong>OSSL_PARAM</strong> array before calling this
function, and the variables acting as buffers for this parameter array
should be filled with data when it returns successfully.</p>
<p><code>OSSL_PROVIDER_name()</code> returns the name of the given provider.</p>
<p>
</p>
<hr />
<h1><a name="return_values">RETURN VALUES</a></h1>
<p><code>OSSL_PROVIDER_add()</code> returns 1 on success, or 0 on error.</p>
<p><code>OSSL_PROVIDER_load()</code> returns a pointer to a provider object on
success, or <strong>NULL</strong> on error.</p>
<p><code>OSSL_PROVIDER_unload()</code> returns 1 on success, or 0 on error.</p>
<p><code>OSSL_PROVIDER_available()</code> returns 1 if the named provider is available,
otherwise 0.</p>
<p><code>OSSL_PROVIDER_gettable_params()</code> returns a pointer to an array
of constant <strong>OSSL_PARAM</strong>, or NULL if none is provided.</p>
<p><code>OSSL_PROVIDER_get_params()</code> returns 1 on success, or 0 on error.</p>
<p>
</p>
<hr />
<h1><a name="examples">EXAMPLES</a></h1>
<p>This demonstrates how to load the provider module &quot;foo&quot; and ask for
its build number.</p>
<pre>
OSSL_PROVIDER *prov = NULL;
const char *build = NULL;
size_t built_l = 0;
OSSL_PARAM request[] = {
{ &quot;build&quot;, OSSL_PARAM_UTF8_STRING_PTR, &amp;build, 0, &amp;build_l },
{ NULL, 0, NULL, 0, NULL }
};</pre>
<pre>
if ((prov = OSSL_PROVIDER_load(NULL, &quot;foo&quot;)) != NULL
&amp;&amp; OSSL_PROVIDER_get_params(prov, request))
printf(&quot;Provider 'foo' build %s\n&quot;, build);
else
ERR_print_errors_fp(stderr);</pre>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><em>openssl-core.h(7)</em>, <em>OPENSSL_CTX(3)</em>, <em>provider(7)</em></p>
<p>
</p>
<hr />
<h1><a name="history">HISTORY</a></h1>
<p>The type and functions described here were added in OpenSSL 3.0.</p>
<p>
</p>
<hr />
<h1><a name="copyright">COPYRIGHT</a></h1>
<p>Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.</p>
<p>Licensed under the Apache License 2.0 (the &quot;License&quot;). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
<a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a>.</p>
</body>
</html>