summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/CMS_add0_cert.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/CMS_add0_cert.3')
-rw-r--r--src/lib/libcrypto/man/CMS_add0_cert.3177
1 files changed, 177 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/CMS_add0_cert.3 b/src/lib/libcrypto/man/CMS_add0_cert.3
new file mode 100644
index 0000000000..9f99e2259f
--- /dev/null
+++ b/src/lib/libcrypto/man/CMS_add0_cert.3
@@ -0,0 +1,177 @@
1.\" $OpenBSD: CMS_add0_cert.3,v 1.3 2019/08/10 23:41:22 schwarze Exp $
2.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100
3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 2008 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: August 10 2019 $
52.Dt CMS_ADD0_CERT 3
53.Os
54.Sh NAME
55.Nm CMS_add0_cert ,
56.Nm CMS_add1_cert ,
57.Nm CMS_get1_certs ,
58.Nm CMS_add0_crl ,
59.Nm CMS_add1_crl ,
60.Nm CMS_get1_crls
61.Nd CMS certificate and CRL utility functions
62.Sh SYNOPSIS
63.In openssl/cms.h
64.Ft int
65.Fo CMS_add0_cert
66.Fa "CMS_ContentInfo *cms"
67.Fa "X509 *cert"
68.Fc
69.Ft int
70.Fo CMS_add1_cert
71.Fa "CMS_ContentInfo *cms"
72.Fa "X509 *cert"
73.Fc
74.Ft STACK_OF(X509) *
75.Fo CMS_get1_certs
76.Fa "CMS_ContentInfo *cms"
77.Fc
78.Ft int
79.Fo CMS_add0_crl
80.Fa "CMS_ContentInfo *cms"
81.Fa "X509_CRL *crl"
82.Fc
83.Ft int
84.Fo CMS_add1_crl
85.Fa "CMS_ContentInfo *cms"
86.Fa "X509_CRL *crl"
87.Fc
88.Ft STACK_OF(X509_CRL) *
89.Fo CMS_get1_crls
90.Fa "CMS_ContentInfo *cms"
91.Fc
92.Sh DESCRIPTION
93.Fn CMS_add0_cert
94and
95.Fn CMS_add1_cert
96add the certificate
97.Fa cert
98to
99.Fa cms .
100.Fa cms
101must be of type signed data or enveloped data.
102.Pp
103.Fn CMS_get1_certs
104returns all certificates in
105.Fa cms .
106.Pp
107.Fn CMS_add0_crl
108and
109.Fn CMS_add1_crl
110add the CRL
111.Fa crl
112to
113.Fa cms .
114.Fn CMS_get1_crls
115returns any CRLs in
116.Fa cms .
117.Pp
118The
119.Vt CMS_ContentInfo
120structure
121.Fa cms
122must be of type signed data or enveloped data or an error will be
123returned.
124.Pp
125The signed data certificates and CRLs are added to the
126.Sy certificates
127and
128.Sy crls
129fields of the SignedData structure.
130For enveloped data, they are added to
131.Sy OriginatorInfo .
132.Pp
133As the
134.Sq 0
135in the function name implies,
136.Fn CMS_add0_cert
137adds
138.Fa cert
139internally to
140.Fa cms
141and it must not be freed up after the call, as opposed to
142.Fn CMS_add1_cert
143where
144.Fa cert
145must be freed up.
146.Pp
147The same certificate or CRL must not be added to the same cms structure
148more than once.
149.Sh RETURN VALUES
150.Fn CMS_add0_cert ,
151.Fn CMS_add1_cert ,
152.Fn CMS_add0_crl ,
153and
154.Fn CMS_add1_crl
155return 1 for success or 0 for failure.
156.Pp
157.Fn CMS_get1_certs
158and
159.Fn CMS_get1_crls
160return the STACK of certificates or CRLs or
161.Dv NULL
162if there are none or an error occurs.
163The only error which will occur in practice is if the
164.Fa cms
165type is invalid.
166.Sh SEE ALSO
167.Xr CMS_encrypt 3 ,
168.Xr CMS_sign 3 ,
169.Xr ERR_get_error 3
170.Sh HISTORY
171.Fn CMS_add0_cert ,
172.Fn CMS_add1_cert ,
173.Fn CMS_get1_certs ,
174.Fn CMS_add0_crl
175and
176.Fn CMS_get1_crls
177were all first added to OpenSSL 0.9.8.