summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2019-08-17 14:41:01 +0000
committerschwarze <>2019-08-17 14:41:01 +0000
commit828cf47420406660396ab34261a41d0fcd3ec1bb (patch)
treec957dd7b5275faffe0770a18e2ad48a35dfdce78 /src
parente7263003444524c1b7479a6fefb97059481001b9 (diff)
downloadopenbsd-828cf47420406660396ab34261a41d0fcd3ec1bb.tar.gz
openbsd-828cf47420406660396ab34261a41d0fcd3ec1bb.tar.bz2
openbsd-828cf47420406660396ab34261a41d0fcd3ec1bb.zip
minor cleanup:
* add the missing STANDARDS section * mark up ASN.1 type names * avoid some repetitions * make some lists more palatable in -column form * and minor wording improvements and typo fixes
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/CMS_get0_RecipientInfos.3177
1 files changed, 88 insertions, 89 deletions
diff --git a/src/lib/libcrypto/man/CMS_get0_RecipientInfos.3 b/src/lib/libcrypto/man/CMS_get0_RecipientInfos.3
index 6bf506dfbe..fc62d3a08b 100644
--- a/src/lib/libcrypto/man/CMS_get0_RecipientInfos.3
+++ b/src/lib/libcrypto/man/CMS_get0_RecipientInfos.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: CMS_get0_RecipientInfos.3,v 1.4 2019/08/11 12:46:38 schwarze Exp $ 1.\" $OpenBSD: CMS_get0_RecipientInfos.3,v 1.5 2019/08/17 14:41:01 schwarze Exp $
2.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100 2.\" full merge up to: OpenSSL e9b77246 Jan 20 19:58:49 2017 +0100
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
@@ -48,7 +48,7 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: August 11 2019 $ 51.Dd $Mdocdate: August 17 2019 $
52.Dt CMS_GET0_RECIPIENTINFOS 3 52.Dt CMS_GET0_RECIPIENTINFOS 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
@@ -62,7 +62,7 @@
62.Nm CMS_RecipientInfo_set0_key , 62.Nm CMS_RecipientInfo_set0_key ,
63.Nm CMS_RecipientInfo_decrypt , 63.Nm CMS_RecipientInfo_decrypt ,
64.Nm CMS_RecipientInfo_encrypt 64.Nm CMS_RecipientInfo_encrypt
65.Nd CMS envelopedData RecipientInfo routines 65.Nd CMS EnvelopedData RecipientInfo routines
66.Sh SYNOPSIS 66.Sh SYNOPSIS
67.In openssl/cms.h 67.In openssl/cms.h
68.Ft STACK_OF(CMS_RecipientInfo) * 68.Ft STACK_OF(CMS_RecipientInfo) *
@@ -83,7 +83,7 @@
83.Ft int 83.Ft int
84.Fo CMS_RecipientInfo_ktri_cert_cmp 84.Fo CMS_RecipientInfo_ktri_cert_cmp
85.Fa "CMS_RecipientInfo *ri" 85.Fa "CMS_RecipientInfo *ri"
86.Fa "X509 *cert" 86.Fa "X509 *certificate"
87.Fc 87.Fc
88.Ft int 88.Ft int
89.Fo CMS_RecipientInfo_set0_pkey 89.Fo CMS_RecipientInfo_set0_pkey
@@ -122,138 +122,120 @@
122.Fa "CMS_RecipientInfo *ri" 122.Fa "CMS_RecipientInfo *ri"
123.Fc 123.Fc
124.Sh DESCRIPTION 124.Sh DESCRIPTION
125The function
126.Fn CMS_get0_RecipientInfos 125.Fn CMS_get0_RecipientInfos
127returns all the 126returns all the
128.Vt CMS_RecipientInfo 127.Vt RecipientInfo
129structures associated with a CMS EnvelopedData structure. 128structures associated with the
129.Vt EnvelopedData
130structure
131.Fa cms .
130.Pp 132.Pp
131.Fn CMS_RecipientInfo_type 133.Fn CMS_RecipientInfo_type
132returns the type of the 134returns the type of
133.Vt CMS_RecipientInfo 135.Fa ri :
134structure 136.Bl -column CMS_RECIPINFO_TRANS for -compact
135.Fa ri . 137.It Dv CMS_RECIPINFO_TRANS Ta for Ta Vt KeyTransRecipientInfo ,
136It will currently return 138.It Dv CMS_RECIPINFO_AGREE Ta for Ta Vt KeyAgreeRecipientInfo ,
137.Dv CMS_RECIPINFO_TRANS , 139.It Dv CMS_RECIPINFO_KEK Ta for Ta Vt KEKRecipientInfo ,
138.Dv CMS_RECIPINFO_AGREE , 140.It Dv CMS_RECIPINFO_PASS Ta for Ta Vt PasswordRecipientinfo , No or
139.Dv CMS_RECIPINFO_KEK , 141.It Dv CMS_RECIPINFO_OTHER Ta for Ta Vt OtherRecipientInfo .
140.Dv CMS_RECIPINFO_PASS , 142.El
141or
142.Dv CMS_RECIPINFO_OTHER .
143.Pp 143.Pp
144.Fn CMS_RecipientInfo_ktri_get0_signer_id 144.Fn CMS_RecipientInfo_ktri_get0_signer_id
145retrieves the certificate recipient identifier associated with a 145retrieves the certificate
146specific 146.Vt RecipientIdentifier
147.Vt CMS_RecipientInfo 147associated with the
148.Vt KeyTransRecipientInfo
148structure 149structure
149.Fa ri , 150.Fa ri .
150which must be of type 151Either the
151.Dv CMS_RECIPINFO_TRANS . 152.Vt SubjectKeyIdentifier
152Either the keyidentifier will be set in 153will be set in
153.Fa keyid 154.Fa keyid
154or 155or both issuer name and serial number in
155.Em both
156issuer name and serial number in
157.Fa issuer 156.Fa issuer
158and 157and
159.Fa sno . 158.Fa sno .
160.Pp 159.Pp
161.Fn CMS_RecipientInfo_ktri_cert_cmp 160.Fn CMS_RecipientInfo_ktri_cert_cmp
162compares the certificate 161compares the
163.Fa cert 162.Fa certificate
164against the 163against the
165.Vt CMS_RecipientInfo 164.Vt KeyTransRecipientInfo
166structure 165structure
167.Fa ri , 166.Fa ri .
168which must be of type
169.Dv CMS_RECIPINFO_TRANS .
170It returns zero if the comparison is successful or non-zero if not.
171.Pp 167.Pp
172.Fn CMS_RecipientInfo_set0_pkey 168.Fn CMS_RecipientInfo_set0_pkey
173associates the private key 169associates the private key
174.Fa pkey 170.Fa pkey
175with the 171with the
176.Vt CMS_RecipientInfo 172.Vt KeyTransRecipientInfo
177structure 173structure
178.Fa ri , 174.Fa ri .
179which must be of type
180.Dv CMS_RECIPINFO_TRANS .
181.Pp 175.Pp
182.Fn CMS_RecipientInfo_kekri_get0_id 176.Fn CMS_RecipientInfo_kekri_get0_id
183retrieves the key information from the 177retrieves the key information from the
184.Vt CMS_RecipientInfo 178.Vt KEKRecipientInfo
185structure 179structure
186.Fa ri 180.Fa ri .
187which must be of type 181Fields are copied out as follows:
188.Dv CMS_RECIPINFO_KEK . 182.Bl -column keyEncryptionAlgorithm to -compact
189Any of the remaining parameters can be 183.It Fa keyEncryptionAlgorithm Ta to Ta Pf * Fa palg ,
190.Dv NULL 184.It Fa keyIdentifier Ta to Ta Pf * Fa pid ,
191if the application is not interested in the value of a field. 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
192Where a field is optional and absent, 189Where a field is optional and absent,
193.Dv NULL 190.Dv NULL
194will be written to the corresponding parameter. 191is written to the corresponding parameter.
195The keyEncryptionAlgorithm field is written to 192Parameters the application is not interested in can be set to
196.Fa palg , 193.Dv NULL .
197the keyIdentifier field is written to
198.Fa pid ,
199the
200.Sy date
201field if present is written to
202.Fa pdate .
203If the
204.Sy other
205field is present the components
206.Sy keyAttrId
207and
208.Sy keyAttr
209are written to the parameters
210.Fa potherid
211and
212.Fa pothertype .
213.Pp 194.Pp
214.Fn CMS_RecipientInfo_kekri_id_cmp 195.Fn CMS_RecipientInfo_kekri_id_cmp
215compares the ID in the 196compares the identifier in the
216.Fa id 197.Fa id
217and 198and
218.Fa idlen 199.Fa idlen
219parameters against the keyIdentifier 200parameters against the
220.Vt CMS_RecipientInfo 201.Fa keyIdentifier
202field of the
203.Vt KEKRecipientInfo
221structure 204structure
222.Fa ri , 205.Fa ri .
223which must be of type
224.Dv CMS_RECIPINFO_KEK .
225It returns zero if the comparison is successful or non-zero if not.
226.Pp 206.Pp
227.Fn CMS_RecipientInfo_set0_key 207.Fn CMS_RecipientInfo_set0_key
228associates the symmetric key 208associates the symmetric
229.Fa key 209.Fa key
230of length 210of length
231.Fa keylen 211.Fa keylen
232with the 212with the
233.Vt CMS_RecipientInfo 213.Vt KEKRecipientInfo
234structure 214structure
235.Fa ri , 215.Fa ri .
236which must be of type
237.Dv CMS_RECIPINFO_KEK .
238.Pp 216.Pp
239.Fn CMS_RecipientInfo_decrypt 217.Fn CMS_RecipientInfo_decrypt
240attempts to decrypt the 218attempts to decrypt the
241.Vt CMS_RecipientInfo 219.Vt RecipientInfo
242structure 220structure
243.Fa ri 221.Fa ri
244in structure 222in
245.Fa cms . 223.Fa cms .
246A key must have been associated with the structure first. 224A key must have been associated with
225.Fa ri
226first.
247.Pp 227.Pp
248.Fn CMS_RecipientInfo_encrypt 228.Fn CMS_RecipientInfo_encrypt
249attempts to encrypt the 229attempts to encrypt the
250.Vt CMS_RecipientInfo 230.Vt RecipientInfo
251structure 231structure
252.Fa ri 232.Fa ri
253in structure 233in
254.Fa cms . 234.Fa cms .
255A key must have been associated with the structure first and the content 235A key must have been associated with
256encryption key must be available: for example by a previous call to 236.Fa ri
237first and the content encryption key must be available,
238for example by a previous call to
257.Fn CMS_RecipientInfo_decrypt . 239.Fn CMS_RecipientInfo_decrypt .
258.Pp 240.Pp
259The main purpose of these functions is to enable an application to 241The main purpose of these functions is to enable an application to
@@ -262,11 +244,11 @@ method of
262.Xr CMS_decrypt 3 244.Xr CMS_decrypt 3
263is not appropriate. 245is not appropriate.
264.Pp 246.Pp
265In typical usage, an application will retrieve all 247In typical usage, an application retrieves all
266.Vt CMS_RecipientInfo 248.Vt CMS_RecipientInfo
267structures using 249structures using
268.Fn CMS_get0_RecipientInfos 250.Fn CMS_get0_RecipientInfos
269and check the type of each using 251and checks the type of each using
270.Fn CMS_RecipientInfo_type . 252.Fn CMS_RecipientInfo_type .
271Depending on the type, the 253Depending on the type, the
272.Vt CMS_RecipientInfo 254.Vt CMS_RecipientInfo
@@ -289,18 +271,21 @@ structure.
289Typically an application will first decrypt an appropriate 271Typically an application will first decrypt an appropriate
290.Vt CMS_RecipientInfo 272.Vt CMS_RecipientInfo
291structure to make the content encrypt key available. 273structure to make the content encrypt key available.
292Ot will then add a new recipient using a function such as 274It will then add a new recipient using a function such as
293.Xr CMS_add1_recipient_cert 3 275.Xr CMS_add1_recipient_cert 3
294and finally encrypt the content encryption key using 276and finally encrypt the content encryption key using
295.Fn CMS_RecipientInfo_encrypt . 277.Fn CMS_RecipientInfo_encrypt .
296.Sh RETURN VALUES 278.Sh RETURN VALUES
297.Fn CMS_get0_RecipientInfos 279.Fn CMS_get0_RecipientInfos
298returns all 280returns an internal pointer to all the
299.Vt CMS_RecipientInfo 281.Vt CMS_RecipientInfo
300structures, or 282structures, or
301.Dv NULL 283.Dv NULL
302if an error occurs. 284if an error occurs.
303.Pp 285.Pp
286.Fn CMS_RecipientInfo_type
287returns an integer constant.
288.Pp
304.Fn CMS_RecipientInfo_ktri_get0_signer_id , 289.Fn CMS_RecipientInfo_ktri_get0_signer_id ,
305.Fn CMS_RecipientInfo_set0_pkey , 290.Fn CMS_RecipientInfo_set0_pkey ,
306.Fn CMS_RecipientInfo_kekri_get0_id , 291.Fn CMS_RecipientInfo_kekri_get0_id ,
@@ -313,12 +298,26 @@ return 1 for success or 0 if an error occurs.
313.Fn CMS_RecipientInfo_ktri_cert_cmp 298.Fn CMS_RecipientInfo_ktri_cert_cmp
314and 299and
315.Fn CMS_RecipientInfo_kekri_id_cmp 300.Fn CMS_RecipientInfo_kekri_id_cmp
316return 0 for a successful comparison or non-zero otherwise. 301return 0 when
302.Fa ri
303matches or non-zero otherwise.
317.Pp 304.Pp
318Any error can be obtained from 305Any error can be obtained from
319.Xr ERR_get_error 3 . 306.Xr ERR_get_error 3 .
320.Sh SEE ALSO 307.Sh SEE ALSO
321.Xr CMS_decrypt 3 308.Xr CMS_decrypt 3
309.Sh STANDARDS
310RFC 5652 Cryptographic Message Syntax (CMS):
311.Bl -dash -compact -offset indent
312.It
313section 6.1: EnvelopedData Type
314.It
315section 6.2: RecipientInfo Type
316.It
317section 6.2.1: KeyTransRecipientInfo Type
318.It
319section 6.2.3: KEKRecipientInfo Type
320.El
322.Sh HISTORY 321.Sh HISTORY
323These functions first appeared in OpenSSL 0.9.8h, 322These functions first appeared in OpenSSL 0.9.8h,
324except that 323except that