1 .\" $OpenBSD: PKCS7_new.3,v 1.2 2016/12/25 22:15:10 schwarze Exp $
3 .\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .Dd $Mdocdate: December 25 2016 $
23 .Nm PKCS7_SIGNED_new ,
24 .Nm PKCS7_SIGNED_free ,
25 .Nm PKCS7_ENVELOPE_new ,
26 .Nm PKCS7_ENVELOPE_free ,
27 .Nm PKCS7_SIGN_ENVELOPE_new ,
28 .Nm PKCS7_SIGN_ENVELOPE_free ,
29 .Nm PKCS7_DIGEST_new ,
30 .Nm PKCS7_DIGEST_free ,
31 .Nm PKCS7_ENCRYPT_new ,
32 .Nm PKCS7_ENCRYPT_free ,
33 .Nm PKCS7_ENC_CONTENT_new ,
34 .Nm PKCS7_ENC_CONTENT_free ,
35 .Nm PKCS7_SIGNER_INFO_new ,
36 .Nm PKCS7_SIGNER_INFO_free ,
37 .Nm PKCS7_RECIP_INFO_new ,
38 .Nm PKCS7_RECIP_INFO_free ,
39 .Nm PKCS7_ISSUER_AND_SERIAL_new ,
40 .Nm PKCS7_ISSUER_AND_SERIAL_free
41 .Nd PKCS#7 data structures
47 .Fn PKCS7_free "PKCS7 *p7"
49 .Fn PKCS7_SIGNED_new void
51 .Fn PKCS7_SIGNED_free "PKCS7_SIGNED *signed"
53 .Fn PKCS7_ENVELOPE_new void
55 .Fn PKCS7_ENVELOPE_free "PKCS7_ENVELOPE *envelope"
56 .Ft PKCS7_SIGN_ENVELOPE *
57 .Fn PKCS7_SIGN_ENVELOPE_new void
59 .Fn PKCS7_SIGN_ENVELOPE_free "PKCS7_SIGN_ENVELOPE *signed_envelope"
61 .Fn PKCS7_DIGEST_new void
63 .Fn PKCS7_DIGEST_free "PKCS7_DIGEST *digested"
65 .Fn PKCS7_ENCRYPT_new void
67 .Fn PKCS7_ENCRYPT_free "PKCS7_ENCRYPT *encrypted"
68 .Ft PKCS7_ENC_CONTENT *
69 .Fn PKCS7_ENC_CONTENT_new void
71 .Fn PKCS7_ENC_CONTENT_free "PKCS7_ENC_CONTENT *content"
72 .Ft PKCS7_SIGNER_INFO *
73 .Fn PKCS7_SIGNER_INFO_new void
75 .Fn PKCS7_SIGNER_INFO_free "PKCS7_SIGNER_INFO *signer"
76 .Ft PKCS7_RECIP_INFO *
77 .Fn PKCS7_RECIP_INFO_new void
79 .Fn PKCS7_RECIP_INFO_free "PKCS7_RECIP_INFO *recip"
80 .Ft PKCS7_ISSUER_AND_SERIAL *
81 .Fn PKCS7_ISSUER_AND_SERIAL_new void
83 .Fn PKCS7_ISSUER_AND_SERIAL_free "PKCS7_ISSUER_AND_SERIAL *cert"
85 PKCS#7 is an ASN.1-based format for transmitting data that has
86 cryptography applied to it, in particular signed and encrypted data.
89 allocates and initializes an empty
91 object, representing an ASN.1
93 structure defined in RFC 2315 section 7.
94 It is the top-level data structure able to hold any kind of content
95 that can be transmitted using PKCS#7.
96 It can be used recursively in
106 allocates and initializes an empty
108 object, representing an ASN.1
110 structure defined in RFC 2315 section 9.
111 It can be used inside
113 objects and holds any kind of content together with signatures by
114 zero or more signers and information about the signing algorithm
115 and certificates used.
116 .Fn PKCS7_SIGNED_free
120 .Fn PKCS7_ENVELOPE_new
121 allocates and initializes an empty
123 object, representing an ASN.1
125 structure defined in RFC 2315 section 10.
126 It can be used inside
128 objects and holds any kind of encrypted content together with
129 content-encryption keys for one or more recipients.
130 .Fn PKCS7_ENVELOPE_free
134 .Fn PKCS7_SIGN_ENVELOPE_new
135 allocates and initializes an empty
136 .Vt PKCS7_SIGN_ENVELOPE
137 object, representing an ASN.1
138 .Vt SignedAndEnvelopedData
139 structure defined in RFC 2315 section 11.
140 It can be used inside
142 objects and holds any kind of encrypted content together with
143 signatures by one or more signers, information about the signing
144 algorithm and certificates used, and content-encryption keys for
145 one or more recipients.
146 .Fn PKCS7_SIGN_ENVELOPE_free
148 .Fa signed_envelope .
151 allocates and initializes an empty
153 object, representing an ASN.1
155 structure defined in RFC 2315 section 12.
156 It can be used inside
158 objects and holds any kind of content together with a message digest
159 for checking its integrity and information about the algorithm used.
160 .Fn PKCS7_DIGEST_free
164 .Fn PKCS7_ENCRYPT_new
165 allocates and initializes an empty
167 object, representing an ASN.1
169 structure defined in RFC 2315 section 13.
170 It can be used inside
172 objects and holds any kind of encrypted content.
173 Keys are not included and need to be communicated separately.
174 .Fn PKCS7_ENCRYPT_free
178 .Fn PKCS7_ENC_CONTENT_new
179 allocates and initializes an empty
180 .Vt PKCS7_ENC_CONTENT
181 object, representing an ASN.1
182 .Vt EncryptedContentInfo
183 structure defined in RFC 2315 section 10.1.
184 It can be used inside
186 .Vt PKCS7_SIGN_ENVELOPE ,
189 objects and holds encrypted content together with information about
190 the encryption algorithm used.
191 .Fn PKCS7_ENC_CONTENT_free
195 .Fn PKCS7_SIGNER_INFO_new
196 allocates and initializes an empty
197 .Vt PKCS7_SIGNER_INFO
198 object, representing an ASN.1
200 structure defined in RFC 2315 section 9.2.
201 It can be used inside
204 .Vt PKCS7_SIGN_ENVELOPE
205 objects and holds a signature together with information about the
206 signer and the algorithms used.
207 .Fn PKCS7_SIGNER_INFO_free
211 .Fn PKCS7_RECIP_INFO_new
212 allocates and initializes an empty
214 object, representing an ASN.1
216 structure defined in RFC 2315 section 10.2.
217 It can be used inside
220 .Vt PKCS7_SIGN_ENVELOPE
221 objects and holds a content-encryption key together with information
222 about the intended recipient and the key encryption algorithm used.
223 .Fn PKCS7_RECIP_INFO_free
227 .Fn PKCS7_ISSUER_AND_SERIAL_new
228 allocates and initializes an empty
229 .Vt PKCS7_ISSUER_AND_SERIAL
230 object, representing an ASN.1
231 .Vt IssuerAndSerialNumber
232 structure defined in RFC 2315 section 6.7.
233 It can be used inside
234 .Vt PKCS7_SIGNER_INFO
237 objects and identifies a certificate by holding the distinguished
238 name of the certificate issuer and an issuer-specific certificate
240 .Fn PKCS7_ISSUER_AND_SERIAL_free
244 .Xr i2d_PKCS7_bio_stream 3 ,
245 .Xr PEM_read_PKCS7 3 ,
246 .Xr PEM_write_bio_PKCS7_stream 3 ,
247 .Xr PKCS7_decrypt 3 ,
248 .Xr PKCS7_encrypt 3 ,
250 .Xr PKCS7_sign_add_signer 3 ,
252 .Xr SMIME_read_PKCS7 3 ,
253 .Xr SMIME_write_PKCS7 3
255 RFC 2315: PKCS #7: Cryptographic Message Syntax Version 1.5