man-pages/man7/ossl_store.7ssl.html
2021-03-31 01:06:50 +01:00

154 lines
4.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of OSSL_STORE</TITLE>
</HEAD><BODY>
<H1>OSSL_STORE</H1>
Section: OpenSSL (7SSL)<BR>Updated: 2021-03-22<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
ossl_store - Store retrieval functions
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
#include &lt;<A HREF="file:///usr/include/openssl/store.h">openssl/store.h</A>&gt;
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<A NAME="lbAE">&nbsp;</A>
<H3>General</H3>
A <FONT SIZE="-1">STORE</FONT> 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 <FONT SIZE="-1">URI.</FONT>
<P>
The functionality supports the pattern ``open a channel to the
repository'', ``loop and retrieve one object at a time'', and ``finish up
by closing the channel''.
<P>
The retrieved objects are returned as a wrapper type <B></B><FONT SIZE="-1"><B>OSSL_STORE_INFO</B></FONT><B></B>,
from which an OpenSSL type can be retrieved.
<A NAME="lbAF">&nbsp;</A>
<H3><FONT SIZE="-1">URI</FONT> schemes and loaders</H3>
Support for a <FONT SIZE="-1">URI</FONT> scheme is called a <FONT SIZE="-1">STORE</FONT> ``loader'', and can be added
dynamically from the calling application or from a loadable engine.
<P>
Support for the 'file' scheme is built into <TT>&quot;libcrypto&quot;</TT>.
See <B><A HREF="/cgi-bin/man/man2html?7+ossl_store-file">ossl_store-file</A></B>(7) for more information.
<A NAME="lbAG">&nbsp;</A>
<H3><FONT SIZE="-1">UI_METHOD</FONT> and pass phrases</H3>
The <B></B><FONT SIZE="-1"><B>OSS_STORE</B></FONT><B></B> <FONT SIZE="-1">API</FONT> does nothing to enforce any specific format or
encoding on the pass phrase that the <B></B><FONT SIZE="-1"><B>UI_METHOD</B></FONT><B></B> provides. However,
the pass phrase is expected to be <FONT SIZE="-1">UTF-8</FONT> encoded. The result of any
other encoding is undefined.
<A NAME="lbAH">&nbsp;</A>
<H2>EXAMPLES</H2>
<A NAME="lbAI">&nbsp;</A>
<H3>A generic call</H3>
<PRE>
OSSL_STORE_CTX *ctx = OSSL_STORE_open(&quot;file:/foo/bar/data.pem&quot;);
/*
* 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);
/*
* 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;
}
}
OSSL_STORE_close(ctx);
</PRE>
<A NAME="lbAJ">&nbsp;</A>
<H2>SEE ALSO</H2>
<FONT SIZE="-1"><B><A HREF="/cgi-bin/man/man2html?3+OSSL_STORE_INFO">OSSL_STORE_INFO</A></B></FONT><B></B>(3), <FONT SIZE="-1"><B><A HREF="/cgi-bin/man/man2html?3+OSSL_STORE_LOADER">OSSL_STORE_LOADER</A></B></FONT><B></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+OSSL_STORE_open">OSSL_STORE_open</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+OSSL_STORE_expect">OSSL_STORE_expect</A></B>(3),
<FONT SIZE="-1"><B><A HREF="/cgi-bin/man/man2html?3+OSSL_STORE_SEARCH">OSSL_STORE_SEARCH</A></B></FONT><B></B>(3)
<A NAME="lbAK">&nbsp;</A>
<H2>COPYRIGHT</H2>
Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
<P>
Licensed under the OpenSSL license (the ``License''). You may not use
this file except in compliance with the License. You can obtain a copy
in the file <FONT SIZE="-1">LICENSE</FONT> in the source distribution or at
&lt;<A HREF="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</A>&gt;.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
<DT id="2"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="3"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DL>
<DT id="4"><A HREF="#lbAE">General</A><DD>
<DT id="5"><A HREF="#lbAF"><FONT SIZE="-1">URI</FONT> schemes and loaders</A><DD>
<DT id="6"><A HREF="#lbAG"><FONT SIZE="-1">UI_METHOD</FONT> and pass phrases</A><DD>
</DL>
<DT id="7"><A HREF="#lbAH">EXAMPLES</A><DD>
<DL>
<DT id="8"><A HREF="#lbAI">A generic call</A><DD>
</DL>
<DT id="9"><A HREF="#lbAJ">SEE ALSO</A><DD>
<DT id="10"><A HREF="#lbAK">COPYRIGHT</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:09 GMT, March 31, 2021
</BODY>
</HTML>