summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/SMIME_read_PKCS7.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/SMIME_read_PKCS7.3')
-rw-r--r--src/lib/libcrypto/man/SMIME_read_PKCS7.3101
1 files changed, 101 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/SMIME_read_PKCS7.3 b/src/lib/libcrypto/man/SMIME_read_PKCS7.3
new file mode 100644
index 0000000000..2e7fcb514c
--- /dev/null
+++ b/src/lib/libcrypto/man/SMIME_read_PKCS7.3
@@ -0,0 +1,101 @@
1.Dd $Mdocdate: November 3 2016 $
2.Dt SMIME_READ_PKCS7 3
3.Os
4.Sh NAME
5.Nm SMIME_read_PKCS7
6.Nd parse S/MIME message
7.Sh SYNOPSIS
8.In openssl/pkcs7.h
9.Ft PKCS7 *
10.Fo SMIME_read_PKCS7
11.Fa "BIO *in"
12.Fa "BIO **bcont"
13.Fc
14.Sh DESCRIPTION
15.Fn SMIME_read_PKCS7
16parses a message in S/MIME format.
17.Pp
18.Fa in
19is a
20.Vt BIO
21to read the message from.
22.Pp
23If cleartext signing is used, then the content is saved in a memory
24.Vt BIO
25which is written to
26.Pf * Fa bcont ,
27otherwise
28.Pf * Fa bcont
29is set to
30.Dv NULL .
31.Pp
32The parsed PKCS#7 structure is returned, or
33.Dv NULL
34if an error occurred.
35.Pp
36If
37.Pf * Fa bcont
38is not
39.Dv NULL ,
40then the message is clear text signed.
41.Pf * Fa bcont
42can then be passed to
43.Xr PKCS7_verify 3
44with the
45.Dv PKCS7_DETACHED
46flag set.
47.Pp
48Otherwise the type of the returned structure can be determined using
49.Xr PKCS7_type 3 .
50.Pp
51To support future functionality, if
52.Fa bcont
53is not
54.Dv NULL ,
55.Pf * Fa bcont
56should be initialized to
57.Dv NULL .
58For example:
59.Bd -literal -offset indent
60BIO *cont = NULL;
61PKCS7 *p7;
62
63p7 = SMIME_read_PKCS7(in, &cont);
64.Ed
65.Sh RETURN VALUES
66.Fn SMIME_read_PKCS7
67returns a valid
68.Vt PKCS7
69structure or
70.Dv NULL
71if an error occurred.
72The error can be obtained from
73.Xr ERR_get_error 3 .
74.Sh SEE ALSO
75.Xr ERR_get_error 3 ,
76.Xr PKCS7_decrypt 3 ,
77.Xr PKCS7_encrypt 3 ,
78.Xr PKCS7_sign 3 ,
79.Xr PKCS7_type 3 ,
80.Xr PKCS7_verify 3 ,
81.Xr SMIME_read_PKCS7 3
82.Sh HISTORY
83.Fn SMIME_read_PKCS7
84was added to OpenSSL 0.9.5.
85.Sh BUGS
86The MIME parser used by
87.Fn SMIME_read_PKCS7
88is somewhat primitive.
89While it will handle most S/MIME messages, more complex compound
90formats may not work.
91.Pp
92The parser assumes that the
93.Vt PKCS7
94structure is always base64 encoded, and it will not handle the case
95where it is in binary format or uses quoted printable format.
96.Pp
97The use of a memory
98.Vt BIO
99to hold the signed content limits the size of the message which can
100be processed due to memory restraints: a streaming single pass
101option should be available.