summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/CMS_add1_signer.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/CMS_add1_signer.3')
-rw-r--r--src/lib/libcrypto/man/CMS_add1_signer.3203
1 files changed, 203 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/CMS_add1_signer.3 b/src/lib/libcrypto/man/CMS_add1_signer.3
new file mode 100644
index 0000000000..065e15c7be
--- /dev/null
+++ b/src/lib/libcrypto/man/CMS_add1_signer.3
@@ -0,0 +1,203 @@
1.\" $OpenBSD: CMS_add1_signer.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_ADD1_SIGNER 3
53.Os
54.Sh NAME
55.Nm CMS_add1_signer ,
56.Nm CMS_SignerInfo_sign
57.Nd add a signer to a CMS_ContentInfo signed data structure
58.Sh SYNOPSIS
59.In openssl/cms.h
60.Ft CMS_SignerInfo *
61.Fo CMS_add1_signer
62.Fa "CMS_ContentInfo *cms"
63.Fa "X509 *signcert"
64.Fa "EVP_PKEY *pkey"
65.Fa "const EVP_MD *md"
66.Fa "unsigned int flags"
67.Fc
68.Ft int
69.Fo CMS_SignerInfo_sign
70.Fa "CMS_SignerInfo *si"
71.Fc
72.Sh DESCRIPTION
73.Fn CMS_add1_signer
74adds a signer with certificate
75.Fa signcert
76and private key
77.Fa pkey
78using message digest
79.Fa md
80to the
81.Vt CMS_ContentInfo
82SignedData structure
83.Fa cms .
84.Pp
85The
86.Vt CMS_ContentInfo
87structure should be obtained from an initial call to
88.Xr CMS_sign 3
89with the flag
90.Dv CMS_PARTIAL
91set or in the case or re-signing a valid
92.Vt CMS_ContentInfo
93SignedData structure.
94.Pp
95If the
96.Fa md
97parameter is
98.Dv NULL ,
99then the default digest for the public key algorithm will be used.
100.Pp
101Unless the
102.Dv CMS_REUSE_DIGEST
103flag is set, the returned
104.Vt CMS_ContentInfo
105structure is not complete and must be finalized either by streaming
106(if applicable) or a call to
107.Xr CMS_final 3 .
108.Pp
109The
110.Fn CMS_SignerInfo_sign
111function will explicitly sign a
112.Vt CMS_SignerInfo
113structure.
114Its main use is when the
115.Dv CMS_REUSE_DIGEST
116and
117.Dv CMS_PARTIAL
118flags are both set.
119.Pp
120The main purpose of
121.Fn CMS_add1_signer
122is to provide finer control over a CMS signed data structure where the
123simpler
124.Xr CMS_sign 3
125function defaults are not appropriate, for example if multiple signers
126or non default digest algorithms are needed.
127New attributes can also be added using the returned
128.Vt CMS_SignerInfo
129structure and the CMS attribute utility functions or the CMS signed
130receipt request functions.
131.Pp
132Any of the following flags (OR'ed together) can be passed in the
133.Fa flags
134parameter:
135.Bl -tag -width Ds
136.It Dv CMS_REUSE_DIGEST
137Attempt to copy the content digest value from the
138.Vt CMS_ContentInfo
139structure to add a signer to an existing structure.
140An error occurs if a matching digest value cannot be found to copy.
141The returned
142.Vt CMS_ContentInfo
143structure will be valid and finalized when this flag is set.
144.It Dv CMS_PARTIAL
145If this flag is set in addition to
146.Dv CMS_REUSE_DIGEST ,
147then the
148.Vt CMS_SignerInfo
149structure will not be finalized so additional attributes can be added.
150In this case an explicit call to
151.Fn CMS_SignerInfo_sign
152is needed to finalize it.
153.It Dv CMS_NOCERTS
154Do not include the signer's certificate in the
155.Vt CMS_ContentInfo
156structure.
157The signer's certificate must still be supplied in the
158.Fa signcert
159parameter though.
160This can reduce the size of the signature if the signer's certificate can
161be obtained by other means, for example from a previously signed message.
162.Pp
163The SignedData structure includes several CMS signedAttributes including
164the signing time, the CMS content type and the supported list of ciphers
165in an SMIMECapabilities attribute.
166.It Dv CMS_NOATTR
167Use no signedAttributes.
168.It Dv CMS_NOSMIMECAP
169Omit just the SMIMECapabilities.
170.It Dv CMS_USE_KEYID
171Use the subject key identifier value to identify signing certificates.
172An error occurs if the signing certificate does not have a subject key
173identifier extension.
174By default, issuer name and serial number are used instead.
175.El
176.Pp
177If present, the SMIMECapabilities attribute indicates support for the
178following algorithms in preference order: 256 bit AES, Gost R3411-94,
179Gost 28147-89, 192 bit AES, 128 bit AES, triple DES, 128 bit RC2, 64 bit
180RC2, DES and 40 bit RC2.
181If any of these algorithms is not available then it will not be
182included: for example the GOST algorithms will not be included if
183the GOST ENGINE is not loaded.
184.Pp
185.Fn CMS_add1_signer
186returns an internal pointer to the
187.Vt CMS_SignerInfo
188structure just added.
189This can be used to set additional attributes before it is finalized.
190.Sh RETURN VALUES
191.Fn CMS_add1_signer
192returns an internal pointer to the
193.Vt CMS_SignerInfo
194structure just added or
195.Dv NULL
196if an error occurs.
197.Sh SEE ALSO
198.Xr CMS_final 3 ,
199.Xr CMS_sign 3 ,
200.Xr ERR_get_error 3
201.Sh HISTORY
202.Fn CMS_add1_signer
203was added to OpenSSL 0.9.8.