Lines Matching +full:- +full:- +full:message +full:- +full:format
2 {- OpenSSL::safe::output_do_not_edit_headers(); -}
6 openssl-cms - CMS command
11 [B<-help>]
15 [B<-in> I<filename>]
16 [B<-out> I<filename>]
17 {- $OpenSSL::safe::opt_config_synopsis -}
21 [B<-encrypt>]
22 [B<-decrypt>]
23 [B<-sign>]
24 [B<-verify>]
25 [B<-resign>]
26 [B<-sign_receipt>]
27 [B<-verify_receipt> I<receipt>]
28 [B<-digest_create>]
29 [B<-digest_verify>]
30 [B<-compress>]
31 [B<-uncompress>]
32 [B<-EncryptedData_encrypt>]
33 [B<-EncryptedData_decrypt>]
34 [B<-data_create>]
35 [B<-data_out>]
36 [B<-cmsout>]
38 File format options:
40 [B<-inform> B<DER>|B<PEM>|B<SMIME>]
41 [B<-outform> B<DER>|B<PEM>|B<SMIME>]
42 [B<-rctform> B<DER>|B<PEM>|B<SMIME>]
43 [B<-stream>]
44 [B<-indef>]
45 [B<-noindef>]
46 [B<-binary>]
47 [B<-crlfeol>]
48 [B<-asciicrlf>]
52 [B<-pwri_password> I<password>]
53 [B<-secretkey> I<key>]
54 [B<-secretkeyid> I<id>]
55 [B<-inkey> I<filename>|I<uri>]
56 [B<-passin> I<arg>]
57 [B<-keyopt> I<name>:I<parameter>]
58 [B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>]
59 {- $OpenSSL::safe::opt_engine_synopsis -}{- $OpenSSL::safe::opt_provider_synopsis -}
60 {- $OpenSSL::safe::opt_r_synopsis -}
64 [B<-originator> I<file>]
65 [B<-recip> I<file>]
66 [I<recipient-cert> ...]
67 [B<-I<cipher>>]
68 [B<-wrap> I<cipher>]
69 [B<-aes128-wrap>]
70 [B<-aes192-wrap>]
71 [B<-aes256-wrap>]
72 [B<-des3-wrap>]
73 [B<-debug_decrypt>]
77 [B<-md> I<digest>]
78 [B<-signer> I<file>]
79 [B<-certfile> I<file>]
80 [B<-cades>]
81 [B<-nodetach>]
82 [B<-nocerts>]
83 [B<-noattr>]
84 [B<-nosmimecap>]
85 [B<-receipt_request_all>]
86 [B<-receipt_request_first>]
87 [B<-receipt_request_from> I<emailaddress>]
88 [B<-receipt_request_to> I<emailaddress>]
92 [B<-signer> I<file>]
93 [B<-content> I<filename>]
94 [B<-no_content_verify>]
95 [B<-no_attr_verify>]
96 [B<-nosigs>]
97 [B<-noverify>]
98 [B<-nointern>]
99 [B<-cades>]
100 [B<-verify_retcode>]
101 {- $OpenSSL::safe::opt_trust_synopsis -}
105 [B<-keyid>]
106 [B<-econtent_type> I<type>]
107 [B<-text>]
108 [B<-certsout> I<file>]
109 [B<-to> I<addr>]
110 [B<-from> I<addr>]
111 [B<-subject> I<subj>]
115 [B<-noout>]
116 [B<-print>]
117 [B<-nameopt> I<option>]
118 [B<-receipt_request_print>]
122 {- $OpenSSL::safe::opt_v_synopsis -}
126 This command handles data in CMS format such as S/MIME v3.1 email messages.
140 =item B<-help>
142 Print out a usage message.
150 =item B<-in> I<filename>
152 The input message to be encrypted or signed or the message to be decrypted
155 =item B<-out> I<filename>
157 The message text that has been decrypted or verified or the output MIME
158 format message that has been signed or verified.
160 {- $OpenSSL::safe::opt_config_item -}
168 =item B<-encrypt>
170 Encrypt data for the given recipient certificates. Input file is the message
171 to be encrypted. The output file is the encrypted data in MIME format. The
177 =item B<-decrypt>
180 encrypted datain MIME format for the input file. The decrypted data
183 =item B<-sign>
186 the message to be signed. The signed data in MIME format is written
189 =item B<-verify>
194 =item B<-resign>
196 Resign a message: take an existing message and one or more new signers.
198 =item B<-sign_receipt>
200 Generate and output a signed receipt for the supplied message. The input
201 message B<must> contain a signed receipt request. Functionality is otherwise
202 similar to the B<-sign> operation.
204 =item B<-verify_receipt> I<receipt>
206 Verify a signed receipt in filename B<receipt>. The input message B<must>
208 to the B<-verify> operation.
210 =item B<-digest_create>
214 =item B<-digest_verify>
218 =item B<-compress>
223 =item B<-uncompress>
229 =item B<-EncryptedData_encrypt>
234 =item B<-EncryptedData_decrypt>
239 =item B<-data_create>
243 =item B<-data_out>
247 =item B<-cmsout>
249 Takes an input message and writes out a PEM encoded CMS structure.
253 =head2 File format options
257 =item B<-inform> B<DER>|B<PEM>|B<SMIME>
259 The input format of the CMS structure (if one is being read);
261 See L<openssl-format-options(1)> for details.
263 =item B<-outform> B<DER>|B<PEM>|B<SMIME>
265 The output format of the CMS structure (if one is being written);
267 See L<openssl-format-options(1)> for details.
269 =item B<-rctform> B<DER>|B<PEM>|B<SMIME>
271 The signed receipt format for use with the B<-receipt_verify>; the default
273 See L<openssl-format-options(1)> for details.
275 =item B<-stream>, B<-indef>
277 The B<-stream> and B<-indef> options are equivalent and enable streaming I/O
281 data if the output format is B<SMIME> it is currently off by default for all
284 =item B<-noindef>
290 =item B<-binary>
292 Normally the input message is converted to "canonical" format which is
295 is useful when handling binary data which may not be in MIME format.
297 =item B<-crlfeol>
302 =item B<-asciicrlf>
304 When signing use ASCII CRLF format canonicalisation. This strips trailing
307 content and an output signature format of DER. This option is not normally
309 content format is detected.
317 =item B<-pwri_password> I<password>
321 =item B<-secretkey> I<key>
323 Specify symmetric key to use. The key must be supplied in hex format and be
324 consistent with the algorithm used. Supported by the B<-EncryptedData_encrypt>
325 B<-EncryptedData_decrypt>, B<-encrypt> and B<-decrypt> options. When used
326 with B<-encrypt> or B<-decrypt> the supplied key is used to wrap or unwrap the
329 =item B<-secretkeyid> I<id>
332 This option B<must> be present if the B<-secretkey> option is used with
333 B<-encrypt>. With B<-decrypt> operations the I<id> is used to locate the
337 =item B<-inkey> I<filename>|I<uri>
342 the B<-recip> or B<-signer> file. When signing this option can be used
345 =item B<-passin> I<arg>
347 The private key password source. For more information about the format of B<arg>
348 see L<openssl-passphrase-options(1)>.
350 =item B<-keyopt> I<name>:I<parameter>
354 currently be used to set RSA-PSS for signing, RSA-OAEP for encryption
357 =item B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>
359 The format of the private key file; unspecified by default.
360 See L<openssl-format-options(1)> for details.
362 {- $OpenSSL::safe::opt_engine_item -}
364 {- $OpenSSL::safe::opt_provider_item -}
366 {- $OpenSSL::safe::opt_r_item -}
374 =item B<-originator> I<file>
376 A certificate of the originator of the encrypted message. Necessary for
379 =item B<-recip> I<file>
381 When decrypting a message this specifies the certificate of the recipient.
382 The certificate must match one of the recipients of the message.
384 When encrypting a message this option may be used multiple times to specify
386 required (for example to specify RSA-OAEP).
388 Only certificates carrying RSA, Diffie-Hellman or EC keys are supported by this
391 =item I<recipient-cert> ...
393 This is an alternative to using the B<-recip> option when encrypting a message.
396 =item B<-I<cipher>>
398 The encryption algorithm to use. For example triple DES (168 bits) - B<-des3>
399 or 256 bit AES - B<-aes256>. Any standard algorithm name (as used by the
401 example B<-aes-128-cbc>. See L<openssl-enc(1)> for a list of ciphers
407 If not specified triple DES is used. Only used with B<-encrypt> and
408 B<-EncryptedData_create> commands.
410 =item B<-wrap> I<cipher>
412 Cipher algorithm to use for key wrap when encrypting the message using Key
416 =item B<-aes128-wrap>, B<-aes192-wrap>, B<-aes256-wrap>, B<-des3-wrap>
418 Use AES128, AES192, AES256, or 3DES-EDE, respectively, to wrap key.
419 Depending on the OpenSSL build options used, B<-des3-wrap> may not be supported.
421 =item B<-debug_decrypt>
432 =item B<-md> I<digest>
437 =item B<-signer> I<file>
439 A signing certificate. When signing or resigning a message, this option can be
442 =item B<-certfile> I<file>
445 be included with the message. When verifying these will be searched for
447 The input can be in PEM, DER, or PKCS#12 format.
449 =item B<-cades>
451 When used with B<-sign>,
452 add an ESS signingCertificate or ESS signingCertificateV2 signed-attribute
454 for a CAdES Basic Electronic Signature (CAdES-BES).
456 =item B<-nodetach>
458 When signing a message use opaque signing: this form is more resistant
463 =item B<-nocerts>
465 When signing a message the signer's certificate is normally included
467 signed message but the verifier must have a copy of the signers certificate
468 available locally (passed using the B<-certfile> option for example).
470 =item B<-noattr>
472 Normally when a message is signed a set of attributes are included which
476 =item B<-nosmimecap>
481 =item B<-receipt_request_all>, B<-receipt_request_first>
483 For B<-sign> option include a signed receipt request. Indicate requests should
485 and not from a mailing list). Ignored it B<-receipt_request_from> is included.
487 =item B<-receipt_request_from> I<emailaddress>
489 For B<-sign> option include a signed receipt request. Add an explicit email
492 =item B<-receipt_request_to> I<emailaddress>
503 =item B<-signer> I<file>
505 If a message has been verified successfully then the signers certificate(s)
508 =item B<-content> I<filename>
511 S/MIME input, such as the B<-verify> command. This is only usable if the CMS
513 not included. This option will override any content if the input format
516 =item B<-no_content_verify>
520 =item B<-no_attr_verify>
524 =item B<-nosigs>
526 Don't verify message signature.
528 =item B<-noverify>
530 Do not verify the signers certificate of a signed message.
532 =item B<-nointern>
534 When verifying a message normally certificates (if any) included in
535 the message are searched for the signing certificate. With this option
536 only the certificates specified in the B<-certfile> option are used.
539 =item B<-cades>
541 When used with B<-verify>, require and check signer certificate digest.
544 =item B<-verify_retcode>
548 {- $OpenSSL::safe::opt_trust_item -}
556 =item B<-keyid>
560 identifier extension. Supported by B<-sign> and B<-encrypt> options.
562 =item B<-econtent_type> I<type>
566 numerical format.
568 =item B<-text>
571 message if encrypting or signing. If decrypting or verifying it strips
572 off text headers: if the decrypted or verified message is not of MIME
575 =item B<-certsout> I<file>
577 Any certificates contained in the input message are written to I<file>.
579 =item B<-to>, B<-from>, B<-subject>
582 portion of a message so they may be included manually. If signing
592 =item B<-noout>
594 For the B<-cmsout> operation do not output the parsed CMS structure.
597 =item B<-print>
599 For the B<-cmsout> operation print out all fields of the CMS structure.
600 This implies B<-noout>.
603 =item B<-nameopt> I<option>
605 For the B<-cmsout> operation when B<-print> option is in use, specifies
607 See L<openssl-namedisplay-options(1)> for details.
609 =item B<-receipt_request_print>
611 For the B<-verify> operation print out the contents of any signed receipt
620 {- $OpenSSL::safe::opt_v_item -}
628 The MIME message must be sent without any blank lines between the
631 achieve the correct format.
633 The supplied message to be signed or encrypted must include the
635 properly (if at all). You can use the B<-text> option to automatically
638 A "signed and encrypted" message is one where a signed message is
640 message: see the examples section.
642 This version of the program only allows one signer per message but it
644 choke if a message contains multiple signers. It is possible to sign
645 messages "in parallel" by signing an already signed message.
647 The options B<-encrypt> and B<-decrypt> reflect common usage in S/MIME
651 The B<-resign> option uses an existing message digest when adding a new
653 signer using the same message digest or this operation will fail.
655 The B<-stream> and B<-indef> options enable streaming I/O support.
657 and no longer DER. Streaming is supported for the B<-encrypt> operation and the
658 B<-sign> operation if the content is not detached.
660 Streaming is always used for the B<-sign> operation with detached data but
664 If the B<-decrypt> option is used without a recipient certificate then an
668 tried whether they succeed or not and if no recipients match the message
670 The B<-debug_decrypt> option can be used to disable the MMA attack protection
674 =head1 CADES BASIC ELECTRONIC SIGNATURE (CADES-BES)
676 A CAdES Basic Electronic Signature (CAdES-BES),
677 as defined in the European Standard ETSI EN 319 122-1 V1.1.1, contains:
687 Content-type of the EncapsulatedContentInfo value being signed;
691 Message-digest of the eContent OCTET STRING within encapContentInfo being signed;
697 An ESS signingCertificate attribute only allows for SHA-1 as digest algorithm.
704 NOTE that the B<-cades> option applies to the B<-sign> or B<-verify> operations.
705 With this option, the B<-verify> operation also requires that the
730 message.
734 An error occurred decrypting or verifying the message.
738 The message was verified correctly but an error occurred writing out
743 =head1 COMPATIBILITY WITH PKCS#7 FORMAT
745 L<openssl-smime(1)> can only process the older B<PKCS#7> format.
746 B<openssl cms> supports Cryptographic Message Syntax format.
748 applications which only support the older format. These are detailed below.
750 The use of the B<-keyid> option with B<-sign> or B<-encrypt>.
752 The B<-outform> I<PEM> option uses different headers.
754 The B<-compress> option.
756 The B<-secretkey> option when used with B<-encrypt>.
758 The use of PSS with B<-sign>.
760 The use of OAEP or non-RSA keys with B<-encrypt>.
762 Additionally the B<-EncryptedData_create> and B<-data_create> type cannot
763 be processed by the older L<openssl-smime(1)> command.
767 Create a cleartext signed message:
769 openssl cms -sign -in message.txt -text -out mail.msg \
770 -signer mycert.pem
772 Create an opaque signed message
774 openssl cms -sign -in message.txt -text -out mail.msg -nodetach \
775 -signer mycert.pem
777 Create a signed message, include some additional certificates and
780 openssl cms -sign -in in.txt -text -out mail.msg \
781 -signer mycert.pem -inkey mykey.pem -certfile mycerts.pem
783 Create a signed message with two signers, use key identifier:
785 openssl cms -sign -in message.txt -text -out mail.msg \
786 -signer mycert.pem -signer othercert.pem -keyid
788 Send a signed message under Unix directly to sendmail, including headers:
790 openssl cms -sign -in in.txt -text -signer mycert.pem \
791 -from steve@openssl.org -to someone@somewhere \
792 -subject "Signed message" | sendmail someone@somewhere
794 Verify a message and extract the signer's certificate if successful:
796 openssl cms -verify -in mail.msg -signer user.pem -out signedtext.txt
800 openssl cms -encrypt -in in.txt -from steve@openssl.org \
801 -to someone@somewhere -subject "Encrypted message" \
802 -des3 user.pem -out mail.msg
806 openssl cms -sign -in ml.txt -signer my.pem -text \
807 | openssl cms -encrypt -out mail.msg \
808 -from steve@openssl.org -to someone@somewhere \
809 -subject "Signed and Encrypted message" -des3 user.pem
811 Note: the encryption command does not include the B<-text> option because the
812 message being encrypted already has MIME headers.
814 Decrypt a message:
816 openssl cms -decrypt -in mail.msg -recip mycert.pem -inkey key.pem
819 detached signature format. You can use this program to verify the
823 -----BEGIN PKCS7-----
824 -----END PKCS7-----
828 openssl cms -verify -inform PEM -in signature.pem -content content.txt
832 openssl cms -verify -inform DER -in signature.der -content content.txt
834 Create an encrypted message using 128 bit Camellia:
836 openssl cms -encrypt -in plain.txt -camellia128 -out mail.msg cert.pem
838 Add a signer to an existing message:
840 openssl cms -resign -in mail.msg -signer newsign.pem -out mail2.msg
842 Sign a message using RSA-PSS:
844 openssl cms -sign -in message.txt -text -out mail.msg \
845 -signer mycert.pem -keyopt rsa_padding_mode:pss
847 Create an encrypted message using RSA-OAEP:
849 openssl cms -encrypt -in plain.txt -out mail.msg \
850 -recip cert.pem -keyopt rsa_padding_mode:oaep
854 openssl cms -encrypt -in plain.txt -out mail.msg \
855 -recip ecdhcert.pem -keyopt ecdh_kdf_md:sha256
857 Print CMS signed binary data in human-readable form:
859 openssl cms -in signed.cms -binary -inform DER -cmsout -print
883 L<ossl_store-file(7)>
887 The use of multiple B<-signer> options and the B<-resign> command were first
890 The B<-keyopt> option was added in OpenSSL 1.0.2.
892 Support for RSA-OAEP and RSA-PSS was added in OpenSSL 1.0.2.
894 The use of non-RSA keys with B<-encrypt> and B<-decrypt>
897 The -no_alt_chains option was added in OpenSSL 1.0.2b.
899 The B<-nameopt> option was added in OpenSSL 3.0.0.
901 The B<-engine> option was deprecated in OpenSSL 3.0.
905 Copyright 2008-2021 The OpenSSL Project Authors. All Rights Reserved.