summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/man/Makefile3
-rw-r--r--src/lib/libcrypto/man/PKCS7_new.3245
2 files changed, 247 insertions, 1 deletions
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index 300051f921..2c70b7ec37 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.75 2016/12/12 22:48:02 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.76 2016/12/13 14:31:55 schwarze Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -145,6 +145,7 @@ MAN= \
145 PKCS5_PBKDF2_HMAC.3 \ 145 PKCS5_PBKDF2_HMAC.3 \
146 PKCS7_decrypt.3 \ 146 PKCS7_decrypt.3 \
147 PKCS7_encrypt.3 \ 147 PKCS7_encrypt.3 \
148 PKCS7_new.3 \
148 PKCS7_sign.3 \ 149 PKCS7_sign.3 \
149 PKCS7_sign_add_signer.3 \ 150 PKCS7_sign_add_signer.3 \
150 PKCS7_verify.3 \ 151 PKCS7_verify.3 \
diff --git a/src/lib/libcrypto/man/PKCS7_new.3 b/src/lib/libcrypto/man/PKCS7_new.3
new file mode 100644
index 0000000000..9feecbb88b
--- /dev/null
+++ b/src/lib/libcrypto/man/PKCS7_new.3
@@ -0,0 +1,245 @@
1.\" $OpenBSD: PKCS7_new.3,v 1.1 2016/12/13 14:31:55 schwarze Exp $
2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4.\"
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.
8.\"
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.
16.\"
17.Dd $Mdocdate: December 13 2016 $
18.Dt PKCS7_NEW 3
19.Os
20.Sh NAME
21.Nm PKCS7_new ,
22.Nm PKCS7_free ,
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
42.Sh SYNOPSIS
43.In openssl/pkcs7.h
44.Ft PKCS7 *
45.Fn PKCS7_new void
46.Ft void
47.Fn PKCS7_free "PKCS7 *p7"
48.Ft PKCS7_SIGNED *
49.Fn PKCS7_SIGNED_new void
50.Ft void
51.Fn PKCS7_SIGNED_free "PKCS7_SIGNED *signed"
52.Ft PKCS7_ENVELOPE *
53.Fn PKCS7_ENVELOPE_new void
54.Ft void
55.Fn PKCS7_ENVELOPE_free "PKCS7_ENVELOPE *envelope"
56.Ft PKCS7_SIGN_ENVELOPE *
57.Fn PKCS7_SIGN_ENVELOPE_new void
58.Ft void
59.Fn PKCS7_SIGN_ENVELOPE_free "PKCS7_SIGN_ENVELOPE *signed_envelope"
60.Ft PKCS7_DIGEST *
61.Fn PKCS7_DIGEST_new void
62.Ft void
63.Fn PKCS7_DIGEST_free "PKCS7_DIGEST *digested"
64.Ft PKCS7_ENCRYPT *
65.Fn PKCS7_ENCRYPT_new void
66.Ft void
67.Fn PKCS7_ENCRYPT_free "PKCS7_ENCRYPT *encrypted"
68.Ft PKCS7_ENC_CONTENT *
69.Fn PKCS7_ENC_CONTENT_new void
70.Ft void
71.Fn PKCS7_ENC_CONTENT_free "PKCS7_ENC_CONTENT *content"
72.Ft PKCS7_SIGNER_INFO *
73.Fn PKCS7_SIGNER_INFO_new void
74.Ft void
75.Fn PKCS7_SIGNER_INFO_free "PKCS7_SIGNER_INFO *signer"
76.Ft PKCS7_RECIP_INFO *
77.Fn PKCS7_RECIP_INFO_new void
78.Ft 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
82.Ft void
83.Fn PKCS7_ISSUER_AND_SERIAL_free "PKCS7_ISSUER_AND_SERIAL *cert"
84.Sh DESCRIPTION
85PKCS#7 is an ASN.1-based format for transmitting data that has
86cryptography applied to it, in particular signed and encrypted data.
87.Pp
88.Fn PKCS7_new
89allocates and initializes an empty
90.Vt PKCS7
91object, representing an ASN.1 ContentInfo structure
92defined in RFC 2315 section 7.
93It is the top-level data structure able to hold any kind of content
94that can be transmitted using PKCS#7.
95It can be used recursively in
96.Vt PKCS7_SIGNED
97and
98.Vt PKCS7_DIGEST
99objects.
100.Fn PKCS7_free
101frees
102.Fa p7 .
103.Pp
104.Fn PKCS7_SIGNED_new
105allocates and initializes an empty
106.Vt PKCS7_SIGNED
107object, representing an ASN.1 SignedData structure
108defined in RFC 2315 section 9.
109It can be used inside
110.Vt PKCS7
111objects and holds any kind of content together with signatures by
112zero or more signers and information about the signing algorithm
113and certificates used.
114.Fn PKCS7_SIGNED_free
115frees
116.Fa signed .
117.Pp
118.Fn PKCS7_ENVELOPE_new
119allocates and initializes an empty
120.Vt PKCS7_ENVELOPE
121object, representing an ASN.1 EnvelopedData structure
122defined in RFC 2315 section 10.
123It can be used inside
124.Vt PKCS7
125objects and holds any kind of encrypted content together with
126content-encryption keys for one or more recipients.
127.Fn PKCS7_ENVELOPE_free
128frees
129.Fa envelope .
130.Pp
131.Fn PKCS7_SIGN_ENVELOPE_new
132allocates and initializes an empty
133.Vt PKCS7_SIGN_ENVELOPE
134object, representing an ASN.1 SignedAndEnvelopedData structure
135defined in RFC 2315 section 11.
136It can be used inside
137.Vt PKCS7
138objects and holds any kind of encrypted content together with
139signatures by one or more signers, information about the signing
140algorithm and certificates used, and content-encryption keys for
141one or more recipients.
142.Fn PKCS7_SIGN_ENVELOPE_free
143frees
144.Fa signed_envelope .
145.Pp
146.Fn PKCS7_DIGEST_new
147allocates and initializes an empty
148.Vt PKCS7_DIGEST
149object, representing an ASN.1 DigestedData structure
150defined in RFC 2315 section 12.
151It can be used inside
152.Vt PKCS7
153objects and holds any kind of content together with a message digest
154for checking its integrity and information about the algorithm used.
155.Fn PKCS7_DIGEST_free
156frees
157.Fa digested .
158.Pp
159.Fn PKCS7_ENCRYPT_new
160allocates and initializes an empty
161.Vt PKCS7_ENCRYPT
162object, representing an ASN.1 EncryptedData structure
163defined in RFC 2315 section 13.
164It can be used inside
165.Vt PKCS7
166objects and holds any kind of encrypted content.
167Keys are not included and need to be communicated separately.
168.Fn PKCS7_ENCRYPT_free
169frees
170.Fa encrypted .
171.Pp
172.Fn PKCS7_ENC_CONTENT_new
173allocates and initializes an empty
174.Vt PKCS7_ENC_CONTENT
175object, representing an ASN.1 EncryptedContentInfo structure
176defined in RFC 2315 section 10.1.
177It can be used inside
178.Vt PKCS7_ENVELOPE ,
179.Vt PKCS7_SIGN_ENVELOPE ,
180and
181.Vt PKCS7_ENCRYPT
182objects and holds encrypted content together with information about
183the encryption algorithm used.
184.Fn PKCS7_ENC_CONTENT_free
185frees
186.Fa content .
187.Pp
188.Fn PKCS7_SIGNER_INFO_new
189allocates and initializes an empty
190.Vt PKCS7_SIGNER_INFO
191object, representing an ASN.1 SignerInfo structure
192defined in RFC 2315 section 9.2.
193It can be used inside
194.Vt PKCS7_SIGNED
195and
196.Vt PKCS7_SIGN_ENVELOPE
197objects and holds a signature together with information about the
198signer and the algorithms used.
199.Fn PKCS7_SIGNER_INFO_free
200frees
201.Fa signer .
202.Pp
203.Fn PKCS7_RECIP_INFO_new
204allocates and initializes an empty
205.Vt PKCS7_RECIP_INFO
206object, representing an ASN.1 RecipientInfo structure
207defined in RFC 2315 section 10.2.
208It can be used inside
209.Vt PKCS7_ENVELOPE
210and
211.Vt PKCS7_SIGN_ENVELOPE
212objects and holds a content-encryption key together with information
213about the intended recipient and the key encryption algorithm used.
214.Fn PKCS7_RECIP_INFO_free
215frees
216.Fa recip .
217.Pp
218.Fn PKCS7_ISSUER_AND_SERIAL_new
219allocates and initializes an empty
220.Vt PKCS7_ISSUER_AND_SERIAL
221object, representing an ASN.1 IssuerAndSerialNumber structure
222defined in RFC 2315 section 6.7.
223It can be used inside
224.Vt PKCS7_SIGNER_INFO
225and
226.Vt PKCS7_RECIP_INFO
227objects and identifies a certificate by holding the distinguished
228name of the certificate issuer and an issuer-specific certificate
229serial number.
230.Fn PKCS7_ISSUER_AND_SERIAL_free
231frees
232.Fa cert .
233.Sh SEE ALSO
234.Xr i2d_PKCS7_bio_stream 3 ,
235.Xr PEM_read_PKCS7 3 ,
236.Xr PEM_write_bio_PKCS7_stream 3 ,
237.Xr PKCS7_decrypt 3 ,
238.Xr PKCS7_encrypt 3 ,
239.Xr PKCS7_sign 3 ,
240.Xr PKCS7_sign_add_signer 3 ,
241.Xr PKCS7_verify 3 ,
242.Xr SMIME_read_PKCS7 3 ,
243.Xr SMIME_write_PKCS7 3
244.Sh STANDARDS
245RFC 2315: PKCS #7: Cryptographic Message Syntax Version 1.5