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

147 lines
5.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of BIO</TITLE>
</HEAD><BODY>
<H1>BIO</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>
bio - Basic I/O abstraction
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
#include &lt;<A HREF="file:///usr/include/openssl/bio.h">openssl/bio.h</A>&gt;
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
A <FONT SIZE="-1">BIO</FONT> is an I/O abstraction, it hides many of the underlying I/O
details from an application. If an application uses a <FONT SIZE="-1">BIO</FONT> for its
I/O it can transparently handle <FONT SIZE="-1">SSL</FONT> connections, unencrypted network
connections and file I/O.
<P>
There are two type of <FONT SIZE="-1">BIO,</FONT> a source/sink <FONT SIZE="-1">BIO</FONT> and a filter <FONT SIZE="-1">BIO.</FONT>
<P>
As its name implies a source/sink <FONT SIZE="-1">BIO</FONT> is a source and/or sink of data,
examples include a socket <FONT SIZE="-1">BIO</FONT> and a file <FONT SIZE="-1">BIO.</FONT>
<P>
A filter <FONT SIZE="-1">BIO</FONT> takes data from one <FONT SIZE="-1">BIO</FONT> and passes it through to
another, or the application. The data may be left unmodified (for
example a message digest <FONT SIZE="-1">BIO</FONT>) or translated (for example an
encryption <FONT SIZE="-1">BIO</FONT>). The effect of a filter <FONT SIZE="-1">BIO</FONT> may change according
to the I/O operation it is performing: for example an encryption
<FONT SIZE="-1">BIO</FONT> will encrypt data if it is being written to and decrypt data
if it is being read from.
<P>
BIOs can be joined together to form a chain (a single <FONT SIZE="-1">BIO</FONT> is a chain
with one component). A chain normally consist of one source/sink
<FONT SIZE="-1">BIO</FONT> and one or more filter BIOs. Data read from or written to the
first <FONT SIZE="-1">BIO</FONT> then traverses the chain to the end (normally a source/sink
<FONT SIZE="-1">BIO</FONT>).
<P>
Some BIOs (such as memory BIOs) can be used immediately after calling
<B>BIO_new()</B>. Others (such as file BIOs) need some additional initialization,
and frequently a utility function exists to create and initialize such BIOs.
<P>
If <B>BIO_free()</B> is called on a <FONT SIZE="-1">BIO</FONT> chain it will only free one <FONT SIZE="-1">BIO</FONT> resulting
in a memory leak.
<P>
Calling <B>BIO_free_all()</B> on a single <FONT SIZE="-1">BIO</FONT> has the same effect as calling
<B>BIO_free()</B> on it other than the discarded return value.
<P>
Normally the <B>type</B> argument is supplied by a function which returns a
pointer to a <FONT SIZE="-1">BIO_METHOD.</FONT> There is a naming convention for such functions:
a source/sink <FONT SIZE="-1">BIO</FONT> is normally called BIO_s_*() and a filter <FONT SIZE="-1">BIO</FONT>
BIO_f_*();
<A NAME="lbAE">&nbsp;</A>
<H2>EXAMPLES</H2>
Create a memory <FONT SIZE="-1">BIO:</FONT>
<P>
<PRE>
BIO *mem = BIO_new(BIO_s_mem());
</PRE>
<A NAME="lbAF">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?3+BIO_ctrl">BIO_ctrl</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+BIO_f_base64">BIO_f_base64</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+BIO_f_buffer">BIO_f_buffer</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+BIO_f_cipher">BIO_f_cipher</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+BIO_f_md">BIO_f_md</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+BIO_f_null">BIO_f_null</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+BIO_f_ssl">BIO_f_ssl</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+BIO_find_type">BIO_find_type</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+BIO_new">BIO_new</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+BIO_new_bio_pair">BIO_new_bio_pair</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+BIO_push">BIO_push</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+BIO_read_ex">BIO_read_ex</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+BIO_s_accept">BIO_s_accept</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+BIO_s_bio">BIO_s_bio</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+BIO_s_connect">BIO_s_connect</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+BIO_s_fd">BIO_s_fd</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+BIO_s_file">BIO_s_file</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+BIO_s_mem">BIO_s_mem</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+BIO_s_null">BIO_s_null</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+BIO_s_socket">BIO_s_socket</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+BIO_set_callback">BIO_set_callback</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+BIO_should_retry">BIO_should_retry</A></B>(3)
<A NAME="lbAG">&nbsp;</A>
<H2>COPYRIGHT</H2>
Copyright 2000-2019 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>
<DT id="4"><A HREF="#lbAE">EXAMPLES</A><DD>
<DT id="5"><A HREF="#lbAF">SEE ALSO</A><DD>
<DT id="6"><A HREF="#lbAG">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:07 GMT, March 31, 2021
</BODY>
</HTML>