diff options
Diffstat (limited to 'src/lib/libcrypto/man/SMIME_write_PKCS7.3')
-rw-r--r-- | src/lib/libcrypto/man/SMIME_write_PKCS7.3 | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/SMIME_write_PKCS7.3 b/src/lib/libcrypto/man/SMIME_write_PKCS7.3 new file mode 100644 index 0000000000..f4f465e2e4 --- /dev/null +++ b/src/lib/libcrypto/man/SMIME_write_PKCS7.3 | |||
@@ -0,0 +1,93 @@ | |||
1 | .Dd $Mdocdate: November 3 2016 $ | ||
2 | .Dt SMIME_WRITE_PKCS7 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm SMIME_write_PKCS7 | ||
6 | .Nd convert PKCS#7 structure to S/MIME format | ||
7 | .Sh SYNOPSIS | ||
8 | .In openssl/pkcs7.h | ||
9 | .Ft int | ||
10 | .Fo SMIME_write_PKCS7 | ||
11 | .Fa "BIO *out" | ||
12 | .Fa "PKCS7 *p7" | ||
13 | .Fa "BIO *data" | ||
14 | .Fa "int flags" | ||
15 | .Fc | ||
16 | .Sh DESCRIPTION | ||
17 | .Fn SMIME_write_PKCS7 | ||
18 | adds the appropriate MIME headers to a PKCS#7 structure to produce an | ||
19 | S/MIME message. | ||
20 | .Pp | ||
21 | .Fa out | ||
22 | is the | ||
23 | .Vt BIO | ||
24 | to write the data to. | ||
25 | .Fa p7 | ||
26 | is the appropriate | ||
27 | .Vt PKCS7 | ||
28 | structure. | ||
29 | If streaming is enabled, then the content must be supplied in the | ||
30 | .Fa data | ||
31 | argument. | ||
32 | .Fa flags | ||
33 | is an optional set of flags. | ||
34 | .Pp | ||
35 | The following flags can be passed in the | ||
36 | .Fa flags | ||
37 | parameter. | ||
38 | .Pp | ||
39 | If | ||
40 | .Dv PKCS7_DETACHED | ||
41 | is set, then cleartext signing will be used. | ||
42 | This option only makes sense for signedData where | ||
43 | .Dv PKCS7_DETACHED | ||
44 | is also set when | ||
45 | .Xr PKCS7_sign 3 | ||
46 | is also called. | ||
47 | .Pp | ||
48 | If the | ||
49 | .Dv PKCS7_TEXT | ||
50 | flag is set, MIME headers for type | ||
51 | .Sy text/plain | ||
52 | are added to the content. | ||
53 | This only makes sense if | ||
54 | .Dv PKCS7_DETACHED | ||
55 | is also set. | ||
56 | .Pp | ||
57 | If the | ||
58 | .Dv PKCS7_STREAM | ||
59 | flag is set, streaming is performed. | ||
60 | This flag should only be set if | ||
61 | .Dv PKCS7_STREAM | ||
62 | was also set in the previous call to | ||
63 | .Xr PKCS7_sign 3 | ||
64 | or | ||
65 | .Xr PKCS7_encrypt 3 . | ||
66 | .Pp | ||
67 | If cleartext signing is being used and | ||
68 | .Dv PKCS7_STREAM | ||
69 | is not set, then the data must be read twice: once to compute the | ||
70 | signature in | ||
71 | .Xr PKCS7_sign 3 | ||
72 | and once to output the S/MIME message. | ||
73 | .Pp | ||
74 | If streaming is performed, the content is output in BER format using | ||
75 | indefinite length constructed encoding except in the case of signed | ||
76 | data with detached content where the content is absent and DER | ||
77 | format is used. | ||
78 | .Sh RETURN VALUES | ||
79 | .Fn SMIME_write_PKCS7 | ||
80 | returns 1 for success or 0 for failure. | ||
81 | .Sh SEE ALSO | ||
82 | .Xr ERR_get_error 3 , | ||
83 | .Xr PKCS7_decrypt 3 , | ||
84 | .Xr PKCS7_encrypt 3 , | ||
85 | .Xr PKCS7_sign 3 , | ||
86 | .Xr PKCS7_verify 3 | ||
87 | .Sh HISTORY | ||
88 | .Fn SMIME_write_PKCS7 | ||
89 | was added to OpenSSL 0.9.5. | ||
90 | .Sh BUGS | ||
91 | .Fn SMIME_write_PKCS7 | ||
92 | always base64 encodes PKCS#7 structures. | ||
93 | There should be an option to disable this. | ||