openssl-prebuild/linux_amd64/share/doc/openssl/html/man7/ossl_store.html

134 lines
4.1 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_store</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="#general">General</a></li>
<li><a href="#uri_schemes_and_loaders">URI schemes and loaders</a></li>
<li><a href="#ui_method_and_pass_phrases">UI_METHOD and pass phrases</a></li>
</ul>
<li><a href="#examples">EXAMPLES</a></li>
<ul>
<li><a href="#a_generic_call">A generic call</a></li>
</ul>
<li><a href="#see_also">SEE ALSO</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_store - Store retrieval functions</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<p>#include &lt;openssl/store.h&gt;</p>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>
</p>
<h2><a name="general">General</a></h2>
<p>A STORE is a layer of functionality to retrieve a number of supported
objects from a repository of any kind, addressable as a file name or
as a URI.</p>
<p>The functionality supports the pattern &quot;open a channel to the
repository&quot;, &quot;loop and retrieve one object at a time&quot;, and &quot;finish up
by closing the channel&quot;.</p>
<p>The retrieved objects are returned as a wrapper type <strong>OSSL_STORE_INFO</strong>,
from which an OpenSSL type can be retrieved.</p>
<p>
</p>
<h2><a name="uri_schemes_and_loaders">URI schemes and loaders</a></h2>
<p>Support for a URI scheme is called a STORE &quot;loader&quot;, and can be added
dynamically from the calling application or from a loadable engine.</p>
<p>Support for the 'file' scheme is built into <code>libcrypto</code>.
See <em>ossl_store-file(7)</em> for more information.</p>
<p>
</p>
<h2><a name="ui_method_and_pass_phrases">UI_METHOD and pass phrases</a></h2>
<p>The <strong>OSS_STORE</strong> API does nothing to enforce any specific format or
encoding on the pass phrase that the <strong>UI_METHOD</strong> provides. However,
the pass phrase is expected to be UTF-8 encoded. The result of any
other encoding is undefined.</p>
<p>
</p>
<hr />
<h1><a name="examples">EXAMPLES</a></h1>
<p>
</p>
<h2><a name="a_generic_call">A generic call</a></h2>
<pre>
OSSL_STORE_CTX *ctx = OSSL_STORE_open(&quot;<a href="file:/foo/bar/data.pem&quot">file:/foo/bar/data.pem&quot</a>;);</pre>
<pre>
/*
* OSSL_STORE_eof() simulates file semantics for any repository to signal
* that no more data can be expected
*/
while (!OSSL_STORE_eof(ctx)) {
OSSL_STORE_INFO *info = OSSL_STORE_load(ctx);</pre>
<pre>
/*
* Do whatever is necessary with the OSSL_STORE_INFO,
* here just one example
*/
switch (OSSL_STORE_INFO_get_type(info)) {
case OSSL_STORE_INFO_X509:
/* Print the X.509 certificate text */
X509_print_fp(stdout, OSSL_STORE_INFO_get0_CERT(info));
/* Print the X.509 certificate PEM output */
PEM_write_X509(stdout, OSSL_STORE_INFO_get0_CERT(info));
break;
}
}</pre>
<pre>
OSSL_STORE_close(ctx);</pre>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><em>OSSL_STORE_INFO(3)</em>, <em>OSSL_STORE_LOADER(3)</em>,
<em>OSSL_STORE_open(3)</em>, <em>OSSL_STORE_expect(3)</em>,
<em>OSSL_STORE_SEARCH(3)</em></p>
<p>
</p>
<hr />
<h1><a name="copyright">COPYRIGHT</a></h1>
<p>Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.</p>
<p>Licensed under the OpenSSL license (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>