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

104 lines
3.6 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>CMS_add0_cert</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="#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>CMS_add0_cert, CMS_add1_cert, CMS_get1_certs, CMS_add0_crl, CMS_add1_crl, CMS_get1_crls
- CMS certificate and CRL utility functions</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
#include &lt;openssl/cms.h&gt;</pre>
<pre>
int CMS_add0_cert(CMS_ContentInfo *cms, X509 *cert);
int CMS_add1_cert(CMS_ContentInfo *cms, X509 *cert);
STACK_OF(X509) *CMS_get1_certs(CMS_ContentInfo *cms);</pre>
<pre>
int CMS_add0_crl(CMS_ContentInfo *cms, X509_CRL *crl);
int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl);
STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms);</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>CMS_add0_cert() and CMS_add1_cert() add certificate <strong>cert</strong> to <strong>cms</strong>.
must be of type signed data or enveloped data.</p>
<p>CMS_get1_certs() returns all certificates in <strong>cms</strong>.</p>
<p>CMS_add0_crl() and CMS_add1_crl() add CRL <strong>crl</strong> to <strong>cms</strong>. CMS_get1_crls()
returns any CRLs in <strong>cms</strong>.</p>
<p>
</p>
<hr />
<h1><a name="notes">NOTES</a></h1>
<p>The CMS_ContentInfo structure <strong>cms</strong> must be of type signed data or enveloped
data or an error will be returned.</p>
<p>For signed data certificates and CRLs are added to the <strong>certificates</strong> and
<strong>crls</strong> fields of SignedData structure. For enveloped data they are added to
<strong>OriginatorInfo</strong>.</p>
<p>As the <strong>0</strong> implies CMS_add0_cert() adds <strong>cert</strong> internally to <strong>cms</strong> and it
must not be freed up after the call as opposed to CMS_add1_cert() where <strong>cert</strong>
must be freed up.</p>
<p>The same certificate or CRL must not be added to the same cms structure more
than once.</p>
<p>
</p>
<hr />
<h1><a name="return_values">RETURN VALUES</a></h1>
<p>CMS_add0_cert(), CMS_add1_cert() and CMS_add0_crl() and CMS_add1_crl() return
1 for success and 0 for failure.</p>
<p>CMS_get1_certs() and CMS_get1_crls() return the STACK of certificates or CRLs
or NULL if there are none or an error occurs. The only error which will occur
in practice is if the <strong>cms</strong> type is invalid.</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><em>ERR_get_error(3)</em>,
<em>CMS_sign(3)</em>,
<em>CMS_encrypt(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 &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>