diff options
Diffstat (limited to '')
| -rw-r--r-- | src/usr.bin/openssl/openssl.1 | 427 |
1 files changed, 83 insertions, 344 deletions
diff --git a/src/usr.bin/openssl/openssl.1 b/src/usr.bin/openssl/openssl.1 index 796e3e0057..44f5d4dc55 100644 --- a/src/usr.bin/openssl/openssl.1 +++ b/src/usr.bin/openssl/openssl.1 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: openssl.1,v 1.69 2016/09/04 19:38:51 jmc Exp $ | 1 | .\" $OpenBSD: openssl.1,v 1.70 2016/09/08 18:24:08 jmc Exp $ |
| 2 | .\" ==================================================================== | 2 | .\" ==================================================================== |
| 3 | .\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. | 3 | .\" Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. |
| 4 | .\" | 4 | .\" |
| @@ -112,7 +112,7 @@ | |||
| 112 | .\" | 112 | .\" |
| 113 | .\" OPENSSL | 113 | .\" OPENSSL |
| 114 | .\" | 114 | .\" |
| 115 | .Dd $Mdocdate: September 4 2016 $ | 115 | .Dd $Mdocdate: September 8 2016 $ |
| 116 | .Dt OPENSSL 1 | 116 | .Dt OPENSSL 1 |
| 117 | .Os | 117 | .Os |
| 118 | .Sh NAME | 118 | .Sh NAME |
| @@ -4265,13 +4265,9 @@ should be taken if the information is being output by a | |||
| 4265 | application. | 4265 | application. |
| 4266 | This is, however, strongly discouraged and should only be used for | 4266 | This is, however, strongly discouraged and should only be used for |
| 4267 | debugging purposes. | 4267 | debugging purposes. |
| 4268 | .\" | ||
| 4269 | .\" SMIME | ||
| 4270 | .\" | ||
| 4271 | .Sh SMIME | 4268 | .Sh SMIME |
| 4272 | .nr nS 1 | 4269 | .nr nS 1 |
| 4273 | .Nm "openssl smime" | 4270 | .Nm "openssl smime" |
| 4274 | .Bk -words | ||
| 4275 | .Oo | 4271 | .Oo |
| 4276 | .Fl aes128 | aes192 | aes256 | des | | 4272 | .Fl aes128 | aes192 | aes256 | des | |
| 4277 | .Fl des3 | rc2-40 | rc2-64 | rc2-128 | 4273 | .Fl des3 | rc2-40 | rc2-64 | rc2-128 |
| @@ -4291,10 +4287,10 @@ debugging purposes. | |||
| 4291 | .Op Fl ignore_critical | 4287 | .Op Fl ignore_critical |
| 4292 | .Op Fl in Ar file | 4288 | .Op Fl in Ar file |
| 4293 | .Op Fl indef | 4289 | .Op Fl indef |
| 4294 | .Op Fl inform Ar DER | PEM | SMIME | 4290 | .Op Fl inform Cm der | pem | smime |
| 4295 | .Op Fl inkey Ar file | 4291 | .Op Fl inkey Ar file |
| 4296 | .Op Fl issuer_checks | 4292 | .Op Fl issuer_checks |
| 4297 | .Op Fl keyform Ar PEM | 4293 | .Op Fl keyform Cm pem |
| 4298 | .Op Fl md Ar digest | 4294 | .Op Fl md Ar digest |
| 4299 | .Op Fl noattr | 4295 | .Op Fl noattr |
| 4300 | .Op Fl nocerts | 4296 | .Op Fl nocerts |
| @@ -4305,7 +4301,7 @@ debugging purposes. | |||
| 4305 | .Op Fl nosigs | 4301 | .Op Fl nosigs |
| 4306 | .Op Fl noverify | 4302 | .Op Fl noverify |
| 4307 | .Op Fl out Ar file | 4303 | .Op Fl out Ar file |
| 4308 | .Op Fl outform Ar DER | PEM | SMIME | 4304 | .Op Fl outform Cm der | pem | smime |
| 4309 | .Op Fl passin Ar arg | 4305 | .Op Fl passin Ar arg |
| 4310 | .Op Fl pk7out | 4306 | .Op Fl pk7out |
| 4311 | .Op Fl policy_check | 4307 | .Op Fl policy_check |
| @@ -4320,48 +4316,51 @@ debugging purposes. | |||
| 4320 | .Op Fl verify | 4316 | .Op Fl verify |
| 4321 | .Op Fl x509_strict | 4317 | .Op Fl x509_strict |
| 4322 | .Op Ar cert.pem ... | 4318 | .Op Ar cert.pem ... |
| 4323 | .Ek | ||
| 4324 | .nr nS 0 | 4319 | .nr nS 0 |
| 4325 | .Pp | 4320 | .Pp |
| 4326 | The | 4321 | The |
| 4327 | .Nm smime | 4322 | .Nm smime |
| 4328 | command handles | 4323 | command handles S/MIME mail. |
| 4329 | .Em S/MIME | 4324 | It can encrypt, decrypt, sign, and verify S/MIME messages. |
| 4330 | mail. | 4325 | .Pp |
| 4331 | It can encrypt, decrypt, sign, and verify | 4326 | The MIME message must be sent without any blank lines between the |
| 4332 | .Em S/MIME | 4327 | headers and the output. |
| 4333 | messages. | 4328 | Some mail programs will automatically add a blank line. |
| 4329 | Piping the mail directly to an MTA is one way to | ||
| 4330 | achieve the correct format. | ||
| 4331 | .Pp | ||
| 4332 | The supplied message to be signed or encrypted must include the necessary | ||
| 4333 | MIME headers or many S/MIME clients won't display it properly (if at all). | ||
| 4334 | Use the | ||
| 4335 | .Fl text | ||
| 4336 | option to automatically add plain text headers. | ||
| 4334 | .Pp | 4337 | .Pp |
| 4335 | There are six operation options that set the type of operation to be performed. | 4338 | A |
| 4336 | The meaning of the other options varies according to the operation type. | 4339 | .Qq signed and encrypted |
| 4340 | message is one where a signed message is then encrypted. | ||
| 4341 | This can be produced by encrypting an already signed message. | ||
| 4337 | .Pp | 4342 | .Pp |
| 4338 | The six operation options are as follows: | 4343 | There are a number of operations that can be performed, as follows: |
| 4339 | .Bl -tag -width "XXXX" | 4344 | .Bl -tag -width "XXXX" |
| 4340 | .It Fl decrypt | 4345 | .It Fl decrypt |
| 4341 | Decrypt mail using the supplied certificate and private key. | 4346 | Decrypt mail using the supplied certificate and private key. |
| 4342 | Expects an encrypted mail message in | 4347 | The input file is an encrypted mail message in MIME format. |
| 4343 | .Em MIME | ||
| 4344 | format for the input file. | ||
| 4345 | The decrypted mail is written to the output file. | 4348 | The decrypted mail is written to the output file. |
| 4346 | .It Fl encrypt | 4349 | .It Fl encrypt |
| 4347 | Encrypt mail for the given recipient certificates. | 4350 | Encrypt mail for the given recipient certificates. |
| 4348 | Input file is the message to be encrypted. | 4351 | The input is the message to be encrypted. |
| 4349 | The output file is the encrypted mail in | 4352 | The output file is the encrypted mail, in MIME format. |
| 4350 | .Em MIME | ||
| 4351 | format. | ||
| 4352 | .It Fl pk7out | 4353 | .It Fl pk7out |
| 4353 | Takes an input message and writes out a PEM-encoded PKCS#7 structure. | 4354 | Take an input message and write out a PEM-encoded PKCS#7 structure. |
| 4354 | .It Fl resign | 4355 | .It Fl resign |
| 4355 | Resign a message: take an existing message and one or more new signers. | 4356 | Resign a message: take an existing message and one or more new signers. |
| 4356 | .It Fl sign | 4357 | .It Fl sign |
| 4357 | Sign mail using the supplied certificate and private key. | 4358 | Sign mail using the supplied certificate and private key. |
| 4358 | Input file is the message to be signed. | 4359 | The input file is the message to be signed. |
| 4359 | The signed message in | 4360 | The signed message, in MIME format, is written to the output file. |
| 4360 | .Em MIME | ||
| 4361 | format is written to the output file. | ||
| 4362 | .It Fl verify | 4361 | .It Fl verify |
| 4363 | Verify signed mail. | 4362 | Verify signed mail. |
| 4364 | Expects a signed mail message on input and outputs the signed data. | 4363 | The input is a signed mail message and the output is the signed data. |
| 4365 | Both clear text and opaque signing is supported. | 4364 | Both clear text and opaque signing is supported. |
| 4366 | .El | 4365 | .El |
| 4367 | .Pp | 4366 | .Pp |
| @@ -4372,11 +4371,7 @@ The remaining options are as follows: | |||
| 4372 | .Fl des3 | rc2-40 | rc2-64 | rc2-128 | 4371 | .Fl des3 | rc2-40 | rc2-64 | rc2-128 |
| 4373 | .Xc | 4372 | .Xc |
| 4374 | The encryption algorithm to use. | 4373 | The encryption algorithm to use. |
| 4375 | 128-, 192-, or 256-bit AES, | 4374 | 128-, 192-, or 256-bit AES, DES (56 bits), triple DES (168 bits), |
| 4376 | DES | ||
| 4377 | .Pq 56 bits , | ||
| 4378 | triple DES | ||
| 4379 | .Pq 168 bits , | ||
| 4380 | or 40-, 64-, or 128-bit RC2, respectively; | 4375 | or 40-, 64-, or 128-bit RC2, respectively; |
| 4381 | if not specified, 40-bit RC2 is | 4376 | if not specified, 40-bit RC2 is |
| 4382 | used. | 4377 | used. |
| @@ -4385,14 +4380,10 @@ Only used with | |||
| 4385 | .It Fl binary | 4380 | .It Fl binary |
| 4386 | Normally, the input message is converted to | 4381 | Normally, the input message is converted to |
| 4387 | .Qq canonical | 4382 | .Qq canonical |
| 4388 | format which is effectively using CR and LF as end of line \- | 4383 | format which uses CR/LF as end of line, |
| 4389 | as required by the | 4384 | as required by the S/MIME specification. |
| 4390 | .Em S/MIME | ||
| 4391 | specification. | ||
| 4392 | When this option is present no translation occurs. | 4385 | When this option is present no translation occurs. |
| 4393 | This is useful when handling binary data which may not be in | 4386 | This is useful when handling binary data which may not be in MIME format. |
| 4394 | .Em MIME | ||
| 4395 | format. | ||
| 4396 | .It Fl CAfile Ar file | 4387 | .It Fl CAfile Ar file |
| 4397 | A | 4388 | A |
| 4398 | .Ar file | 4389 | .Ar file |
| @@ -4427,20 +4418,17 @@ The certificates should be in PEM format. | |||
| 4427 | .Xc | 4418 | .Xc |
| 4428 | Set various certificate chain validation options. | 4419 | Set various certificate chain validation options. |
| 4429 | See the | 4420 | See the |
| 4430 | .Nm VERIFY | 4421 | .Nm verify |
| 4431 | command for details. | 4422 | command for details. |
| 4432 | .It Fl content Ar file | 4423 | .It Fl content Ar file |
| 4433 | This specifies a file containing the detached content. | 4424 | A file containing the detached content. |
| 4434 | This is only useful with the | 4425 | This is only useful with the |
| 4435 | .Fl verify | 4426 | .Fl verify |
| 4436 | command. | 4427 | option, |
| 4437 | This is only usable if the PKCS#7 structure is using the detached | 4428 | and only usable if the PKCS#7 structure is using the detached |
| 4438 | signature form where the content is not included. | 4429 | signature form where the content is not included. |
| 4439 | This option will override any content if the input format is | 4430 | This option will override any content if the input format is S/MIME |
| 4440 | .Em S/MIME | 4431 | and it uses the multipart/signed MIME content type. |
| 4441 | and it uses the multipart/signed | ||
| 4442 | .Em MIME | ||
| 4443 | content type. | ||
| 4444 | .It Xo | 4432 | .It Xo |
| 4445 | .Fl from Ar addr , | 4433 | .Fl from Ar addr , |
| 4446 | .Fl subject Ar s , | 4434 | .Fl subject Ar s , |
| @@ -4449,15 +4437,11 @@ content type. | |||
| 4449 | The relevant mail headers. | 4437 | The relevant mail headers. |
| 4450 | These are included outside the signed | 4438 | These are included outside the signed |
| 4451 | portion of a message so they may be included manually. | 4439 | portion of a message so they may be included manually. |
| 4452 | When signing, many | 4440 | When signing, many S/MIME |
| 4453 | .Em S/MIME | ||
| 4454 | mail clients check that the signer's certificate email | 4441 | mail clients check that the signer's certificate email |
| 4455 | address matches the From: address. | 4442 | address matches the From: address. |
| 4456 | .It Fl in Ar file | 4443 | .It Fl in Ar file |
| 4457 | The input message to be encrypted or signed or the | 4444 | The input file to read from. |
| 4458 | .Em MIME | ||
| 4459 | message to | ||
| 4460 | be decrypted or verified. | ||
| 4461 | .It Fl indef | 4445 | .It Fl indef |
| 4462 | Enable streaming I/O for encoding operations. | 4446 | Enable streaming I/O for encoding operations. |
| 4463 | This permits single pass processing of data without | 4447 | This permits single pass processing of data without |
| @@ -4466,27 +4450,11 @@ potentially supporting very large files. | |||
| 4466 | Streaming is automatically set for S/MIME signing with detached | 4450 | Streaming is automatically set for S/MIME signing with detached |
| 4467 | data if the output format is SMIME; | 4451 | data if the output format is SMIME; |
| 4468 | it is currently off by default for all other operations. | 4452 | it is currently off by default for all other operations. |
| 4469 | .It Fl inform Ar DER | PEM | SMIME | 4453 | .It Fl inform Cm der | pem | smime |
| 4470 | This specifies the input format for the PKCS#7 structure. | 4454 | The input format. |
| 4471 | The default is | ||
| 4472 | .Em SMIME , | ||
| 4473 | which reads an | ||
| 4474 | .Em S/MIME | ||
| 4475 | format message. | ||
| 4476 | .Ar PEM | ||
| 4477 | and | ||
| 4478 | .Ar DER | ||
| 4479 | format change this to expect PEM and DER format PKCS#7 structures | ||
| 4480 | instead. | ||
| 4481 | This currently only affects the input format of the PKCS#7 | ||
| 4482 | structure; if no PKCS#7 structure is being input (for example with | ||
| 4483 | .Fl encrypt | ||
| 4484 | or | ||
| 4485 | .Fl sign ) , | ||
| 4486 | this option has no effect. | ||
| 4487 | .It Fl inkey Ar file | 4455 | .It Fl inkey Ar file |
| 4488 | The private key to use when signing or decrypting. | 4456 | The private key to use when signing or decrypting, |
| 4489 | This must match the corresponding certificate. | 4457 | which must match the corresponding certificate. |
| 4490 | If this option is not specified, the private key must be included | 4458 | If this option is not specified, the private key must be included |
| 4491 | in the certificate file specified with | 4459 | in the certificate file specified with |
| 4492 | the | 4460 | the |
| @@ -4496,19 +4464,16 @@ or | |||
| 4496 | file. | 4464 | file. |
| 4497 | When signing, | 4465 | When signing, |
| 4498 | this option can be used multiple times to specify successive keys. | 4466 | this option can be used multiple times to specify successive keys. |
| 4499 | .It Fl keyform Ar PEM | 4467 | .It Fl keyform Cm pem |
| 4500 | Input private key format. | 4468 | Input private key format. |
| 4501 | .It Fl md Ar digest | 4469 | .It Fl md Ar digest |
| 4502 | The digest algorithm to use when signing or resigning. | 4470 | The digest algorithm to use when signing or resigning. |
| 4503 | If not present then the default digest algorithm for the signing key is used | 4471 | If not present then the default digest algorithm for the signing key is used |
| 4504 | (usually SHA1). | 4472 | (usually SHA1). |
| 4505 | .It Fl noattr | 4473 | .It Fl noattr |
| 4506 | Normally, when a message is signed a set of attributes are included which | 4474 | Do not include attributes. |
| 4507 | include the signing time and supported symmetric algorithms. | ||
| 4508 | With this option they are not included. | ||
| 4509 | .It Fl nocerts | 4475 | .It Fl nocerts |
| 4510 | When signing a message, the signer's certificate is normally included; | 4476 | Do not include the signer's certificate. |
| 4511 | with this option it is excluded. | ||
| 4512 | This will reduce the size of the signed message but the verifier must | 4477 | This will reduce the size of the signed message but the verifier must |
| 4513 | have a copy of the signer's certificate available locally (passed using the | 4478 | have a copy of the signer's certificate available locally (passed using the |
| 4514 | .Fl certfile | 4479 | .Fl certfile |
| @@ -4519,44 +4484,29 @@ don't use the certificates in the signed message as untrusted CAs. | |||
| 4519 | .It Fl nodetach | 4484 | .It Fl nodetach |
| 4520 | When signing a message use opaque signing: this form is more resistant | 4485 | When signing a message use opaque signing: this form is more resistant |
| 4521 | to translation by mail relays but it cannot be read by mail agents that | 4486 | to translation by mail relays but it cannot be read by mail agents that |
| 4522 | do not support | 4487 | do not support S/MIME. |
| 4523 | .Em S/MIME . | 4488 | Without this option cleartext signing with the MIME type |
| 4524 | Without this option cleartext signing with the | 4489 | multipart/signed is used. |
| 4525 | .Em MIME | ||
| 4526 | type multipart/signed is used. | ||
| 4527 | .It Fl noindef | 4490 | .It Fl noindef |
| 4528 | Disable streaming I/O where it would produce an encoding of indefinite length. | 4491 | Disable streaming I/O where it would produce an encoding of indefinite length |
| 4529 | This option currently has no effect. | 4492 | (currently has no effect). |
| 4530 | In future streaming will be enabled by default on all relevant operations | ||
| 4531 | and this option will disable it. | ||
| 4532 | .It Fl nointern | 4493 | .It Fl nointern |
| 4533 | When verifying a message, normally certificates | 4494 | Only use certificates specified in the |
| 4534 | .Pq if any | 4495 | .Fl certfile . |
| 4535 | included in the message are searched for the signing certificate. | 4496 | The supplied certificates can still be used as untrusted CAs. |
| 4536 | With this option, only the certificates specified in the | ||
| 4537 | .Fl certfile | ||
| 4538 | option are used. | ||
| 4539 | The supplied certificates can still be used as untrusted CAs however. | ||
| 4540 | .It Fl nosigs | 4497 | .It Fl nosigs |
| 4541 | Don't try to verify the signatures on the message. | 4498 | Do not try to verify the signatures on the message. |
| 4542 | .It Fl noverify | 4499 | .It Fl noverify |
| 4543 | Do not verify the signer's certificate of a signed message. | 4500 | Do not verify the signer's certificate of a signed message. |
| 4544 | .It Fl out Ar file | 4501 | .It Fl out Ar file |
| 4545 | The message text that has been decrypted or verified, or the output | 4502 | The output file to write to. |
| 4546 | .Em MIME | 4503 | .It Fl outform Cm der | pem | smime |
| 4547 | format message that has been signed or verified. | 4504 | The output format. |
| 4548 | .It Fl outform Ar DER | PEM | SMIME | 4505 | The default is smime, which writes an S/MIME format message. |
| 4549 | This specifies the output format for the PKCS#7 structure. | 4506 | .Cm pem |
| 4550 | The default is | ||
| 4551 | .Em SMIME , | ||
| 4552 | which writes an | ||
| 4553 | .Em S/MIME | ||
| 4554 | format message. | ||
| 4555 | .Ar PEM | ||
| 4556 | and | 4507 | and |
| 4557 | .Ar DER | 4508 | .Cm der |
| 4558 | format change this to write PEM and DER format PKCS#7 structures | 4509 | change this to write PEM and DER format PKCS#7 structures instead. |
| 4559 | instead. | ||
| 4560 | This currently only affects the output format of the PKCS#7 | 4510 | This currently only affects the output format of the PKCS#7 |
| 4561 | structure; if no PKCS#7 structure is being output (for example with | 4511 | structure; if no PKCS#7 structure is being output (for example with |
| 4562 | .Fl verify | 4512 | .Fl verify |
| @@ -4578,244 +4528,31 @@ written to this file if the verification was successful. | |||
| 4578 | The same as | 4528 | The same as |
| 4579 | .Fl indef . | 4529 | .Fl indef . |
| 4580 | .It Fl text | 4530 | .It Fl text |
| 4581 | This option adds plain text | 4531 | Add plain text (text/plain) MIME |
| 4582 | .Pq text/plain | ||
| 4583 | .Em MIME | ||
| 4584 | headers to the supplied message if encrypting or signing. | 4532 | headers to the supplied message if encrypting or signing. |
| 4585 | If decrypting or verifying, it strips off text headers: | 4533 | If decrypting or verifying, it strips off text headers: |
| 4586 | if the decrypted or verified message is not of | 4534 | if the decrypted or verified message is not of MIME type text/plain |
| 4587 | .Em MIME | 4535 | then an error occurs. |
| 4588 | type text/plain then an error occurs. | ||
| 4589 | .El | 4536 | .El |
| 4590 | .Sh SMIME NOTES | ||
| 4591 | The | ||
| 4592 | .Em MIME | ||
| 4593 | message must be sent without any blank lines between the | ||
| 4594 | headers and the output. | ||
| 4595 | Some mail programs will automatically add a blank line. | ||
| 4596 | Piping the mail directly to an MTA is one way to | ||
| 4597 | achieve the correct format. | ||
| 4598 | .Pp | ||
| 4599 | The supplied message to be signed or encrypted must include the | ||
| 4600 | necessary | ||
| 4601 | .Em MIME | ||
| 4602 | headers or many | ||
| 4603 | .Em S/MIME | ||
| 4604 | clients won't display it properly | ||
| 4605 | .Pq if at all . | ||
| 4606 | You can use the | ||
| 4607 | .Fl text | ||
| 4608 | option to automatically add plain text headers. | ||
| 4609 | .Pp | ||
| 4610 | A | ||
| 4611 | .Qq signed and encrypted | ||
| 4612 | message is one where a signed message is then encrypted. | ||
| 4613 | This can be produced by encrypting an already signed message: | ||
| 4614 | see the | ||
| 4615 | .Sx SMIME EXAMPLES | ||
| 4616 | section. | ||
| 4617 | .Pp | ||
| 4618 | This version of the program only allows one signer per message, but it | ||
| 4619 | will verify multiple signers on received messages. | ||
| 4620 | Some | ||
| 4621 | .Em S/MIME | ||
| 4622 | clients choke if a message contains multiple signers. | ||
| 4623 | It is possible to sign messages | ||
| 4624 | .Qq in parallel | ||
| 4625 | by signing an already signed message. | ||
| 4626 | .Pp | ||
| 4627 | The options | ||
| 4628 | .Fl encrypt | ||
| 4629 | and | ||
| 4630 | .Fl decrypt | ||
| 4631 | reflect common usage in | ||
| 4632 | .Em S/MIME | ||
| 4633 | clients. | ||
| 4634 | Strictly speaking these process PKCS#7 enveloped data: PKCS#7 | ||
| 4635 | encrypted data is used for other purposes. | ||
| 4636 | .Pp | 4537 | .Pp |
| 4637 | The | 4538 | The exit codes for |
| 4638 | .Fl resign | 4539 | .Nm smime |
| 4639 | option uses an existing message digest when adding a new signer. | 4540 | are as follows: |
| 4640 | This means that attributes must be present in at least one existing | ||
| 4641 | signer using the same message digest or this operation will fail. | ||
| 4642 | .Pp | 4541 | .Pp |
| 4643 | The | 4542 | .Bl -tag -width "XXXX" -offset 3n -compact |
| 4644 | .Fl stream | 4543 | .It 0 |
| 4645 | and | ||
| 4646 | .Fl indef | ||
| 4647 | options enable experimental streaming I/O support. | ||
| 4648 | As a result the encoding is BER using indefinite length constructed encoding | ||
| 4649 | and no longer DER. | ||
| 4650 | Streaming is supported for the | ||
| 4651 | .Fl encrypt | ||
| 4652 | and | ||
| 4653 | .Fl sign | ||
| 4654 | operations if the content is not detached. | ||
| 4655 | .Pp | ||
| 4656 | Streaming is always used for the | ||
| 4657 | .Fl sign | ||
| 4658 | operation with detached data | ||
| 4659 | but since the content is no longer part of the PKCS#7 structure | ||
| 4660 | the encoding remains DER. | ||
| 4661 | .Sh SMIME EXIT CODES | ||
| 4662 | .Bl -tag -width "XXXX" | ||
| 4663 | .It Ar 0 | ||
| 4664 | The operation was completely successful. | 4544 | The operation was completely successful. |
| 4665 | .It Ar 1 | 4545 | .It 1 |
| 4666 | An error occurred parsing the command options. | 4546 | An error occurred parsing the command options. |
| 4667 | .It Ar 2 | 4547 | .It 2 |
| 4668 | One of the input files could not be read. | 4548 | One of the input files could not be read. |
| 4669 | .It Ar 3 | 4549 | .It 3 |
| 4670 | An error occurred creating the PKCS#7 file or when reading the | 4550 | An error occurred creating the file or when reading the message. |
| 4671 | .Em MIME | 4551 | .It 4 |
| 4672 | message. | ||
| 4673 | .It Ar 4 | ||
| 4674 | An error occurred decrypting or verifying the message. | 4552 | An error occurred decrypting or verifying the message. |
| 4675 | .It Ar 5 | 4553 | .It 5 |
| 4676 | The message was verified correctly, but an error occurred writing out | 4554 | An error occurred writing certificates. |
| 4677 | the signer's certificates. | ||
| 4678 | .El | 4555 | .El |
| 4679 | .Sh SMIME EXAMPLES | ||
| 4680 | Create a cleartext signed message: | ||
| 4681 | .Bd -literal -offset indent | ||
| 4682 | $ openssl smime -sign -in message.txt -text -out mail.msg \e | ||
| 4683 | -signer mycert.pem | ||
| 4684 | .Ed | ||
| 4685 | .Pp | ||
| 4686 | Create an opaque signed message: | ||
| 4687 | .Bd -literal -offset indent | ||
| 4688 | $ openssl smime -sign -in message.txt -text -out mail.msg \e | ||
| 4689 | -nodetach -signer mycert.pem | ||
| 4690 | .Ed | ||
| 4691 | .Pp | ||
| 4692 | Create a signed message, include some additional certificates and | ||
| 4693 | read the private key from another file: | ||
| 4694 | .Bd -literal -offset indent | ||
| 4695 | $ openssl smime -sign -in in.txt -text -out mail.msg \e | ||
| 4696 | -signer mycert.pem -inkey mykey.pem -certfile mycerts.pem | ||
| 4697 | .Ed | ||
| 4698 | .Pp | ||
| 4699 | Create a signed message with two signers: | ||
| 4700 | .Bd -literal -offset indent | ||
| 4701 | openssl smime -sign -in message.txt -text -out mail.msg \e | ||
| 4702 | -signer mycert.pem -signer othercert.pem | ||
| 4703 | .Ed | ||
| 4704 | .Pp | ||
| 4705 | Send a signed message under | ||
| 4706 | .Ux | ||
| 4707 | directly to | ||
| 4708 | .Xr sendmail 8 , | ||
| 4709 | including headers: | ||
| 4710 | .Bd -literal -offset indent | ||
| 4711 | $ openssl smime -sign -in in.txt -text -signer mycert.pem \e | ||
| 4712 | -from steve@openssl.org -to someone@somewhere \e | ||
| 4713 | -subject "Signed message" | sendmail someone@somewhere | ||
| 4714 | .Ed | ||
| 4715 | .Pp | ||
| 4716 | Verify a message and extract the signer's certificate if successful: | ||
| 4717 | .Bd -literal -offset indent | ||
| 4718 | $ openssl smime -verify -in mail.msg -signer user.pem \e | ||
| 4719 | -out signedtext.txt | ||
| 4720 | .Ed | ||
| 4721 | .Pp | ||
| 4722 | Send encrypted mail using triple DES: | ||
| 4723 | .Bd -literal -offset indent | ||
| 4724 | $ openssl smime -encrypt -in in.txt -from steve@openssl.org \e | ||
| 4725 | -to someone@somewhere -subject "Encrypted message" \e | ||
| 4726 | -des3 -out mail.msg user.pem | ||
| 4727 | .Ed | ||
| 4728 | .Pp | ||
| 4729 | Sign and encrypt mail: | ||
| 4730 | .Bd -literal -offset indent | ||
| 4731 | $ openssl smime -sign -in ml.txt -signer my.pem -text | \e | ||
| 4732 | openssl smime -encrypt -out mail.msg \e | ||
| 4733 | -from steve@openssl.org -to someone@somewhere \e | ||
| 4734 | -subject "Signed and Encrypted message" -des3 user.pem | ||
| 4735 | .Ed | ||
| 4736 | .Pp | ||
| 4737 | .Sy Note : | ||
| 4738 | The encryption command does not include the | ||
| 4739 | .Fl text | ||
| 4740 | option because the message being encrypted already has | ||
| 4741 | .Em MIME | ||
| 4742 | headers. | ||
| 4743 | .Pp | ||
| 4744 | Decrypt mail: | ||
| 4745 | .Bd -literal -offset indent | ||
| 4746 | $ openssl smime -decrypt -in mail.msg -recip mycert.pem \e | ||
| 4747 | -inkey key.pem" | ||
| 4748 | .Ed | ||
| 4749 | .Pp | ||
| 4750 | The output from Netscape form signing is a PKCS#7 structure with the | ||
| 4751 | detached signature format. | ||
| 4752 | You can use this program to verify the signature by line wrapping the | ||
| 4753 | base64-encoded structure and surrounding it with: | ||
| 4754 | .Bd -unfilled -offset indent | ||
| 4755 | -----BEGIN PKCS7----- | ||
| 4756 | -----END PKCS7----- | ||
| 4757 | .Ed | ||
| 4758 | .Pp | ||
| 4759 | and using the command: | ||
| 4760 | .Bd -literal -offset indent | ||
| 4761 | $ openssl smime -verify -inform PEM -in signature.pem \e | ||
| 4762 | -content content.txt | ||
| 4763 | .Ed | ||
| 4764 | .Pp | ||
| 4765 | Alternatively, you can base64 decode the signature and use: | ||
| 4766 | .Bd -literal -offset indent | ||
| 4767 | $ openssl smime -verify -inform DER -in signature.der \e | ||
| 4768 | -content content.txt | ||
| 4769 | .Ed | ||
| 4770 | .Pp | ||
| 4771 | Create an encrypted message using 128-bit AES: | ||
| 4772 | .Bd -literal -offset indent | ||
| 4773 | openssl smime -encrypt -in plain.txt -aes128 \e | ||
| 4774 | -out mail.msg cert.pem | ||
| 4775 | .Ed | ||
| 4776 | .Pp | ||
| 4777 | Add a signer to an existing message: | ||
| 4778 | .Bd -literal -offset indent | ||
| 4779 | openssl smime -resign -in mail.msg -signer newsign.pem \e | ||
| 4780 | -out mail2.msg | ||
| 4781 | .Ed | ||
| 4782 | .Sh SMIME BUGS | ||
| 4783 | The | ||
| 4784 | .Em MIME | ||
| 4785 | parser isn't very clever: it seems to handle most messages that I've thrown | ||
| 4786 | at it, but it may choke on others. | ||
| 4787 | .Pp | ||
| 4788 | The code currently will only write out the signer's certificate to a file: | ||
| 4789 | if the signer has a separate encryption certificate this must be manually | ||
| 4790 | extracted. | ||
| 4791 | There should be some heuristic that determines the correct encryption | ||
| 4792 | certificate. | ||
| 4793 | .Pp | ||
| 4794 | Ideally, a database should be maintained of a certificate for each email | ||
| 4795 | address. | ||
| 4796 | .Pp | ||
| 4797 | The code doesn't currently take note of the permitted symmetric encryption | ||
| 4798 | algorithms as supplied in the | ||
| 4799 | .Em SMIMECapabilities | ||
| 4800 | signed attribute. | ||
| 4801 | This means the user has to manually include the correct encryption algorithm. | ||
| 4802 | It should store the list of permitted ciphers in a database and only use those. | ||
| 4803 | .Pp | ||
| 4804 | No revocation checking is done on the signer's certificate. | ||
| 4805 | .Pp | ||
| 4806 | The current code can only handle | ||
| 4807 | .Em S/MIME | ||
| 4808 | v2 messages; the more complex | ||
| 4809 | .Em S/MIME | ||
| 4810 | v3 structures may cause parsing errors. | ||
| 4811 | .Sh SMIME HISTORY | ||
| 4812 | The use of multiple | ||
| 4813 | .Fl signer | ||
| 4814 | options and the | ||
| 4815 | .Fl resign | ||
| 4816 | command were first added in | ||
| 4817 | .Nm OpenSSL | ||
| 4818 | 1.0.0. | ||
| 4819 | .\" | 4556 | .\" |
| 4820 | .\" SPEED | 4557 | .\" SPEED |
| 4821 | .\" | 4558 | .\" |
| @@ -7029,6 +6766,8 @@ Insecure legacy format. | |||
| 7029 | .It Cm pem | 6766 | .It Cm pem |
| 7030 | Privacy Enhanced Mail (PEM) | 6767 | Privacy Enhanced Mail (PEM) |
| 7031 | is base64-encoded. | 6768 | is base64-encoded. |
| 6769 | .It Cm smime | ||
| 6770 | An SMIME format message. | ||
| 7032 | .It Cm txt | 6771 | .It Cm txt |
| 7033 | Plain ASCII text. | 6772 | Plain ASCII text. |
| 7034 | .El | 6773 | .El |
