~andersk/ubuntu/oneiric/openssl/spurious-reboot

« back to all changes in this revision

Viewing changes to doc/apps/smime.pod

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2010-12-12 15:37:21 UTC
  • mto: (1.2.1 upstream) (11.2.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 55.
  • Revision ID: james.westby@ubuntu.com-20101212153721-mfw51stum5hwztpd
Tags: upstream-1.0.0c
ImportĀ upstreamĀ versionĀ 1.0.0c

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
[B<-encrypt>]
11
11
[B<-decrypt>]
12
12
[B<-sign>]
 
13
[B<-resign>]
13
14
[B<-verify>]
14
15
[B<-pk7out>]
15
 
[B<-des>]
16
 
[B<-des3>]
17
 
[B<-rc2-40>]
18
 
[B<-rc2-64>]
19
 
[B<-rc2-128>]
20
 
[B<-aes128>]
21
 
[B<-aes192>]
22
 
[B<-aes256>]
23
 
[B<-camellia128>]
24
 
[B<-camellia192>]
25
 
[B<-camellia256>]
 
16
[B<-[cipher]>]
26
17
[B<-in file>]
27
18
[B<-certfile file>]
28
19
[B<-signer file>]
37
28
[B<-from ad>]
38
29
[B<-subject s>]
39
30
[B<-text>]
 
31
[B<-indef>]
 
32
[B<-noindef>]
 
33
[B<-stream>]
40
34
[B<-rand file(s)>]
 
35
[B<-md digest>]
41
36
[cert.pem]...
42
37
 
43
38
=head1 DESCRIPTION
47
42
 
48
43
=head1 COMMAND OPTIONS
49
44
 
50
 
There are five operation options that set the type of operation to be performed.
 
45
There are six operation options that set the type of operation to be performed.
51
46
The meaning of the other options varies according to the operation type.
52
47
 
53
48
=over 4
78
73
 
79
74
takes an input message and writes out a PEM encoded PKCS#7 structure.
80
75
 
 
76
=item B<-resign>
 
77
 
 
78
resign a message: take an existing message and one or more new signers.
 
79
 
81
80
=item B<-in filename>
82
81
 
83
82
the input message to be encrypted or signed or the MIME message to
106
105
structure, if no PKCS#7 structure is being output (for example with
107
106
B<-verify> or B<-decrypt>) this option has no effect.
108
107
 
 
108
=item B<-stream -indef -noindef>
 
109
 
 
110
the B<-stream> and B<-indef> options are equivalent and enable streaming I/O
 
111
for encoding operations. This permits single pass processing of data without
 
112
the need to hold the entire contents in memory, potentially supporting very
 
113
large files. Streaming is automatically set for S/MIME signing with detached
 
114
data if the output format is B<SMIME> it is currently off by default for all
 
115
other operations.
 
116
 
 
117
=item B<-noindef>
 
118
 
 
119
disable streaming I/O where it would produce and indefinite length constructed
 
120
encoding. This option currently has no effect. In future streaming will be
 
121
enabled by default on all relevant operations and this option will disable it.
 
122
 
109
123
=item B<-content filename>
110
124
 
111
125
This specifies a file containing the detached content, this is only
132
146
is a hash of each subject name (using B<x509 -hash>) should be linked
133
147
to each certificate.
134
148
 
135
 
=item B<-des -des3 -rc2-40 -rc2-64 -rc2-128 -aes128 -aes192 -aes256 -camellia128 -camellia192 -camellia256>
136
 
 
137
 
the encryption algorithm to use. DES (56 bits), triple DES (168 bits),
138
 
40, 64 or 128 bit RC2, 128, 192 or 256 bit AES, or 128, 192 or 256 bit Camellia respectively.  If not
139
 
specified 40 bit RC2 is used. Only used with B<-encrypt>.
 
149
=item B<-md digest>
 
150
 
 
151
digest algorithm to use when signing or resigning. If not present then the
 
152
default digest algorithm for the signing key will be used (usually SHA1).
 
153
 
 
154
=item B<-[cipher]>
 
155
 
 
156
the encryption algorithm to use. For example DES  (56 bits) - B<-des>,
 
157
triple DES (168 bits) - B<-des3>,
 
158
EVP_get_cipherbyname() function) can also be used preceded by a dash, for 
 
159
example B<-aes_128_cbc>. See L<B<enc>|enc(1)> for list of ciphers
 
160
supported by your version of OpenSSL.
 
161
 
 
162
If not specified 40 bit RC2 is used. Only used with B<-encrypt>.
140
163
 
141
164
=item B<-nointern>
142
165
 
193
216
 
194
217
=item B<-signer file>
195
218
 
196
 
the signers certificate when signing a message. If a message is
197
 
being verified then the signers certificates will be written to this
198
 
file if the verification was successful.
 
219
a signing certificate when signing or resigning a message, this option can be
 
220
used multiple times if more than one signer is required. If a message is being
 
221
verified then the signers certificates will be written to this file if the
 
222
verification was successful.
199
223
 
200
224
=item B<-recip file>
201
225
 
207
231
the private key to use when signing or decrypting. This must match the
208
232
corresponding certificate. If this option is not specified then the
209
233
private key must be included in the certificate file specified with
210
 
the B<-recip> or B<-signer> file.
 
234
the B<-recip> or B<-signer> file. When signing this option can be used
 
235
multiple times to specify successive keys.
211
236
 
212
237
=item B<-passin arg>
213
238
 
234
259
then many S/MIME mail clients check the signers certificate's email
235
260
address matches that specified in the From: address.
236
261
 
 
262
=item B<-purpose, -ignore_critical, -issuer_checks, -crl_check, -crl_check_all, -policy_check, -extended_crl, -x509_strict, -policy -check_ss_sig>
 
263
 
 
264
Set various options of certificate chain verification. See
 
265
L<B<verify>|verify(1)> manual page for details.
 
266
 
237
267
=back
238
268
 
239
269
=head1 NOTES
261
291
clients. Strictly speaking these process PKCS#7 enveloped data: PKCS#7
262
292
encrypted data is used for other purposes.
263
293
 
 
294
The B<-resign> option uses an existing message digest when adding a new
 
295
signer. This means that attributes must be present in at least one existing
 
296
signer using the same message digest or this operation will fail.
 
297
 
 
298
The B<-stream> and B<-indef> options enable experimental streaming I/O support.
 
299
As a result the encoding is BER using indefinite length constructed encoding
 
300
and no longer DER. Streaming is supported for the B<-encrypt> operation and the
 
301
B<-sign> operation if the content is not detached.
 
302
 
 
303
Streaming is always used for the B<-sign> operation with detached data but
 
304
since the content is no longer part of the PKCS#7 structure the encoding
 
305
remains DER.
 
306
 
264
307
=head1 EXIT CODES
265
308
 
266
309
=over 4
300
343
 openssl smime -sign -in message.txt -text -out mail.msg \
301
344
        -signer mycert.pem
302
345
 
303
 
Create and opaque signed message
 
346
Create an opaque signed message:
304
347
 
305
348
 openssl smime -sign -in message.txt -text -out mail.msg -nodetach \
306
349
        -signer mycert.pem
311
354
 openssl smime -sign -in in.txt -text -out mail.msg \
312
355
        -signer mycert.pem -inkey mykey.pem -certfile mycerts.pem
313
356
 
 
357
Create a signed message with two signers:
 
358
 
 
359
 openssl smime -sign -in message.txt -text -out mail.msg \
 
360
        -signer mycert.pem -signer othercert.pem
 
361
 
314
362
Send a signed message under Unix directly to sendmail, including headers:
315
363
 
316
364
 openssl smime -sign -in in.txt -text -signer mycert.pem \
334
382
        -from steve@openssl.org -to someone@somewhere \
335
383
        -subject "Signed and Encrypted message" -des3 user.pem
336
384
 
337
 
Note: the encryption command does not include the B<-text> option because the message
338
 
being encrypted already has MIME headers.
 
385
Note: the encryption command does not include the B<-text> option because the
 
386
message being encrypted already has MIME headers.
339
387
 
340
388
Decrypt mail:
341
389
 
349
397
 -----BEGIN PKCS7-----
350
398
 -----END PKCS7-----
351
399
 
352
 
and using the command, 
 
400
and using the command: 
353
401
 
354
402
 openssl smime -verify -inform PEM -in signature.pem -content content.txt
355
403
 
356
 
alternatively you can base64 decode the signature and use
 
404
Alternatively you can base64 decode the signature and use:
357
405
 
358
406
 openssl smime -verify -inform DER -in signature.der -content content.txt
359
407
 
361
409
 
362
410
 openssl smime -encrypt -in plain.txt -camellia128 -out mail.msg cert.pem
363
411
 
 
412
Add a signer to an existing message:
 
413
 
 
414
 openssl smime -resign -in mail.msg -signer newsign.pem -out mail2.msg
 
415
 
364
416
=head1 BUGS
365
417
 
366
 
The MIME parser isn't very clever: it seems to handle most messages that I've thrown
367
 
at it but it may choke on others.
368
 
 
369
 
The code currently will only write out the signer's certificate to a file: if the
370
 
signer has a separate encryption certificate this must be manually extracted. There
371
 
should be some heuristic that determines the correct encryption certificate.
372
 
 
373
 
Ideally a database should be maintained of a certificates for each email address.
 
418
The MIME parser isn't very clever: it seems to handle most messages that I've
 
419
thrown at it but it may choke on others.
 
420
 
 
421
The code currently will only write out the signer's certificate to a file: if
 
422
the signer has a separate encryption certificate this must be manually
 
423
extracted. There should be some heuristic that determines the correct
 
424
encryption certificate.
 
425
 
 
426
Ideally a database should be maintained of a certificates for each email
 
427
address.
374
428
 
375
429
The code doesn't currently take note of the permitted symmetric encryption
376
 
algorithms as supplied in the SMIMECapabilities signed attribute. this means the
 
430
algorithms as supplied in the SMIMECapabilities signed attribute. This means the
377
431
user has to manually include the correct encryption algorithm. It should store
378
432
the list of permitted ciphers in a database and only use those.
379
433
 
382
436
The current code can only handle S/MIME v2 messages, the more complex S/MIME v3
383
437
structures may cause parsing errors.
384
438
 
 
439
=head1 HISTORY
 
440
 
 
441
The use of multiple B<-signer> options and the B<-resign> command were first
 
442
added in OpenSSL 1.0.0
 
443
 
 
444
 
385
445
=cut