openssl-prebuild/linux_amd64/ssl/share/doc/openssl/html/man3/SMIME_read_PKCS7.html

113 lines
3.7 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>SMIME_read_PKCS7</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>
<li><a href="#notes">NOTES</a></li>
<li><a href="#bugs">BUGS</a></li>
<li><a href="#return_values">RETURN VALUES</a></li>
<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>SMIME_read_PKCS7 - parse S/MIME message</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
#include &lt;openssl/pkcs7.h&gt;</pre>
<pre>
PKCS7 *SMIME_read_PKCS7(BIO *in, BIO **bcont);</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>SMIME_read_PKCS7() parses a message in S/MIME format.</p>
<p><strong>in</strong> is a BIO to read the message from.</p>
<p>If cleartext signing is used then the content is saved in
a memory bio which is written to <strong>*bcont</strong>, otherwise
<strong>*bcont</strong> is set to <strong>NULL</strong>.</p>
<p>The parsed PKCS#7 structure is returned or <strong>NULL</strong> if an
error occurred.</p>
<p>
</p>
<hr />
<h1><a name="notes">NOTES</a></h1>
<p>If <strong>*bcont</strong> is not <strong>NULL</strong> then the message is clear text
signed. <strong>*bcont</strong> can then be passed to PKCS7_verify() with
the <strong>PKCS7_DETACHED</strong> flag set.</p>
<p>Otherwise the type of the returned structure can be determined
using PKCS7_type_is_enveloped(), etc.</p>
<p>To support future functionality if <strong>bcont</strong> is not <strong>NULL</strong>
<strong>*bcont</strong> should be initialized to <strong>NULL</strong>. For example:</p>
<pre>
BIO *cont = NULL;
PKCS7 *p7;</pre>
<pre>
p7 = SMIME_read_PKCS7(in, &amp;cont);</pre>
<p>
</p>
<hr />
<h1><a name="bugs">BUGS</a></h1>
<p>The MIME parser used by SMIME_read_PKCS7() is somewhat primitive.
While it will handle most S/MIME messages more complex compound
formats may not work.</p>
<p>The parser assumes that the PKCS7 structure is always base64
encoded and will not handle the case where it is in binary format
or uses quoted printable format.</p>
<p>The use of a memory BIO to hold the signed content limits the size
of message which can be processed due to memory restraints: a
streaming single pass option should be available.</p>
<p>
</p>
<hr />
<h1><a name="return_values">RETURN VALUES</a></h1>
<p>SMIME_read_PKCS7() returns a valid <strong>PKCS7</strong> structure or <strong>NULL</strong>
if an error occurred. The error can be obtained from <code>ERR_get_error(3)</code>.</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><em>ERR_get_error(3)</em>,
<em>SMIME_read_PKCS7(3)</em>, <em>PKCS7_sign(3)</em>,
<em>PKCS7_verify(3)</em>, <em>PKCS7_encrypt(3)</em>
<em>PKCS7_decrypt(3)</em></p>
<p>
</p>
<hr />
<h1><a name="copyright">COPYRIGHT</a></h1>
<p>Copyright 2002-2018 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>