Merge branch 'vendor/FILE'
[dragonfly.git] / secure / usr.bin / openssl / man / smime.1
1 .\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.14)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 'br\}
42 .\"
43 .\" Escape single quotes in literal strings from groff's Unicode transform.
44 .ie \n(.g .ds Aq \(aq
45 .el       .ds Aq '
46 .\"
47 .\" If the F register is turned on, we'll generate index entries on stderr for
48 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
49 .\" entries marked with X<> in POD.  Of course, you'll have to process the
50 .\" output yourself in some meaningful fashion.
51 .ie \nF \{\
52 .    de IX
53 .    tm Index:\\$1\t\\n%\t"\\$2"
54 ..
55 .    nr % 0
56 .    rr F
57 .\}
58 .el \{\
59 .    de IX
60 ..
61 .\}
62 .\"
63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
65 .    \" fudge factors for nroff and troff
66 .if n \{\
67 .    ds #H 0
68 .    ds #V .8m
69 .    ds #F .3m
70 .    ds #[ \f1
71 .    ds #] \fP
72 .\}
73 .if t \{\
74 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
75 .    ds #V .6m
76 .    ds #F 0
77 .    ds #[ \&
78 .    ds #] \&
79 .\}
80 .    \" simple accents for nroff and troff
81 .if n \{\
82 .    ds ' \&
83 .    ds ` \&
84 .    ds ^ \&
85 .    ds , \&
86 .    ds ~ ~
87 .    ds /
88 .\}
89 .if t \{\
90 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
91 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
92 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
93 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
94 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
95 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
96 .\}
97 .    \" troff and (daisy-wheel) nroff accents
98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
105 .ds ae a\h'-(\w'a'u*4/10)'e
106 .ds Ae A\h'-(\w'A'u*4/10)'E
107 .    \" corrections for vroff
108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
110 .    \" for low resolution devices (crt and lpr)
111 .if \n(.H>23 .if \n(.V>19 \
112 \{\
113 .    ds : e
114 .    ds 8 ss
115 .    ds o a
116 .    ds d- d\h'-1'\(ga
117 .    ds D- D\h'-1'\(hy
118 .    ds th \o'bp'
119 .    ds Th \o'LP'
120 .    ds ae ae
121 .    ds Ae AE
122 .\}
123 .rm #[ #] #H #V #F C
124 .\" ========================================================================
125 .\"
126 .IX Title "SMIME 1"
127 .TH SMIME 1 "2011-09-06" "1.0.0e" "OpenSSL"
128 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
129 .\" way too many mistakes in technical documents.
130 .if n .ad l
131 .nh
132 .SH "NAME"
133 smime \- S/MIME utility
134 .SH "SYNOPSIS"
135 .IX Header "SYNOPSIS"
136 \&\fBopenssl\fR \fBsmime\fR
137 [\fB\-encrypt\fR]
138 [\fB\-decrypt\fR]
139 [\fB\-sign\fR]
140 [\fB\-resign\fR]
141 [\fB\-verify\fR]
142 [\fB\-pk7out\fR]
143 [\fB\-[cipher]\fR]
144 [\fB\-in file\fR]
145 [\fB\-certfile file\fR]
146 [\fB\-signer file\fR]
147 [\fB\-recip  file\fR]
148 [\fB\-inform SMIME|PEM|DER\fR]
149 [\fB\-passin arg\fR]
150 [\fB\-inkey file\fR]
151 [\fB\-out file\fR]
152 [\fB\-outform SMIME|PEM|DER\fR]
153 [\fB\-content file\fR]
154 [\fB\-to addr\fR]
155 [\fB\-from ad\fR]
156 [\fB\-subject s\fR]
157 [\fB\-text\fR]
158 [\fB\-indef\fR]
159 [\fB\-noindef\fR]
160 [\fB\-stream\fR]
161 [\fB\-rand file(s)\fR]
162 [\fB\-md digest\fR]
163 [cert.pem]...
164 .SH "DESCRIPTION"
165 .IX Header "DESCRIPTION"
166 The \fBsmime\fR command handles S/MIME mail. It can encrypt, decrypt, sign and
167 verify S/MIME messages.
168 .SH "COMMAND OPTIONS"
169 .IX Header "COMMAND OPTIONS"
170 There are six operation options that set the type of operation to be performed.
171 The meaning of the other options varies according to the operation type.
172 .IP "\fB\-encrypt\fR" 4
173 .IX Item "-encrypt"
174 encrypt mail for the given recipient certificates. Input file is the message
175 to be encrypted. The output file is the encrypted mail in \s-1MIME\s0 format.
176 .IP "\fB\-decrypt\fR" 4
177 .IX Item "-decrypt"
178 decrypt mail using the supplied certificate and private key. Expects an
179 encrypted mail message in \s-1MIME\s0 format for the input file. The decrypted mail
180 is written to the output file.
181 .IP "\fB\-sign\fR" 4
182 .IX Item "-sign"
183 sign mail using the supplied certificate and private key. Input file is
184 the message to be signed. The signed message in \s-1MIME\s0 format is written
185 to the output file.
186 .IP "\fB\-verify\fR" 4
187 .IX Item "-verify"
188 verify signed mail. Expects a signed mail message on input and outputs
189 the signed data. Both clear text and opaque signing is supported.
190 .IP "\fB\-pk7out\fR" 4
191 .IX Item "-pk7out"
192 takes an input message and writes out a \s-1PEM\s0 encoded PKCS#7 structure.
193 .IP "\fB\-resign\fR" 4
194 .IX Item "-resign"
195 resign a message: take an existing message and one or more new signers.
196 .IP "\fB\-in filename\fR" 4
197 .IX Item "-in filename"
198 the input message to be encrypted or signed or the \s-1MIME\s0 message to
199 be decrypted or verified.
200 .IP "\fB\-inform SMIME|PEM|DER\fR" 4
201 .IX Item "-inform SMIME|PEM|DER"
202 this specifies the input format for the PKCS#7 structure. The default
203 is \fB\s-1SMIME\s0\fR which reads an S/MIME format message. \fB\s-1PEM\s0\fR and \fB\s-1DER\s0\fR
204 format change this to expect \s-1PEM\s0 and \s-1DER\s0 format PKCS#7 structures
205 instead. This currently only affects the input format of the PKCS#7
206 structure, if no PKCS#7 structure is being input (for example with
207 \&\fB\-encrypt\fR or \fB\-sign\fR) this option has no effect.
208 .IP "\fB\-out filename\fR" 4
209 .IX Item "-out filename"
210 the message text that has been decrypted or verified or the output \s-1MIME\s0
211 format message that has been signed or verified.
212 .IP "\fB\-outform SMIME|PEM|DER\fR" 4
213 .IX Item "-outform SMIME|PEM|DER"
214 this specifies the output format for the PKCS#7 structure. The default
215 is \fB\s-1SMIME\s0\fR which write an S/MIME format message. \fB\s-1PEM\s0\fR and \fB\s-1DER\s0\fR
216 format change this to write \s-1PEM\s0 and \s-1DER\s0 format PKCS#7 structures
217 instead. This currently only affects the output format of the PKCS#7
218 structure, if no PKCS#7 structure is being output (for example with
219 \&\fB\-verify\fR or \fB\-decrypt\fR) this option has no effect.
220 .IP "\fB\-stream \-indef \-noindef\fR" 4
221 .IX Item "-stream -indef -noindef"
222 the \fB\-stream\fR and \fB\-indef\fR options are equivalent and enable streaming I/O
223 for encoding operations. This permits single pass processing of data without
224 the need to hold the entire contents in memory, potentially supporting very
225 large files. Streaming is automatically set for S/MIME signing with detached
226 data if the output format is \fB\s-1SMIME\s0\fR it is currently off by default for all
227 other operations.
228 .IP "\fB\-noindef\fR" 4
229 .IX Item "-noindef"
230 disable streaming I/O where it would produce and indefinite length constructed
231 encoding. This option currently has no effect. In future streaming will be
232 enabled by default on all relevant operations and this option will disable it.
233 .IP "\fB\-content filename\fR" 4
234 .IX Item "-content filename"
235 This specifies a file containing the detached content, this is only
236 useful with the \fB\-verify\fR command. This is only usable if the PKCS#7
237 structure is using the detached signature form where the content is
238 not included. This option will override any content if the input format
239 is S/MIME and it uses the multipart/signed \s-1MIME\s0 content type.
240 .IP "\fB\-text\fR" 4
241 .IX Item "-text"
242 this option adds plain text (text/plain) \s-1MIME\s0 headers to the supplied
243 message if encrypting or signing. If decrypting or verifying it strips
244 off text headers: if the decrypted or verified message is not of \s-1MIME\s0 
245 type text/plain then an error occurs.
246 .IP "\fB\-CAfile file\fR" 4
247 .IX Item "-CAfile file"
248 a file containing trusted \s-1CA\s0 certificates, only used with \fB\-verify\fR.
249 .IP "\fB\-CApath dir\fR" 4
250 .IX Item "-CApath dir"
251 a directory containing trusted \s-1CA\s0 certificates, only used with
252 \&\fB\-verify\fR. This directory must be a standard certificate directory: that
253 is a hash of each subject name (using \fBx509 \-hash\fR) should be linked
254 to each certificate.
255 .IP "\fB\-md digest\fR" 4
256 .IX Item "-md digest"
257 digest algorithm to use when signing or resigning. If not present then the
258 default digest algorithm for the signing key will be used (usually \s-1SHA1\s0).
259 .IP "\fB\-[cipher]\fR" 4
260 .IX Item "-[cipher]"
261 the encryption algorithm to use. For example \s-1DES\s0  (56 bits) \- \fB\-des\fR,
262 triple \s-1DES\s0 (168 bits) \- \fB\-des3\fR,
263 \&\fIEVP_get_cipherbyname()\fR function) can also be used preceded by a dash, for 
264 example \fB\-aes_128_cbc\fR. See \fBenc\fR for list of ciphers
265 supported by your version of OpenSSL.
266 .Sp
267 If not specified 40 bit \s-1RC2\s0 is used. Only used with \fB\-encrypt\fR.
268 .IP "\fB\-nointern\fR" 4
269 .IX Item "-nointern"
270 when verifying a message normally certificates (if any) included in
271 the message are searched for the signing certificate. With this option
272 only the certificates specified in the \fB\-certfile\fR option are used.
273 The supplied certificates can still be used as untrusted CAs however.
274 .IP "\fB\-noverify\fR" 4
275 .IX Item "-noverify"
276 do not verify the signers certificate of a signed message.
277 .IP "\fB\-nochain\fR" 4
278 .IX Item "-nochain"
279 do not do chain verification of signers certificates: that is don't
280 use the certificates in the signed message as untrusted CAs.
281 .IP "\fB\-nosigs\fR" 4
282 .IX Item "-nosigs"
283 don't try to verify the signatures on the message.
284 .IP "\fB\-nocerts\fR" 4
285 .IX Item "-nocerts"
286 when signing a message the signer's certificate is normally included
287 with this option it is excluded. This will reduce the size of the
288 signed message but the verifier must have a copy of the signers certificate
289 available locally (passed using the \fB\-certfile\fR option for example).
290 .IP "\fB\-noattr\fR" 4
291 .IX Item "-noattr"
292 normally when a message is signed a set of attributes are included which
293 include the signing time and supported symmetric algorithms. With this
294 option they are not included.
295 .IP "\fB\-binary\fR" 4
296 .IX Item "-binary"
297 normally the input message is converted to \*(L"canonical\*(R" format which is
298 effectively using \s-1CR\s0 and \s-1LF\s0 as end of line: as required by the S/MIME
299 specification. When this option is present no translation occurs. This
300 is useful when handling binary data which may not be in \s-1MIME\s0 format.
301 .IP "\fB\-nodetach\fR" 4
302 .IX Item "-nodetach"
303 when signing a message use opaque signing: this form is more resistant
304 to translation by mail relays but it cannot be read by mail agents that
305 do not support S/MIME.  Without this option cleartext signing with
306 the \s-1MIME\s0 type multipart/signed is used.
307 .IP "\fB\-certfile file\fR" 4
308 .IX Item "-certfile file"
309 allows additional certificates to be specified. When signing these will
310 be included with the message. When verifying these will be searched for
311 the signers certificates. The certificates should be in \s-1PEM\s0 format.
312 .IP "\fB\-signer file\fR" 4
313 .IX Item "-signer file"
314 a signing certificate when signing or resigning a message, this option can be
315 used multiple times if more than one signer is required. If a message is being
316 verified then the signers certificates will be written to this file if the
317 verification was successful.
318 .IP "\fB\-recip file\fR" 4
319 .IX Item "-recip file"
320 the recipients certificate when decrypting a message. This certificate
321 must match one of the recipients of the message or an error occurs.
322 .IP "\fB\-inkey file\fR" 4
323 .IX Item "-inkey file"
324 the private key to use when signing or decrypting. This must match the
325 corresponding certificate. If this option is not specified then the
326 private key must be included in the certificate file specified with
327 the \fB\-recip\fR or \fB\-signer\fR file. When signing this option can be used
328 multiple times to specify successive keys.
329 .IP "\fB\-passin arg\fR" 4
330 .IX Item "-passin arg"
331 the private key password source. For more information about the format of \fBarg\fR
332 see the \fB\s-1PASS\s0 \s-1PHRASE\s0 \s-1ARGUMENTS\s0\fR section in \fIopenssl\fR\|(1).
333 .IP "\fB\-rand file(s)\fR" 4
334 .IX Item "-rand file(s)"
335 a file or files containing random data used to seed the random number
336 generator, or an \s-1EGD\s0 socket (see \fIRAND_egd\fR\|(3)).
337 Multiple files can be specified separated by a OS-dependent character.
338 The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for
339 all others.
340 .IP "\fBcert.pem...\fR" 4
341 .IX Item "cert.pem..."
342 one or more certificates of message recipients: used when encrypting
343 a message.
344 .IP "\fB\-to, \-from, \-subject\fR" 4
345 .IX Item "-to, -from, -subject"
346 the relevant mail headers. These are included outside the signed
347 portion of a message so they may be included manually. If signing
348 then many S/MIME mail clients check the signers certificate's email
349 address matches that specified in the From: address.
350 .IP "\fB\-purpose, \-ignore_critical, \-issuer_checks, \-crl_check, \-crl_check_all, \-policy_check, \-extended_crl, \-x509_strict, \-policy \-check_ss_sig\fR" 4
351 .IX Item "-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig"
352 Set various options of certificate chain verification. See
353 \&\fBverify\fR manual page for details.
354 .SH "NOTES"
355 .IX Header "NOTES"
356 The \s-1MIME\s0 message must be sent without any blank lines between the
357 headers and the output. Some mail programs will automatically add
358 a blank line. Piping the mail directly to sendmail is one way to
359 achieve the correct format.
360 .PP
361 The supplied message to be signed or encrypted must include the
362 necessary \s-1MIME\s0 headers or many S/MIME clients wont display it
363 properly (if at all). You can use the \fB\-text\fR option to automatically
364 add plain text headers.
365 .PP
366 A \*(L"signed and encrypted\*(R" message is one where a signed message is
367 then encrypted. This can be produced by encrypting an already signed
368 message: see the examples section.
369 .PP
370 This version of the program only allows one signer per message but it
371 will verify multiple signers on received messages. Some S/MIME clients
372 choke if a message contains multiple signers. It is possible to sign
373 messages \*(L"in parallel\*(R" by signing an already signed message.
374 .PP
375 The options \fB\-encrypt\fR and \fB\-decrypt\fR reflect common usage in S/MIME
376 clients. Strictly speaking these process PKCS#7 enveloped data: PKCS#7
377 encrypted data is used for other purposes.
378 .PP
379 The \fB\-resign\fR option uses an existing message digest when adding a new
380 signer. This means that attributes must be present in at least one existing
381 signer using the same message digest or this operation will fail.
382 .PP
383 The \fB\-stream\fR and \fB\-indef\fR options enable experimental streaming I/O support.
384 As a result the encoding is \s-1BER\s0 using indefinite length constructed encoding
385 and no longer \s-1DER\s0. Streaming is supported for the \fB\-encrypt\fR operation and the
386 \&\fB\-sign\fR operation if the content is not detached.
387 .PP
388 Streaming is always used for the \fB\-sign\fR operation with detached data but
389 since the content is no longer part of the PKCS#7 structure the encoding
390 remains \s-1DER\s0.
391 .SH "EXIT CODES"
392 .IX Header "EXIT CODES"
393 .IP "0" 4
394 the operation was completely successfully.
395 .IP "1" 4
396 .IX Item "1"
397 an error occurred parsing the command options.
398 .IP "2" 4
399 .IX Item "2"
400 one of the input files could not be read.
401 .IP "3" 4
402 .IX Item "3"
403 an error occurred creating the PKCS#7 file or when reading the \s-1MIME\s0
404 message.
405 .IP "4" 4
406 .IX Item "4"
407 an error occurred decrypting or verifying the message.
408 .IP "5" 4
409 .IX Item "5"
410 the message was verified correctly but an error occurred writing out
411 the signers certificates.
412 .SH "EXAMPLES"
413 .IX Header "EXAMPLES"
414 Create a cleartext signed message:
415 .PP
416 .Vb 2
417 \& openssl smime \-sign \-in message.txt \-text \-out mail.msg \e
418 \&        \-signer mycert.pem
419 .Ve
420 .PP
421 Create an opaque signed message:
422 .PP
423 .Vb 2
424 \& openssl smime \-sign \-in message.txt \-text \-out mail.msg \-nodetach \e
425 \&        \-signer mycert.pem
426 .Ve
427 .PP
428 Create a signed message, include some additional certificates and
429 read the private key from another file:
430 .PP
431 .Vb 2
432 \& openssl smime \-sign \-in in.txt \-text \-out mail.msg \e
433 \&        \-signer mycert.pem \-inkey mykey.pem \-certfile mycerts.pem
434 .Ve
435 .PP
436 Create a signed message with two signers:
437 .PP
438 .Vb 2
439 \& openssl smime \-sign \-in message.txt \-text \-out mail.msg \e
440 \&        \-signer mycert.pem \-signer othercert.pem
441 .Ve
442 .PP
443 Send a signed message under Unix directly to sendmail, including headers:
444 .PP
445 .Vb 3
446 \& openssl smime \-sign \-in in.txt \-text \-signer mycert.pem \e
447 \&        \-from steve@openssl.org \-to someone@somewhere \e
448 \&        \-subject "Signed message" | sendmail someone@somewhere
449 .Ve
450 .PP
451 Verify a message and extract the signer's certificate if successful:
452 .PP
453 .Vb 1
454 \& openssl smime \-verify \-in mail.msg \-signer user.pem \-out signedtext.txt
455 .Ve
456 .PP
457 Send encrypted mail using triple \s-1DES:\s0
458 .PP
459 .Vb 3
460 \& openssl smime \-encrypt \-in in.txt \-from steve@openssl.org \e
461 \&        \-to someone@somewhere \-subject "Encrypted message" \e
462 \&        \-des3 user.pem \-out mail.msg
463 .Ve
464 .PP
465 Sign and encrypt mail:
466 .PP
467 .Vb 4
468 \& openssl smime \-sign \-in ml.txt \-signer my.pem \-text \e
469 \&        | openssl smime \-encrypt \-out mail.msg \e
470 \&        \-from steve@openssl.org \-to someone@somewhere \e
471 \&        \-subject "Signed and Encrypted message" \-des3 user.pem
472 .Ve
473 .PP
474 Note: the encryption command does not include the \fB\-text\fR option because the
475 message being encrypted already has \s-1MIME\s0 headers.
476 .PP
477 Decrypt mail:
478 .PP
479 .Vb 1
480 \& openssl smime \-decrypt \-in mail.msg \-recip mycert.pem \-inkey key.pem
481 .Ve
482 .PP
483 The output from Netscape form signing is a PKCS#7 structure with the
484 detached signature format. You can use this program to verify the
485 signature by line wrapping the base64 encoded structure and surrounding
486 it with:
487 .PP
488 .Vb 2
489 \& \-\-\-\-\-BEGIN PKCS7\-\-\-\-\-
490 \& \-\-\-\-\-END PKCS7\-\-\-\-\-
491 .Ve
492 .PP
493 and using the command:
494 .PP
495 .Vb 1
496 \& openssl smime \-verify \-inform PEM \-in signature.pem \-content content.txt
497 .Ve
498 .PP
499 Alternatively you can base64 decode the signature and use:
500 .PP
501 .Vb 1
502 \& openssl smime \-verify \-inform DER \-in signature.der \-content content.txt
503 .Ve
504 .PP
505 Create an encrypted message using 128 bit Camellia:
506 .PP
507 .Vb 1
508 \& openssl smime \-encrypt \-in plain.txt \-camellia128 \-out mail.msg cert.pem
509 .Ve
510 .PP
511 Add a signer to an existing message:
512 .PP
513 .Vb 1
514 \& openssl smime \-resign \-in mail.msg \-signer newsign.pem \-out mail2.msg
515 .Ve
516 .SH "BUGS"
517 .IX Header "BUGS"
518 The \s-1MIME\s0 parser isn't very clever: it seems to handle most messages that I've
519 thrown at it but it may choke on others.
520 .PP
521 The code currently will only write out the signer's certificate to a file: if
522 the signer has a separate encryption certificate this must be manually
523 extracted. There should be some heuristic that determines the correct
524 encryption certificate.
525 .PP
526 Ideally a database should be maintained of a certificates for each email
527 address.
528 .PP
529 The code doesn't currently take note of the permitted symmetric encryption
530 algorithms as supplied in the SMIMECapabilities signed attribute. This means the
531 user has to manually include the correct encryption algorithm. It should store
532 the list of permitted ciphers in a database and only use those.
533 .PP
534 No revocation checking is done on the signer's certificate.
535 .PP
536 The current code can only handle S/MIME v2 messages, the more complex S/MIME v3
537 structures may cause parsing errors.
538 .SH "HISTORY"
539 .IX Header "HISTORY"
540 The use of multiple \fB\-signer\fR options and the \fB\-resign\fR command were first
541 added in OpenSSL 1.0.0