110 lines
3.6 KiB
HTML
110 lines
3.6 KiB
HTML
|
<?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_CMS</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_CMS - parse S/MIME message</p>
|
||
|
<p>
|
||
|
</p>
|
||
|
<hr />
|
||
|
<h1><a name="synopsis">SYNOPSIS</a></h1>
|
||
|
<pre>
|
||
|
#include <openssl/cms.h></pre>
|
||
|
<pre>
|
||
|
CMS_ContentInfo *SMIME_read_CMS(BIO *in, BIO **bcont);</pre>
|
||
|
<p>
|
||
|
</p>
|
||
|
<hr />
|
||
|
<h1><a name="description">DESCRIPTION</a></h1>
|
||
|
<p><code>SMIME_read_CMS()</code> 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 NULL.</p>
|
||
|
<p>The parsed CMS_ContentInfo structure is returned or NULL if an
|
||
|
error occurred.</p>
|
||
|
<p>
|
||
|
</p>
|
||
|
<hr />
|
||
|
<h1><a name="notes">NOTES</a></h1>
|
||
|
<p>If <strong>*bcont</strong> is not NULL then the message is clear text signed. <strong>*bcont</strong> can
|
||
|
then be passed to <code>CMS_verify()</code> with the <strong>CMS_DETACHED</strong> flag set.</p>
|
||
|
<p>Otherwise the type of the returned structure can be determined
|
||
|
using CMS_get0_type().</p>
|
||
|
<p>To support future functionality if <strong>bcont</strong> is not NULL <strong>*bcont</strong> should be
|
||
|
initialized to NULL. For example:</p>
|
||
|
<pre>
|
||
|
BIO *cont = NULL;
|
||
|
CMS_ContentInfo *cms;</pre>
|
||
|
<pre>
|
||
|
cms = SMIME_read_CMS(in, &cont);</pre>
|
||
|
<p>
|
||
|
</p>
|
||
|
<hr />
|
||
|
<h1><a name="bugs">BUGS</a></h1>
|
||
|
<p>The MIME parser used by <code>SMIME_read_CMS()</code> 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 CMS_ContentInfo 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><code>SMIME_read_CMS()</code> returns a valid <strong>CMS_ContentInfo</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_CMS(3)</em>, <em>CMS_sign(3)</em>,
|
||
|
<em>CMS_verify(3)</em>, <em>CMS_encrypt(3)</em>,
|
||
|
<em>CMS_decrypt(3)</em></p>
|
||
|
<p>
|
||
|
</p>
|
||
|
<hr />
|
||
|
<h1><a name="copyright">COPYRIGHT</a></h1>
|
||
|
<p>Copyright 2008-2016 The OpenSSL Project Authors. All Rights Reserved.</p>
|
||
|
<p>Licensed under the Apache License 2.0 (the "License"). 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>
|