diff options
Diffstat (limited to 'src/lib/libcrypto/man/CMS_get0_RecipientInfos.3')
-rw-r--r-- | src/lib/libcrypto/man/CMS_get0_RecipientInfos.3 | 328 |
1 files changed, 0 insertions, 328 deletions
diff --git a/src/lib/libcrypto/man/CMS_get0_RecipientInfos.3 b/src/lib/libcrypto/man/CMS_get0_RecipientInfos.3 deleted file mode 100644 index 094d6ec487..0000000000 --- a/src/lib/libcrypto/man/CMS_get0_RecipientInfos.3 +++ /dev/null | |||
@@ -1,328 +0,0 @@ | |||
1 | .\" $OpenBSD: CMS_get0_RecipientInfos.3,v 1.8 2022/03/31 17:27:16 naddy 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, 2013 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: March 31 2022 $ | ||
52 | .Dt CMS_GET0_RECIPIENTINFOS 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm CMS_get0_RecipientInfos , | ||
56 | .Nm CMS_RecipientInfo_type , | ||
57 | .Nm CMS_RecipientInfo_ktri_get0_signer_id , | ||
58 | .Nm CMS_RecipientInfo_ktri_cert_cmp , | ||
59 | .Nm CMS_RecipientInfo_set0_pkey , | ||
60 | .Nm CMS_RecipientInfo_kekri_get0_id , | ||
61 | .Nm CMS_RecipientInfo_kekri_id_cmp , | ||
62 | .Nm CMS_RecipientInfo_set0_key , | ||
63 | .Nm CMS_RecipientInfo_decrypt , | ||
64 | .Nm CMS_RecipientInfo_encrypt | ||
65 | .Nd CMS EnvelopedData RecipientInfo routines | ||
66 | .Sh SYNOPSIS | ||
67 | .In openssl/cms.h | ||
68 | .Ft STACK_OF(CMS_RecipientInfo) * | ||
69 | .Fo CMS_get0_RecipientInfos | ||
70 | .Fa "CMS_ContentInfo *cms" | ||
71 | .Fc | ||
72 | .Ft int | ||
73 | .Fo CMS_RecipientInfo_type | ||
74 | .Fa "CMS_RecipientInfo *ri" | ||
75 | .Fc | ||
76 | .Ft int | ||
77 | .Fo CMS_RecipientInfo_ktri_get0_signer_id | ||
78 | .Fa "CMS_RecipientInfo *ri" | ||
79 | .Fa "ASN1_OCTET_STRING **keyid" | ||
80 | .Fa "X509_NAME **issuer" | ||
81 | .Fa "ASN1_INTEGER **sno" | ||
82 | .Fc | ||
83 | .Ft int | ||
84 | .Fo CMS_RecipientInfo_ktri_cert_cmp | ||
85 | .Fa "CMS_RecipientInfo *ri" | ||
86 | .Fa "X509 *certificate" | ||
87 | .Fc | ||
88 | .Ft int | ||
89 | .Fo CMS_RecipientInfo_set0_pkey | ||
90 | .Fa "CMS_RecipientInfo *ri" | ||
91 | .Fa "EVP_PKEY *pkey" | ||
92 | .Fc | ||
93 | .Ft int | ||
94 | .Fo CMS_RecipientInfo_kekri_get0_id | ||
95 | .Fa "CMS_RecipientInfo *ri" | ||
96 | .Fa "X509_ALGOR **palg" | ||
97 | .Fa "ASN1_OCTET_STRING **pid" | ||
98 | .Fa "ASN1_GENERALIZEDTIME **pdate" | ||
99 | .Fa "ASN1_OBJECT **potherid" | ||
100 | .Fa "ASN1_TYPE **pothertype" | ||
101 | .Fc | ||
102 | .Ft int | ||
103 | .Fo CMS_RecipientInfo_kekri_id_cmp | ||
104 | .Fa "CMS_RecipientInfo *ri" | ||
105 | .Fa "const unsigned char *id" | ||
106 | .Fa "size_t idlen" | ||
107 | .Fc | ||
108 | .Ft int | ||
109 | .Fo CMS_RecipientInfo_set0_key | ||
110 | .Fa "CMS_RecipientInfo *ri" | ||
111 | .Fa "unsigned char *key" | ||
112 | .Fa "size_t keylen" | ||
113 | .Fc | ||
114 | .Ft int | ||
115 | .Fo CMS_RecipientInfo_decrypt | ||
116 | .Fa "CMS_ContentInfo *cms" | ||
117 | .Fa "CMS_RecipientInfo *ri" | ||
118 | .Fc | ||
119 | .Ft int | ||
120 | .Fo CMS_RecipientInfo_encrypt | ||
121 | .Fa "CMS_ContentInfo *cms" | ||
122 | .Fa "CMS_RecipientInfo *ri" | ||
123 | .Fc | ||
124 | .Sh DESCRIPTION | ||
125 | .Fn CMS_get0_RecipientInfos | ||
126 | returns all the | ||
127 | .Vt RecipientInfo | ||
128 | structures associated with the | ||
129 | .Vt EnvelopedData | ||
130 | structure | ||
131 | .Fa cms . | ||
132 | .Pp | ||
133 | .Fn CMS_RecipientInfo_type | ||
134 | returns the type of | ||
135 | .Fa ri : | ||
136 | .Bl -column CMS_RECIPINFO_TRANS for -compact | ||
137 | .It Dv CMS_RECIPINFO_TRANS Ta for Ta Vt KeyTransRecipientInfo , | ||
138 | .It Dv CMS_RECIPINFO_AGREE Ta for Ta Vt KeyAgreeRecipientInfo , | ||
139 | .It Dv CMS_RECIPINFO_KEK Ta for Ta Vt KEKRecipientInfo , | ||
140 | .It Dv CMS_RECIPINFO_PASS Ta for Ta Vt PasswordRecipientinfo , No or | ||
141 | .It Dv CMS_RECIPINFO_OTHER Ta for Ta Vt OtherRecipientInfo . | ||
142 | .El | ||
143 | .Pp | ||
144 | .Fn CMS_RecipientInfo_ktri_get0_signer_id | ||
145 | retrieves the certificate | ||
146 | .Vt RecipientIdentifier | ||
147 | associated with the | ||
148 | .Vt KeyTransRecipientInfo | ||
149 | structure | ||
150 | .Fa ri . | ||
151 | Either the | ||
152 | .Vt SubjectKeyIdentifier | ||
153 | will be set in | ||
154 | .Fa keyid | ||
155 | or both issuer name and serial number in | ||
156 | .Fa issuer | ||
157 | and | ||
158 | .Fa sno . | ||
159 | .Pp | ||
160 | .Fn CMS_RecipientInfo_ktri_cert_cmp | ||
161 | compares the | ||
162 | .Fa certificate | ||
163 | against the | ||
164 | .Vt KeyTransRecipientInfo | ||
165 | structure | ||
166 | .Fa ri . | ||
167 | .Pp | ||
168 | .Fn CMS_RecipientInfo_set0_pkey | ||
169 | associates the private key | ||
170 | .Fa pkey | ||
171 | with the | ||
172 | .Vt KeyTransRecipientInfo | ||
173 | structure | ||
174 | .Fa ri . | ||
175 | .Pp | ||
176 | .Fn CMS_RecipientInfo_kekri_get0_id | ||
177 | retrieves the key information from the | ||
178 | .Vt KEKRecipientInfo | ||
179 | structure | ||
180 | .Fa ri . | ||
181 | Fields are copied out as follows: | ||
182 | .Bl -column keyEncryptionAlgorithm to -compact | ||
183 | .It Fa keyEncryptionAlgorithm Ta to Ta Pf * Fa palg , | ||
184 | .It Fa keyIdentifier Ta to Ta Pf * Fa pid , | ||
185 | .It Fa date Ta to Ta Pf * Fa pdate Pq optional , | ||
186 | .It Fa other.keyAttrId Ta to Ta Pf * Fa potherid Pq optional , | ||
187 | .It Fa other.keyAttr Ta to Ta Pf * Fa pothertype Pq optional . | ||
188 | .El | ||
189 | Where a field is optional and absent, | ||
190 | .Dv NULL | ||
191 | is written to the corresponding parameter. | ||
192 | Parameters the application is not interested in can be set to | ||
193 | .Dv NULL . | ||
194 | .Pp | ||
195 | .Fn CMS_RecipientInfo_kekri_id_cmp | ||
196 | compares the identifier in the | ||
197 | .Fa id | ||
198 | and | ||
199 | .Fa idlen | ||
200 | parameters against the | ||
201 | .Fa keyIdentifier | ||
202 | field of the | ||
203 | .Vt KEKRecipientInfo | ||
204 | structure | ||
205 | .Fa ri . | ||
206 | .Pp | ||
207 | .Fn CMS_RecipientInfo_set0_key | ||
208 | associates the symmetric | ||
209 | .Fa key | ||
210 | of length | ||
211 | .Fa keylen | ||
212 | with the | ||
213 | .Vt KEKRecipientInfo | ||
214 | structure | ||
215 | .Fa ri . | ||
216 | .Pp | ||
217 | .Fn CMS_RecipientInfo_decrypt | ||
218 | attempts to decrypt the | ||
219 | .Vt RecipientInfo | ||
220 | structure | ||
221 | .Fa ri | ||
222 | in | ||
223 | .Fa cms . | ||
224 | A key must have been associated with | ||
225 | .Fa ri | ||
226 | first. | ||
227 | .Pp | ||
228 | .Fn CMS_RecipientInfo_encrypt | ||
229 | attempts to encrypt the | ||
230 | .Vt RecipientInfo | ||
231 | structure | ||
232 | .Fa ri | ||
233 | in | ||
234 | .Fa cms . | ||
235 | A key must have been associated with | ||
236 | .Fa ri | ||
237 | first and the content encryption key must be available, | ||
238 | for example by a previous call to | ||
239 | .Fn CMS_RecipientInfo_decrypt . | ||
240 | .Pp | ||
241 | The main purpose of these functions is to enable an application to | ||
242 | lookup recipient keys using any appropriate technique when the simpler | ||
243 | method of | ||
244 | .Xr CMS_decrypt 3 | ||
245 | is not appropriate. | ||
246 | .Pp | ||
247 | In typical usage, an application retrieves all | ||
248 | .Vt CMS_RecipientInfo | ||
249 | structures using | ||
250 | .Fn CMS_get0_RecipientInfos | ||
251 | and checks the type of each using | ||
252 | .Fn CMS_RecipientInfo_type . | ||
253 | Depending on the type, the | ||
254 | .Vt CMS_RecipientInfo | ||
255 | structure can be ignored or its key identifier data retrieved using | ||
256 | an appropriate function. | ||
257 | If the corresponding secret or private key can be obtained by any | ||
258 | appropriate means, it can then be associated with the structure and | ||
259 | .Fn CMS_RecipientInfo_decrypt | ||
260 | called. | ||
261 | If successful, | ||
262 | .Xr CMS_decrypt 3 | ||
263 | can be called with a | ||
264 | .Dv NULL | ||
265 | key to decrypt the enveloped content. | ||
266 | .Pp | ||
267 | The function | ||
268 | .Fn CMS_RecipientInfo_encrypt | ||
269 | can be used to add a new recipient to an existing enveloped data | ||
270 | structure. | ||
271 | Typically an application will first decrypt an appropriate | ||
272 | .Vt CMS_RecipientInfo | ||
273 | structure to make the content encrypt key available. | ||
274 | It will then add a new recipient using a function such as | ||
275 | .Xr CMS_add1_recipient_cert 3 | ||
276 | and finally encrypt the content encryption key using | ||
277 | .Fn CMS_RecipientInfo_encrypt . | ||
278 | .Sh RETURN VALUES | ||
279 | .Fn CMS_get0_RecipientInfos | ||
280 | returns an internal pointer to all the | ||
281 | .Vt CMS_RecipientInfo | ||
282 | structures, or | ||
283 | .Dv NULL | ||
284 | if an error occurs. | ||
285 | .Pp | ||
286 | .Fn CMS_RecipientInfo_type | ||
287 | returns an integer constant. | ||
288 | .Pp | ||
289 | .Fn CMS_RecipientInfo_ktri_get0_signer_id , | ||
290 | .Fn CMS_RecipientInfo_set0_pkey , | ||
291 | .Fn CMS_RecipientInfo_kekri_get0_id , | ||
292 | .Fn CMS_RecipientInfo_set0_key , | ||
293 | .Fn CMS_RecipientInfo_decrypt , | ||
294 | and | ||
295 | .Fn CMS_RecipientInfo_encrypt | ||
296 | return 1 for success or 0 if an error occurs. | ||
297 | .Pp | ||
298 | .Fn CMS_RecipientInfo_ktri_cert_cmp | ||
299 | and | ||
300 | .Fn CMS_RecipientInfo_kekri_id_cmp | ||
301 | return 0 when | ||
302 | .Fa ri | ||
303 | matches or non-zero otherwise. | ||
304 | .Pp | ||
305 | Any error can be obtained from | ||
306 | .Xr ERR_get_error 3 . | ||
307 | .Sh SEE ALSO | ||
308 | .Xr CMS_ContentInfo_new 3 , | ||
309 | .Xr CMS_decrypt 3 | ||
310 | .Sh STANDARDS | ||
311 | RFC 5652 Cryptographic Message Syntax (CMS): | ||
312 | .Bl -dash -compact -offset indent | ||
313 | .It | ||
314 | section 6.1: EnvelopedData Type | ||
315 | .It | ||
316 | section 6.2: RecipientInfo Type | ||
317 | .It | ||
318 | section 6.2.1: KeyTransRecipientInfo Type | ||
319 | .It | ||
320 | section 6.2.3: KEKRecipientInfo Type | ||
321 | .El | ||
322 | .Sh HISTORY | ||
323 | These functions first appeared in OpenSSL 0.9.8h, | ||
324 | except that | ||
325 | .Fn CMS_RecipientInfo_encrypt | ||
326 | first appeared in OpenSSL 1.0.2. | ||
327 | They have been available since | ||
328 | .Ox 6.7 . | ||