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