idnits 2.17.1 draft-ietf-lamps-rfc5751-bis-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 2 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. == The 'Obsoletes: ' line in the draft header should list only the _numbers_ of the RFCs which will be obsoleted by this document (if approved); it should not include the word 'RFC' in the list. -- The abstract seems to indicate that this document obsoletes RFC5751, but the header doesn't have an 'Obsoletes:' line to match this. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 1188 has weird spacing: '...sedData id-...' == Line 1634 has weird spacing: '...s7-mime n/a ...' == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (February 23, 2017) is 2619 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'MIME-SECURE' is mentioned on line 1449, but not defined -- Looks like a reference, but probably isn't: '0' on line 2377 -- Looks like a reference, but probably isn't: '1' on line 2378 -- Looks like a reference, but probably isn't: '2' on line 2379 == Missing Reference: 'CMSALG' is mentioned on line 2398, but not defined == Missing Reference: 'CMS-SHA2' is mentioned on line 2398, but not defined == Missing Reference: 'RSAPSS' is mentioned on line 2398, but not defined == Missing Reference: 'RSAOAEP' is mentioned on line 2399, but not defined == Unused Reference: 'I-D.ietf-curdle-cms-eddsa-signatures' is defined on line 2007, but no explicit reference was found in the text == Unused Reference: 'I-D.ietf-lamps-rfc5750-bis' is defined on line 2135, but no explicit reference was found in the text == Unused Reference: 'RFC2049' is defined on line 2045, but no explicit reference was found in the text == Unused Reference: 'RFC4288' is defined on line 2093, but no explicit reference was found in the text == Unused Reference: 'RFC4289' is defined on line 2097, but no explicit reference was found in the text == Unused Reference: 'RFC2314' is defined on line 2291, but no explicit reference was found in the text == Unused Reference: 'RFC2633' is defined on line 2297, but no explicit reference was found in the text == Unused Reference: 'RFC3852' is defined on line 2304, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'CHARSETS' -- Possible downref: Non-RFC (?) normative reference: ref. 'CMS' -- Possible downref: Non-RFC (?) normative reference: ref. 'ESS' -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS186-4' == Outdated reference: A later version (-10) exists of draft-ietf-curdle-cms-ecdh-new-curves-01 == Outdated reference: A later version (-08) exists of draft-ietf-curdle-cms-eddsa-signatures-03 -- Possible downref: Non-RFC (?) normative reference: ref. 'MIME-SPEC' ** Obsolete normative reference: RFC 2138 (Obsoleted by RFC 2865) ** Obsolete normative reference: RFC 4288 (Obsoleted by RFC 6838) -- Duplicate reference: RFC5035, mentioned in 'RFC5652', was also mentioned in 'RFC5035'. ** Downref: Normative reference to an Informational RFC: RFC 5753 -- Obsolete informational reference (is this intentional?): RFC 2313 (Obsoleted by RFC 2437) -- Duplicate reference: RFC2315, mentioned in 'RFC2315', was also mentioned in 'RFC2314'. -- Obsolete informational reference (is this intentional?): RFC 2630 (Obsoleted by RFC 3369, RFC 3370) -- Obsolete informational reference (is this intentional?): RFC 2632 (Obsoleted by RFC 3850) -- Duplicate reference: RFC5035, mentioned in 'RFC2633', was also mentioned in 'RFC5652'. -- Obsolete informational reference (is this intentional?): RFC 3850 (Obsoleted by RFC 5750) -- Obsolete informational reference (is this intentional?): RFC 3851 (Obsoleted by RFC 5751) -- Duplicate reference: RFC5035, mentioned in 'RFC3852', was also mentioned in 'RFC2633'. -- Obsolete informational reference (is this intentional?): RFC 5750 (Obsoleted by RFC 8550) -- Obsolete informational reference (is this intentional?): RFC 5751 (Obsoleted by RFC 8551) Summary: 3 errors (**), 0 flaws (~~), 21 warnings (==), 21 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 LAMPS J. Schaad 3 Internet-Draft August Cellars 4 Obsoletes: RFC5751 (if approved) B. Ramsdell 5 Intended status: Standards Track Brute Squad Labs, Inc. 6 Expires: August 27, 2017 S. Turner 7 sn3rd 8 February 23, 2017 10 Secure/Multipurpose Internet Mail Extensions (S/MIME) Version 4.0 11 Message Specification 12 draft-ietf-lamps-rfc5751-bis-03 14 Abstract 16 This document defines Secure/Multipurpose Internet Mail Extensions 17 (S/MIME) version 4.0. S/MIME provides a consistent way to send and 18 receive secure MIME data. Digital signatures provide authentication, 19 message integrity, and non-repudiation with proof of origin. 20 Encryption provides data confidentiality. Compression can be used to 21 reduce data size. This document obsoletes RFC 5751. 23 Contributing to this document 25 The source for this draft is being maintained in GitHub. Suggested 26 changes should be submitted as pull requests at . Instructions are on that page as well. Editorial 28 changes can be managed in GitHub, but any substantial issues need to 29 be discussed on the LAMPS mailing list. 31 Status of This Memo 33 This Internet-Draft is submitted in full conformance with the 34 provisions of BCP 78 and BCP 79. 36 Internet-Drafts are working documents of the Internet Engineering 37 Task Force (IETF). Note that other groups may also distribute 38 working documents as Internet-Drafts. The list of current Internet- 39 Drafts is at http://datatracker.ietf.org/drafts/current/. 41 Internet-Drafts are draft documents valid for a maximum of six months 42 and may be updated, replaced, or obsoleted by other documents at any 43 time. It is inappropriate to use Internet-Drafts as reference 44 material or to cite them other than as "work in progress." 46 This Internet-Draft will expire on August 27, 2017. 48 Copyright Notice 50 Copyright (c) 2017 IETF Trust and the persons identified as the 51 document authors. All rights reserved. 53 This document is subject to BCP 78 and the IETF Trust's Legal 54 Provisions Relating to IETF Documents 55 (http://trustee.ietf.org/license-info) in effect on the date of 56 publication of this document. Please review these documents 57 carefully, as they describe your rights and restrictions with respect 58 to this document. Code Components extracted from this document must 59 include Simplified BSD License text as described in Section 4.e of 60 the Trust Legal Provisions and are provided without warranty as 61 described in the Simplified BSD License. 63 This document may contain material from IETF Documents or IETF 64 Contributions published or made publicly available before November 65 10, 2008. The person(s) controlling the copyright in some of this 66 material may not have granted the IETF Trust the right to allow 67 modifications of such material outside the IETF Standards Process. 68 Without obtaining an adequate license from the person(s) controlling 69 the copyright in such materials, this document may not be modified 70 outside the IETF Standards Process, and derivative works of it may 71 not be created outside the IETF Standards Process, except to format 72 it for publication as an RFC or to translate it into languages other 73 than English. 75 Table of Contents 77 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 78 1.1. Specification Overview . . . . . . . . . . . . . . . . . 4 79 1.2. Definitions . . . . . . . . . . . . . . . . . . . . . . . 5 80 1.3. Conventions Used in This Document . . . . . . . . . . . . 6 81 1.4. Compatibility with Prior Practice of S/MIME . . . . . . . 7 82 1.5. Changes from S/MIME v3 to S/MIME v3.1 . . . . . . . . . . 7 83 1.6. Changes from S/MIME v3.1 to S/MIME v3.2 . . . . . . . . . 8 84 1.7. Changes for S/MIME v4.0 . . . . . . . . . . . . . . . . . 9 85 2. CMS Options . . . . . . . . . . . . . . . . . . . . . . . . . 9 86 2.1. DigestAlgorithmIdentifier . . . . . . . . . . . . . . . . 10 87 2.2. SignatureAlgorithmIdentifier . . . . . . . . . . . . . . 10 88 2.3. KeyEncryptionAlgorithmIdentifier . . . . . . . . . . . . 11 89 2.4. General Syntax . . . . . . . . . . . . . . . . . . . . . 11 90 2.4.1. Data Content Type . . . . . . . . . . . . . . . . . . 12 91 2.4.2. SignedData Content Type . . . . . . . . . . . . . . . 12 92 2.4.3. EnvelopedData Content Type . . . . . . . . . . . . . 12 93 2.4.4. AuthEnvelopedData Content Type . . . . . . . . . . . 12 94 2.4.5. CompressedData Content Type . . . . . . . . . . . . . 12 95 2.5. Attributes and the SignerInfo Type . . . . . . . . . . . 13 96 2.5.1. Signing Time Attribute . . . . . . . . . . . . . . . 13 97 2.5.2. SMIME Capabilities Attribute . . . . . . . . . . . . 14 98 2.5.3. Encryption Key Preference Attribute . . . . . . . . . 15 99 2.6. SignerIdentifier SignerInfo Type . . . . . . . . . . . . 16 100 2.7. ContentEncryptionAlgorithmIdentifier . . . . . . . . . . 17 101 2.7.1. Deciding Which Encryption Method to Use . . . . . . . 17 102 2.7.2. Choosing Weak Encryption . . . . . . . . . . . . . . 19 103 2.7.3. Multiple Recipients . . . . . . . . . . . . . . . . . 19 104 3. Creating S/MIME Messages . . . . . . . . . . . . . . . . . . 19 105 3.1. Preparing the MIME Entity for Signing, Enveloping, or 106 Compressing . . . . . . . . . . . . . . . . . . . . . . . 20 107 3.1.1. Canonicalization . . . . . . . . . . . . . . . . . . 21 108 3.1.2. Transfer Encoding . . . . . . . . . . . . . . . . . . 22 109 3.1.3. Transfer Encoding for Signing Using multipart/signed 22 110 3.1.4. Sample Canonical MIME Entity . . . . . . . . . . . . 23 111 3.2. The application/pkcs7-mime Media Type . . . . . . . . . . 24 112 3.2.1. The name and filename Parameters . . . . . . . . . . 25 113 3.2.2. The smime-type Parameter . . . . . . . . . . . . . . 26 114 3.3. Creating an Enveloped-Only Message . . . . . . . . . . . 27 115 3.4. Creating an Authenticated Enveloped-Only Message . . . . 27 116 3.5. Creating a Signed-Only Message . . . . . . . . . . . . . 29 117 3.5.1. Choosing a Format for Signed-Only Messages . . . . . 29 118 3.5.2. Signing Using application/pkcs7-mime with SignedData 30 119 3.5.3. Signing Using the multipart/signed Format . . . . . . 31 120 3.6. Creating a Compressed-Only Message . . . . . . . . . . . 34 121 3.7. Multiple Operations . . . . . . . . . . . . . . . . . . . 34 122 3.8. Creating a Certificate Management Message . . . . . . . . 35 123 3.9. Registration Requests . . . . . . . . . . . . . . . . . . 36 124 3.10. Identifying an S/MIME Message . . . . . . . . . . . . . . 36 125 4. Certificate Processing . . . . . . . . . . . . . . . . . . . 36 126 4.1. Key Pair Generation . . . . . . . . . . . . . . . . . . . 37 127 4.2. Signature Generation . . . . . . . . . . . . . . . . . . 37 128 4.3. Signature Verification . . . . . . . . . . . . . . . . . 37 129 4.4. Encryption . . . . . . . . . . . . . . . . . . . . . . . 38 130 4.5. Decryption . . . . . . . . . . . . . . . . . . . . . . . 38 131 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 38 132 5.1. Media Type for application/pkcs7-mime . . . . . . . . . . 38 133 5.2. Media Type for application/pkcs7-signature . . . . . . . 39 134 5.3. Register authEnvelopedData smime-type . . . . . . . . . . 40 135 6. Security Considerations . . . . . . . . . . . . . . . . . . . 40 136 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 44 137 7.1. Normative References . . . . . . . . . . . . . . . . . . 44 138 7.2. Informative References . . . . . . . . . . . . . . . . . 48 139 Appendix A. ASN.1 Module . . . . . . . . . . . . . . . . . . . . 51 140 Appendix B. Historic Mail Considerations . . . . . . . . . . . . 53 141 B.1. DigestAlgorithmIdentifier . . . . . . . . . . . . . . . . 54 142 B.2. Signature Algorithms . . . . . . . . . . . . . . . . . . 54 143 B.3. ContentEncryptionAlgorithmIdentifier . . . . . . . . . . 56 144 B.4. KeyEncryptionAlgorithmIdentifier . . . . . . . . . . . . 56 145 Appendix C. Moving S/MIME v2 Message Specification to Historic 146 Status . . . . . . . . . . . . . . . . . . . . . . . 56 147 Appendix D. Acknowledgments . . . . . . . . . . . . . . . . . . 57 148 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 57 150 1. Introduction 152 S/MIME (Secure/Multipurpose Internet Mail Extensions) provides a 153 consistent way to send and receive secure MIME data. Based on the 154 popular Internet MIME standard, S/MIME provides the following 155 cryptographic security services for electronic messaging 156 applications: authentication, message integrity and non-repudiation 157 of origin (using digital signatures), and data confidentiality (using 158 encryption). As a supplementary service, S/MIME provides for message 159 compression. 161 S/MIME can be used by traditional mail user agents (MUAs) to add 162 cryptographic security services to mail that is sent, and to 163 interpret cryptographic security services in mail that is received. 164 However, S/MIME is not restricted to mail; it can be used with any 165 transport mechanism that transports MIME data, such as HTTP or SIP. 166 As such, S/MIME takes advantage of the object-based features of MIME 167 and allows secure messages to be exchanged in mixed-transport 168 systems. 170 Further, S/MIME can be used in automated message transfer agents that 171 use cryptographic security services that do not require any human 172 intervention, such as the signing of software-generated documents and 173 the encryption of FAX messages sent over the Internet. 175 1.1. Specification Overview 177 This document describes a protocol for adding cryptographic signature 178 and encryption services to MIME data. The MIME standard [MIME-SPEC] 179 provides a general structure for the content of Internet messages and 180 allows extensions for new content-type-based applications. 182 This specification defines how to create a MIME body part that has 183 been cryptographically enhanced according to the Cryptographic 184 Message Syntax (CMS) [CMS], which is derived from PKCS #7 [RFC2315]. 185 This specification also defines the application/pkcs7-mime media type 186 that can be used to transport those body parts. 188 This document also discusses how to use the multipart/signed media 189 type defined in [RFC1847] to transport S/MIME signed messages. 190 multipart/signed is used in conjunction with the 191 application/pkcs7-signature media type, which is used to transport a 192 detached S/MIME signature. 194 In order to create S/MIME messages, an S/MIME agent MUST follow the 195 specifications in this document, as well as the specifications listed 196 in the Cryptographic Message Syntax document [CMS], [RFC3370], 197 [RFC4056], [RFC3560], and [RFC5754]. 199 Throughout this specification, there are requirements and 200 recommendations made for how receiving agents handle incoming 201 messages. There are separate requirements and recommendations for 202 how sending agents create outgoing messages. In general, the best 203 strategy is to "be liberal in what you receive and conservative in 204 what you send". Most of the requirements are placed on the handling 205 of incoming messages, while the recommendations are mostly on the 206 creation of outgoing messages. 208 The separation for requirements on receiving agents and sending 209 agents also derives from the likelihood that there will be S/MIME 210 systems that involve software other than traditional Internet mail 211 clients. S/MIME can be used with any system that transports MIME 212 data. An automated process that sends an encrypted message might not 213 be able to receive an encrypted message at all, for example. Thus, 214 the requirements and recommendations for the two types of agents are 215 listed separately when appropriate. 217 1.2. Definitions 219 For the purposes of this specification, the following definitions 220 apply. 222 ASN.1: Abstract Syntax Notation One, as defined in ITU-T 223 Recommendations X.680, X.681, X.682 and X.683 224 [ASN.1]. 226 BER: Basic Encoding Rules for ASN.1, as defined in ITU- 227 T Recommendation X.690 [X.690]. 229 Certificate: A type that binds an entity's name to a public key 230 with a digital signature. 232 DER: Distinguished Encoding Rules for ASN.1, as defined 233 in ITU-T Recommendation X.690 [X.690]. 235 7-bit data: Text data with lines less than 998 characters 236 long, where none of the characters have the 8th 237 bit set, and there are no NULL characters. 238 and occur only as part of a end-of- 239 line delimiter. 241 8-bit data: Text data with lines less than 998 characters, and 242 where none of the characters are NULL characters. 243 and occur only as part of a 244 end-of-line delimiter. 246 Binary data: Arbitrary data. 248 Transfer encoding: A reversible transformation made on data so 8-bit 249 or binary data can be sent via a channel that only 250 transmits 7-bit data. 252 Receiving agent: Software that interprets and processes S/MIME CMS 253 objects, MIME body parts that contain CMS content 254 types, or both. 256 Sending agent: Software that creates S/MIME CMS content types, 257 MIME body parts that contain CMS content types, or 258 both. 260 S/MIME agent: User software that is a receiving agent, a sending 261 agent, or both. 263 Data Integrity Service: A security service that protects againist 264 unauthorized changes to data by insuring that 265 changes to the data are detectable. [RFC4949] 267 Data Confidentiality: The property that data is not discolsed to 268 system entities unless they have been authorize to 269 know the data. [RFC4949] 271 Data Origination: The corroboration that the source of the data 272 received is as claimed. [RFC4949]. 274 1.3. Conventions Used in This Document 276 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 277 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 278 document are to be interpreted as described in [RFC2119]. 280 We define some additional terms here: 282 SHOULD+ This term means the same as SHOULD. However, the authors 283 expect that a requirement marked as SHOULD+ will be 284 promoted at some future time to be a MUST. 286 SHOULD- This term means the same as SHOULD. However, the authors 287 expect that a requirement marked as SHOULD- will be demoted 288 to a MAY in a future version of this document. 290 MUST- This term means the same as MUST. However, the authors 291 expect that this requirement will no longer be a MUST in a 292 future document. Although its status will be determined at 293 a later time, it is reasonable to expect that if a future 294 revision of a document alters the status of a MUST- 295 requirement, it will remain at least a SHOULD or a SHOULD-. 297 1.4. Compatibility with Prior Practice of S/MIME 299 S/MIME version 4.0 agents ought to attempt to have the greatest 300 interoperability possible with agents for prior versions of S/MIME. 301 S/MIME version 2 is described in RFC 2311 through RFC 2315 inclusive 302 [SMIMEv2], S/MIME version 3 is described in RFC 2630 through RFC 2634 303 inclusive and RFC 5035 [SMIMEv3], S/MIME version 3.1 is described in 304 RFC 3850, RFC 3851, RFC 3852, RFC 2634, and RFC 5035 [SMIMEv3.1], and 305 S/MIME version 3.2 is described in [SMIMEv3.2]. [RFC2311] also has 306 historical information about the development of S/MIME. 308 1.5. Changes from S/MIME v3 to S/MIME v3.1 310 The RSA public key algorithm was changed to a MUST implement key 311 wrapping algorithm, and the Diffie-Hellman (DH) algorithm changed to 312 a SHOULD implement. 314 The AES symmetric encryption algorithm has been included as a SHOULD 315 implement. 317 The RSA public key algorithm was changed to a MUST implement 318 signature algorithm. 320 Ambiguous language about the use of "empty" SignedData messages to 321 transmit certificates was clarified to reflect that transmission of 322 Certificate Revocation Lists is also allowed. 324 The use of binary encoding for some MIME entities is now explicitly 325 discussed. 327 Header protection through the use of the message/rfc822 media type 328 has been added. 330 Use of the CompressedData CMS type is allowed, along with required 331 media type and file extension additions. 333 1.6. Changes from S/MIME v3.1 to S/MIME v3.2 335 Editorial changes, e.g., replaced "MIME type" with "media type", 336 content-type with Content-Type. 338 Moved "Conventions Used in This Document" to Section 1.3. Added 339 definitions for SHOULD+, SHOULD-, and MUST-. 341 Section 1.1 and Appendix A: Added references to RFCs for RSASSA-PSS, 342 RSAES-OAEP, and SHA2 CMS algorithms. Added CMS Multiple Signers 343 Clarification to CMS reference. 345 Section 1.2: Updated references to ASN.1 to X.680 and BER and DER to 346 X.690. 348 Section 1.4: Added references to S/MIME MSG 3.1 RFCs. 350 Section 2.1 (digest algorithm): SHA-256 added as MUST, SHA-1 and MD5 351 made SHOULD-. 353 Section 2.2 (signature algorithms): RSA with SHA-256 added as MUST, 354 and DSA with SHA-256 added as SHOULD+, RSA with SHA-1, DSA with 355 SHA-1, and RSA with MD5 changed to SHOULD-, and RSASSA-PSS with 356 SHA-256 added as SHOULD+. Also added note about what S/MIME v3.1 357 clients support. 359 Section 2.3 (key encryption): DH changed to SHOULD-, and RSAES-OAEP 360 added as SHOULD+. Elaborated requirements for key wrap algorithm. 362 Section 2.5.1: Added requirement that receiving agents MUST support 363 both GeneralizedTime and UTCTime. 365 Section 2.5.2: Replaced reference "sha1WithRSAEncryption" with 366 "sha256WithRSAEncryption", "DES-3EDE-CBC" with "AES-128 CBC", and 367 deleted the RC5 example. 369 Section 2.5.2.1: Deleted entire section (discussed deprecated RC2). 371 Section 2.7, 2.7.1, Appendix A: references to RC2/40 removed. 373 Section 2.7 (content encryption): AES-128 CBC added as MUST, AES-192 374 and AES-256 CBC SHOULD+, tripleDES now SHOULD-. 376 Section 2.7.1: Updated pointers from 2.7.2.1 through 2.7.2.4 to 377 2.7.1.1 to 2.7.1.2. 379 Section 3.1.1: Removed text about MIME character sets. 381 Section 3.2.2 and 3.6: Replaced "encrypted" with "enveloped". Update 382 OID example to use AES-128 CBC oid. 384 Section 3.4.3.2: Replace micalg parameter for SHA-1 with sha-1. 386 Section 4: Updated reference to CERT v3.2. 388 Section 4.1: Updated RSA and DSA key size discussion. Moved last 389 four sentences to security considerations. Updated reference to 390 randomness requirements for security. 392 Section 5: Added IANA registration templates to update media type 393 registry to point to this document as opposed to RFC 2311. 395 Section 6: Updated security considerations. 397 Section 7: Moved references from Appendix B to this section. Updated 398 references. Added informational references to SMIMEv2, SMIMEv3, and 399 SMIMEv3.1. 401 Appendix C: Added Appendix C to move S/MIME v2 to Historic status. 403 1.7. Changes for S/MIME v4.0 405 - Add the use of AuthEnvelopedData, including defining and 406 registering an smime-type value (Section 2.4.4 and Section 3.4). 408 - Update the content encryption algorithms (Section 2.7 and 409 Section 2.7.1.2): Add AES-256 GCM, add ChaCha200-Poly1305, remove 410 AES-192 CBC, mark tripleDES as historic. 412 - Update the set of signature algorithms (Section 2.2: Add EdDSA and 413 ECDSA, mark DSA as historic 415 - Update the set of digest algorithms (Section 2.1: Add SHA-512, 416 mark SHA-1 as historic. 418 - Update the size of keys to be used for RSA encryption and RSA 419 signing (Section 4). 421 - Create Appendix B which deals with considerations for dealing with 422 historic email messages. 424 2. CMS Options 426 CMS allows for a wide variety of options in content, attributes, and 427 algorithm support. This section puts forth a number of support 428 requirements and recommendations in order to achieve a base level of 429 interoperability among all S/MIME implementations. [RFC3370] and 430 [RFC5754] provides additional details regarding the use of the 431 cryptographic algorithms. [ESS] provides additional details 432 regarding the use of additional attributes. 434 2.1. DigestAlgorithmIdentifier 436 The algorithms here are used for digesting the body of the message 437 and are not the same as the digest algorithms used as part the 438 signature algorithms. The result of this is placed in the message- 439 digest attribute of the signed attributes. It is RECOMMENDED that 440 the algorithm used for digesting the body of the message be of 441 similar or greater strength than the signature algorithm. 443 Sending and Receiving agents: 445 - MUST support SHA-256. 447 - MUST support SHA-512. 449 [RFC5754] provides the details for using these algorithms with 450 S/MIME. 452 2.2. SignatureAlgorithmIdentifier 454 Receiving agents: 456 - MUST support ECDSA with curve P-256 and SHA-256. 458 - MUST support EdDSA with curve 25519 using PureEdDSA mode. 460 - MUST- support RSA with SHA-256. 462 - SHOULD support RSASSA-PSS with SHA-256. 464 - MUST NOT support EdDSA using the pre-hash mode. 466 Sending agents: 468 - MUST support at least one of the following algorithms: ECDSA with 469 curve P-256 and SHA-256, or EdDSA with curve 25519 using PureEdDSA 470 mode. 472 - MUST- support RSA with SHA-256. 474 - SHOULD support RSASSA-PSS with SHA-256. 476 - MUST NOT support EdDSA using the pre-hash mode. 478 Both ECDSA and EdDSA are included in the list of required algorithms 479 for political reasons. NIST is unable to provide the seeds that were 480 used to create their standardized curves, this means that there is a 481 section of the community which believes that there might be a 482 backdoor to these curves. The EdDSA curves were, in part, created in 483 response to this feeling. However, there are still significant 484 sections of the industry which need to have NIST approved algorithms. 485 For this reason, both sets of curves are represented in the recieving 486 agent list, but there is only a requirement for curve in the sending 487 agent list. 489 See Section 4.1 for information on key size and algorithm references. 491 2.3. KeyEncryptionAlgorithmIdentifier 493 Receiving and sending agents: 495 - MUST support ECDH ephemeral-static mode for P-256, as specified in 496 [RFC5753]. 498 - MUST support ECDH ephemeral-static mode for X25519 using HKDF-256 499 for the KDF, as specified in 500 [I-D.ietf-curdle-cms-ecdh-new-curves]. 502 - MUST- support RSA Encryption, as specified in [RFC3370]. 504 - SHOULD+ support RSAES-OAEP, as specified in [RFC3560]. 506 When ECDH ephemeral-static is used, a key wrap algorithm is also 507 specified in the KeyEncryptionAlgorithmIdentifier [RFC5652]. The 508 underlying encryption functions for the key wrap and content 509 encryption algorithm ([RFC3370] and [RFC3565]) and the key sizes for 510 the two algorithms MUST be the same (e.g., AES-128 key wrap algorithm 511 with AES-128 content encryption algorithm). As both 128 and 256 bit 512 AES modes are mandatory-to-implment as content encryption algorithms 513 (Section 2.7), both the AES-128 and AES-256 key wrap algorithms MUST 514 be supported when ECDH ephemeral-static is used. 516 Appendix B provides information on algorithms support in older 517 versions of S/MIME. 519 2.4. General Syntax 521 There are several CMS content types. Of these, only the Data, 522 SignedData, EnvelopedData, AuthEnvelopedData, and CompressedData 523 content types are currently used for S/MIME. 525 2.4.1. Data Content Type 527 Sending agents MUST use the id-data content type identifier to 528 identify the "inner" MIME message content. For example, when 529 applying a digital signature to MIME data, the CMS SignedData 530 encapContentInfo eContentType MUST include the id-data object 531 identifier and the media type MUST be stored in the SignedData 532 encapContentInfo eContent OCTET STRING (unless the sending agent is 533 using multipart/signed, in which case the eContent is absent, per 534 Section 3.5.3 of this document). As another example, when applying 535 encryption to MIME data, the CMS EnvelopedData encryptedContentInfo 536 contentType MUST include the id-data object identifier and the 537 encrypted MIME content MUST be stored in the EnvelopedData 538 encryptedContentInfo encryptedContent OCTET STRING. 540 2.4.2. SignedData Content Type 542 Sending agents MUST use the SignedData content type to apply a 543 digital signature to a message or, in a degenerate case where there 544 is no signature information, to convey certificates. Applying a 545 signature to a message provides authentication, message integrity, 546 and non-repudiation of origin. 548 2.4.3. EnvelopedData Content Type 550 This content type is used to apply data confidentiality to a message. 551 A sender needs to have access to a public key for each intended 552 message recipient to use this service. 554 2.4.4. AuthEnvelopedData Content Type 556 This content type is used to apply data confidentiality and message 557 integrity to a message. This content type does not provide 558 authentication or non-repudiation. A sender needs to have access to 559 a public key for each intended message recipient to use this service. 561 2.4.5. CompressedData Content Type 563 This content type is used to apply data compression to a message. 564 This content type does not provide authentication, message integrity, 565 non-repudiation, or data confidentiality, and is only used to reduce 566 the message's size. 568 See Section 3.7 for further guidance on the use of this type in 569 conjunction with other CMS types. 571 2.5. Attributes and the SignerInfo Type 573 The SignerInfo type allows the inclusion of unsigned and signed 574 attributes along with a signature. 576 Receiving agents MUST be able to handle zero or one instance of each 577 of the signed attributes listed here. Sending agents SHOULD generate 578 one instance of each of the following signed attributes in each 579 S/MIME message: 581 - Signing Time (Section 2.5.1 in this document) 583 - SMIME Capabilities (Section 2.5.2 in this document) 585 - Encryption Key Preference (Section 2.5.3 in this document) 587 - Message Digest (Section 11.2 in [RFC5652]) 589 - Content Type (Section 11.1 in [RFC5652]) 591 Further, receiving agents SHOULD be able to handle zero or one 592 instance of the signingCertificate and signingCertificatev2 signed 593 attributes, as defined in Section 5 of RFC 2634 [ESS] and Section 3 594 of RFC 5035 [ESS]. 596 Sending agents SHOULD generate one instance of the signingCertificate 597 or signingCertificatev2 signed attribute in each SignerInfo 598 structure. 600 Additional attributes and values for these attributes might be 601 defined in the future. Receiving agents SHOULD handle attributes or 602 values that they do not recognize in a graceful manner. 604 Interactive sending agents that include signed attributes that are 605 not listed here SHOULD display those attributes to the user, so that 606 the user is aware of all of the data being signed. 608 2.5.1. Signing Time Attribute 610 The signing-time attribute is used to convey the time that a message 611 was signed. The time of signing will most likely be created by a 612 message originator and therefore is only as trustworthy as the 613 originator. 615 Sending agents MUST encode signing time through the year 2049 as 616 UTCTime; signing times in 2050 or later MUST be encoded as 617 GeneralizedTime. When the UTCTime CHOICE is used, S/MIME agents MUST 618 interpret the year field (YY) as follows: 620 If YY is greater than or equal to 50, the year is interpreted as 621 19YY; if YY is less than 50, the year is interpreted as 20YY. 623 Receiving agents MUST be able to process signing-time attributes that 624 are encoded in either UTCTime or GeneralizedTime. 626 2.5.2. SMIME Capabilities Attribute 628 The SMIMECapabilities attribute includes signature algorithms (such 629 as "sha256WithRSAEncryption"), symmetric algorithms (such as "AES-128 630 CBC"), authenticated symmetric algorithms (such as "AES-128 GCM") and 631 key encipherment algorithms (such as "rsaEncryption"). There are 632 also several identifiers that indicate support for other optional 633 features such as binary encoding and compression. The 634 SMIMECapabilities were designed to be flexible and extensible so 635 that, in the future, a means of identifying other capabilities and 636 preferences such as certificates can be added in a way that will not 637 cause current clients to break. 639 If present, the SMIMECapabilities attribute MUST be a 640 SignedAttribute; it MUST NOT be an UnsignedAttribute. CMS defines 641 SignedAttributes as a SET OF Attribute. The SignedAttributes in a 642 signerInfo MUST NOT include multiple instances of the 643 SMIMECapabilities attribute. CMS defines the ASN.1 syntax for 644 Attribute to include attrValues SET OF AttributeValue. A 645 SMIMECapabilities attribute MUST only include a single instance of 646 AttributeValue. There MUST NOT be zero or multiple instances of 647 AttributeValue present in the attrValues SET OF AttributeValue. 649 The semantics of the SMIMECapabilities attribute specify a partial 650 list as to what the client announcing the SMIMECapabilities can 651 support. A client does not have to list every capability it 652 supports, and need not list all its capabilities so that the 653 capabilities list doesn't get too long. In an SMIMECapabilities 654 attribute, the object identifiers (OIDs) are listed in order of their 655 preference, but SHOULD be separated logically along the lines of 656 their categories (signature algorithms, symmetric algorithms, key 657 encipherment algorithms, etc.). 659 The structure of the SMIMECapabilities attribute is to facilitate 660 simple table lookups and binary comparisons in order to determine 661 matches. For instance, the DER-encoding for the SMIMECapability for 662 AES-128 CBC MUST be identically encoded regardless of the 663 implementation. Because of the requirement for identical encoding, 664 individuals documenting algorithms to be used in the 665 SMIMECapabilities attribute SHOULD explicitly document the correct 666 byte sequence for the common cases. 668 For any capability, the associated parameters for the OID MUST 669 specify all of the parameters necessary to differentiate between two 670 instances of the same algorithm. 672 The OIDs that correspond to algorithms SHOULD use the same OID as the 673 actual algorithm, except in the case where the algorithm usage is 674 ambiguous from the OID. For instance, in an earlier specification, 675 rsaEncryption was ambiguous because it could refer to either a 676 signature algorithm or a key encipherment algorithm. In the event 677 that an OID is ambiguous, it needs to be arbitrated by the maintainer 678 of the registered SMIMECapabilities list as to which type of 679 algorithm will use the OID, and a new OID MUST be allocated under the 680 smimeCapabilities OID to satisfy the other use of the OID. 682 The registered SMIMECapabilities list specifies the parameters for 683 OIDs that need them, most notably key lengths in the case of 684 variable-length symmetric ciphers. In the event that there are no 685 differentiating parameters for a particular OID, the parameters MUST 686 be omitted, and MUST NOT be encoded as NULL. Additional values for 687 the SMIMECapabilities attribute might be defined in the future. 688 Receiving agents MUST handle a SMIMECapabilities object that has 689 values that it does not recognize in a graceful manner. 691 Section 2.7.1 explains a strategy for caching capabilities. 693 2.5.3. Encryption Key Preference Attribute 695 The encryption key preference attribute allows the signer to 696 unambiguously describe which of the signer's certificates has the 697 signer's preferred encryption key. This attribute is designed to 698 enhance behavior for interoperating with those clients that use 699 separate keys for encryption and signing. This attribute is used to 700 convey to anyone viewing the attribute which of the listed 701 certificates is appropriate for encrypting a session key for future 702 encrypted messages. 704 If present, the SMIMEEncryptionKeyPreference attribute MUST be a 705 SignedAttribute; it MUST NOT be an UnsignedAttribute. CMS defines 706 SignedAttributes as a SET OF Attribute. The SignedAttributes in a 707 signerInfo MUST NOT include multiple instances of the 708 SMIMEEncryptionKeyPreference attribute. CMS defines the ASN.1 syntax 709 for Attribute to include attrValues SET OF AttributeValue. A 710 SMIMEEncryptionKeyPreference attribute MUST only include a single 711 instance of AttributeValue. There MUST NOT be zero or multiple 712 instances of AttributeValue present in the attrValues SET OF 713 AttributeValue. 715 The sending agent SHOULD include the referenced certificate in the 716 set of certificates included in the signed message if this attribute 717 is used. The certificate MAY be omitted if it has been previously 718 made available to the receiving agent. Sending agents SHOULD use 719 this attribute if the commonly used or preferred encryption 720 certificate is not the same as the certificate used to sign the 721 message. 723 Receiving agents SHOULD store the preference data if the signature on 724 the message is valid and the signing time is greater than the 725 currently stored value. (As with the SMIMECapabilities, the clock 726 skew SHOULD be checked and the data not used if the skew is too 727 great.) Receiving agents SHOULD respect the sender's encryption key 728 preference attribute if possible. This, however, represents only a 729 preference and the receiving agent can use any certificate in 730 replying to the sender that is valid. 732 Section 2.7.1 explains a strategy for caching preference data. 734 2.5.3.1. Selection of Recipient Key Management Certificate 736 In order to determine the key management certificate to be used when 737 sending a future CMS EnvelopedData message for a particular 738 recipient, the following steps SHOULD be followed: 740 - If an SMIMEEncryptionKeyPreference attribute is found in a 741 SignedData object received from the desired recipient, this 742 identifies the X.509 certificate that SHOULD be used as the X.509 743 key management certificate for the recipient. 745 - If an SMIMEEncryptionKeyPreference attribute is not found in a 746 SignedData object received from the desired recipient, the set of 747 X.509 certificates SHOULD be searched for a X.509 certificate with 748 the same subject name as the signer of a X.509 certificate that 749 can be used for key management. 751 - Or use some other method of determining the user's key management 752 key. If a X.509 key management certificate is not found, then 753 encryption cannot be done with the signer of the message. If 754 multiple X.509 key management certificates are found, the S/MIME 755 agent can make an arbitrary choice between them. 757 2.6. SignerIdentifier SignerInfo Type 759 S/MIME v4.0 implementations MUST support both issuerAndSerialNumber 760 and subjectKeyIdentifier. Messages that use the subjectKeyIdentifier 761 choice cannot be read by S/MIME v2 clients. 763 It is important to understand that some certificates use a value for 764 subjectKeyIdentifier that is not suitable for uniquely identifying a 765 certificate. Implementations MUST be prepared for multiple 766 certificates for potentially different entities to have the same 767 value for subjectKeyIdentifier, and MUST be prepared to try each 768 matching certificate during signature verification before indicating 769 an error condition. 771 2.7. ContentEncryptionAlgorithmIdentifier 773 Sending and receiving agents: 775 - MUST support encryption and decryption with AES-128 GCM and 776 AES-256 GCM [RFC5084]. 778 - MUST- support encryption and decryption with AES-128 CBC 779 [RFC3565]. 781 - SHOULD+ support encryption and decryption with ChaCha20-Poly1305 782 [RFC7905]. 784 2.7.1. Deciding Which Encryption Method to Use 786 When a sending agent creates an encrypted message, it has to decide 787 which type of encryption to use. The decision process involves using 788 information garnered from the capabilities lists included in messages 789 received from the recipient, as well as out-of-band information such 790 as private agreements, user preferences, legal restrictions, and so 791 on. 793 Section 2.5.2 defines a method by which a sending agent can 794 optionally announce, among other things, its decrypting capabilities 795 in its order of preference. The following method for processing and 796 remembering the encryption capabilities attribute in incoming signed 797 messages SHOULD be used. 799 - If the receiving agent has not yet created a list of capabilities 800 for the sender's public key, then, after verifying the signature 801 on the incoming message and checking the timestamp, the receiving 802 agent SHOULD create a new list containing at least the signing 803 time and the symmetric capabilities. 805 - If such a list already exists, the receiving agent SHOULD verify 806 that the signing time in the incoming message is greater than the 807 signing time stored in the list and that the signature is valid. 808 If so, the receiving agent SHOULD update both the signing time and 809 capabilities in the list. Values of the signing time that lie far 810 in the future (that is, a greater discrepancy than any reasonable 811 clock skew), or a capabilities list in messages whose signature 812 could not be verified, MUST NOT be accepted. 814 The list of capabilities SHOULD be stored for future use in creating 815 messages. 817 Before sending a message, the sending agent MUST decide whether it is 818 willing to use weak encryption for the particular data in the 819 message. If the sending agent decides that weak encryption is 820 unacceptable for this data, then the sending agent MUST NOT use a 821 weak algorithm. The decision to use or not use weak encryption 822 overrides any other decision in this section about which encryption 823 algorithm to use. 825 Section 2.7.1.1 and Section 2.7.1.2 describe the decisions a sending 826 agent SHOULD use in deciding which type of encryption will be applied 827 to a message. These rules are ordered, so the sending agent SHOULD 828 make its decision in the order given. 830 2.7.1.1. Rule 1: Known Capabilities 832 If the sending agent has received a set of capabilities from the 833 recipient for the message the agent is about to encrypt, then the 834 sending agent SHOULD use that information by selecting the first 835 capability in the list (that is, the capability most preferred by the 836 intended recipient) that the sending agent knows how to encrypt. The 837 sending agent SHOULD use one of the capabilities in the list if the 838 agent reasonably expects the recipient to be able to decrypt the 839 message. 841 2.7.1.2. Rule 2: Unknown Capabilities, Unknown Version of S/MIME 843 If the following two conditions are met: 845 - the sending agent has no knowledge of the encryption capabilities 846 of the recipient, and 848 - the sending agent has no knowledge of the version of S/MIME of the 849 recipient, 851 then the sending agent SHOULD use AES-256 GCM because it is a 852 stronger algorithm and is required by S/MIME v4.0. If the sending 853 agent chooses not to use AES-256 GCM in this step, it SHOULD use 854 AES-128 CBC. 856 2.7.2. Choosing Weak Encryption 858 All algorithms that use 112-bit keys are considered by many to be 859 weak encryption. A sending agent that is controlled by a human 860 SHOULD allow a human sender to determine the risks of sending data 861 using a weak encryption algorithm before sending the data, and 862 possibly allow the human to use a stronger encryption method such as 863 AES GCM or AES CBC. 865 2.7.3. Multiple Recipients 867 If a sending agent is composing an encrypted message to a group of 868 recipients where the encryption capabilities of some of the 869 recipients do not overlap, the sending agent is forced to send more 870 than one message. Please note that if the sending agent chooses to 871 send a message encrypted with a strong algorithm, and then send the 872 same message encrypted with a weak algorithm, someone watching the 873 communications channel could learn the contents of the strongly 874 encrypted message simply by decrypting the weakly encrypted message. 876 3. Creating S/MIME Messages 878 This section describes the S/MIME message formats and how they are 879 created. S/MIME messages are a combination of MIME bodies and CMS 880 content types. Several media types as well as several CMS content 881 types are used. The data to be secured is always a canonical MIME 882 entity. The MIME entity and other data, such as certificates and 883 algorithm identifiers, are given to CMS processing facilities that 884 produce a CMS object. Finally, the CMS object is wrapped in MIME. 885 The Enhanced Security Services for S/MIME [ESS] document provides 886 descriptions of how nested, secured S/MIME messages are formatted. 887 ESS provides a description of how a triple-wrapped S/MIME message is 888 formatted using multipart/signed and application/pkcs7-mime for the 889 signatures. 891 S/MIME provides one format for enveloped-only data, several formats 892 for signed-only data, and several formats for signed and enveloped 893 data. Several formats are required to accommodate several 894 environments, in particular for signed messages. The criteria for 895 choosing among these formats are also described. 897 The reader of this section is expected to understand MIME as 898 described in [MIME-SPEC] and [RFC1847]. 900 3.1. Preparing the MIME Entity for Signing, Enveloping, or Compressing 902 S/MIME is used to secure MIME entities. A MIME entity can be a sub- 903 part, sub-parts of a message, or the whole message with all its sub- 904 parts. A MIME entity that is the whole message includes only the 905 MIME message headers and MIME body, and does not include the RFC-822 906 header. Note that S/MIME can also be used to secure MIME entities 907 used in applications other than Internet mail. If protection of the 908 RFC-822 header is required, the use of the message/rfc822 media type 909 is explained later in this section. 911 The MIME entity that is secured and described in this section can be 912 thought of as the "inside" MIME entity. That is, it is the 913 "innermost" object in what is possibly a larger MIME message. 914 Processing "outside" MIME entities into CMS content types is 915 described in Section 3.2, Section 3.5, and elsewhere. 917 The procedure for preparing a MIME entity is given in [MIME-SPEC]. 918 The same procedure is used here with some additional restrictions 919 when signing. The description of the procedures from [MIME-SPEC] is 920 repeated here, but it is suggested that the reader refer to that 921 document for the exact procedure. This section also describes 922 additional requirements. 924 A single procedure is used for creating MIME entities that are to 925 have any combination of signing, enveloping, and compressing applied. 926 Some additional steps are recommended to defend against known 927 corruptions that can occur during mail transport that are of 928 particular importance for clear-signing using the multipart/signed 929 format. It is recommended that these additional steps be performed 930 on enveloped messages, or signed and enveloped messages, so that the 931 message can be forwarded to any environment without modification. 933 These steps are descriptive rather than prescriptive. The 934 implementer is free to use any procedure as long as the result is the 935 same. 937 Step 1. The MIME entity is prepared according to the local 938 conventions. 940 Step 2. The leaf parts of the MIME entity are converted to canonical 941 form. 943 Step 3. Appropriate transfer encoding is applied to the leaves of 944 the MIME entity. 946 When an S/MIME message is received, the security services on the 947 message are processed, and the result is the MIME entity. That MIME 948 entity is typically passed to a MIME-capable user agent where it is 949 further decoded and presented to the user or receiving application. 951 In order to protect outer, non-content-related message header fields 952 (for instance, the "Subject", "To", "From", and "Cc" fields), the 953 sending client MAY wrap a full MIME message in a message/rfc822 954 wrapper in order to apply S/MIME security services to these header 955 fields. It is up to the receiving client to decide how to present 956 this "inner" header along with the unprotected "outer" header. 958 When an S/MIME message is received, if the top-level protected MIME 959 entity has a Content-Type of message/rfc822, it can be assumed that 960 the intent was to provide header protection. This entity SHOULD be 961 presented as the top-level message, taking into account header 962 merging issues as previously discussed. 964 3.1.1. Canonicalization 966 Each MIME entity MUST be converted to a canonical form that is 967 uniquely and unambiguously representable in the environment where the 968 signature is created and the environment where the signature will be 969 verified. MIME entities MUST be canonicalized for enveloping and 970 compressing as well as signing. 972 The exact details of canonicalization depend on the actual media type 973 and subtype of an entity, and are not described here. Instead, the 974 standard for the particular media type SHOULD be consulted. For 975 example, canonicalization of type text/plain is different from 976 canonicalization of audio/basic. Other than text types, most types 977 have only one representation regardless of computing platform or 978 environment that can be considered their canonical representation. 979 In general, canonicalization will be performed by the non-security 980 part of the sending agent rather than the S/MIME implementation. 982 The most common and important canonicalization is for text, which is 983 often represented differently in different environments. MIME 984 entities of major type "text" MUST have both their line endings and 985 character set canonicalized. The line ending MUST be the pair of 986 characters , and the charset SHOULD be a registered charset 987 [CHARSETS]. The details of the canonicalization are specified in 988 [MIME-SPEC]. 990 Note that some charsets such as ISO-2022 have multiple 991 representations for the same characters. When preparing such text 992 for signing, the canonical representation specified for the charset 993 MUST be used. 995 3.1.2. Transfer Encoding 997 When generating any of the secured MIME entities below, except the 998 signing using the multipart/signed format, no transfer encoding is 999 required at all. S/MIME implementations MUST be able to deal with 1000 binary MIME objects. If no Content-Transfer-Encoding header field is 1001 present, the transfer encoding is presumed to be 7BIT. 1003 S/MIME implementations SHOULD however use transfer encoding described 1004 in Section 3.1.3 for all MIME entities they secure. The reason for 1005 securing only 7-bit MIME entities, even for enveloped data that are 1006 not exposed to the transport, is that it allows the MIME entity to be 1007 handled in any environment without changing it. For example, a 1008 trusted gateway might remove the envelope, but not the signature, of 1009 a message, and then forward the signed message on to the end 1010 recipient so that they can verify the signatures directly. If the 1011 transport internal to the site is not 8-bit clean, such as on a wide- 1012 area network with a single mail gateway, verifying the signature will 1013 not be possible unless the original MIME entity was only 7-bit data. 1015 S/MIME implementations that "know" that all intended recipients are 1016 capable of handling inner (all but the outermost) binary MIME objects 1017 SHOULD use binary encoding as opposed to a 7-bit-safe transfer 1018 encoding for the inner entities. The use of a 7-bit-safe encoding 1019 (such as base64) would unnecessarily expand the message size. 1020 Implementations MAY "know" that recipient implementations are capable 1021 of handling inner binary MIME entities either by interpreting the id- 1022 cap-preferBinaryInside SMIMECapabilities attribute, by prior 1023 agreement, or by other means. 1025 If one or more intended recipients are unable to handle inner binary 1026 MIME objects, or if this capability is unknown for any of the 1027 intended recipients, S/MIME implementations SHOULD use transfer 1028 encoding described in Section 3.1.3 for all MIME entities they 1029 secure. 1031 3.1.3. Transfer Encoding for Signing Using multipart/signed 1033 If a multipart/signed entity is ever to be transmitted over the 1034 standard Internet SMTP infrastructure or other transport that is 1035 constrained to 7-bit text, it MUST have transfer encoding applied so 1036 that it is represented as 7-bit text. MIME entities that are 7-bit 1037 data already need no transfer encoding. Entities such as 8-bit text 1038 and binary data can be encoded with quoted-printable or base-64 1039 transfer encoding. 1041 The primary reason for the 7-bit requirement is that the Internet 1042 mail transport infrastructure cannot guarantee transport of 8-bit or 1043 binary data. Even though many segments of the transport 1044 infrastructure now handle 8-bit and even binary data, it is sometimes 1045 not possible to know whether the transport path is 8-bit clean. If a 1046 mail message with 8-bit data were to encounter a message transfer 1047 agent that cannot transmit 8-bit or binary data, the agent has three 1048 options, none of which are acceptable for a clear-signed message: 1050 - The agent could change the transfer encoding; this would 1051 invalidate the signature. 1053 - The agent could transmit the data anyway, which would most likely 1054 result in the 8th bit being corrupted; this too would invalidate 1055 the signature. 1057 - The agent could return the message to the sender. 1059 [RFC1847] prohibits an agent from changing the transfer encoding of 1060 the first part of a multipart/signed message. If a compliant agent 1061 that cannot transmit 8-bit or binary data encounters a 1062 multipart/signed message with 8-bit or binary data in the first part, 1063 it would have to return the message to the sender as undeliverable. 1065 3.1.4. Sample Canonical MIME Entity 1067 This example shows a multipart/mixed message with full transfer 1068 encoding. This message contains a text part and an attachment. The 1069 sample message text includes characters that are not ASCII and thus 1070 need to be transfer encoded. Though not shown here, the end of each 1071 line is . The line ending of the MIME headers, the text, and 1072 the transfer encoded parts, all MUST be . 1074 Note that this example is not of an S/MIME message. 1076 Content-Type: multipart/mixed; boundary=bar 1078 --bar 1079 Content-Type: text/plain; charset=iso-8859-1 1080 Content-Transfer-Encoding: quoted-printable 1082 =A1Hola Michael! 1084 How do you like the new S/MIME specification? 1086 It's generally a good idea to encode lines that begin with 1087 From=20because some mail transport agents will insert a greater- 1088 than (>) sign, thus invalidating the signature. 1090 Also, in some cases it might be desirable to encode any =20 1091 trailing whitespace that occurs on lines in order to ensure =20 1092 that the message signature is not invalidated when passing =20 1093 a gateway that modifies such whitespace (like BITNET). =20 1095 --bar 1096 Content-Type: image/jpeg 1097 Content-Transfer-Encoding: base64 1099 iQCVAwUBMJrRF2N9oWBghPDJAQE9UQQAtl7LuRVndBjrk4EqYBIb3h5QXIX/LC// 1100 jJV5bNvkZIGPIcEmI5iFd9boEgvpirHtIREEqLQRkYNoBActFBZmh9GC3C041WGq 1101 uMbrbxc+nIs1TIKlA08rVi9ig/2Yh7LFrK5Ein57U/W72vgSxLhe/zhdfolT9Brn 1102 HOxEa44b+EI= 1104 --bar-- 1106 3.2. The application/pkcs7-mime Media Type 1108 The application/pkcs7-mime media type is used to carry CMS content 1109 types including EnvelopedData, SignedData, and CompressedData. The 1110 details of constructing these entities are described in subsequent 1111 sections. This section describes the general characteristics of the 1112 application/pkcs7-mime media type. 1114 The carried CMS object always contains a MIME entity that is prepared 1115 as described in Section 3.1 if the eContentType is id-data. Other 1116 contents MAY be carried when the eContentType contains different 1117 values. See [ESS] for an example of this with signed receipts. 1119 Since CMS content types are binary data, in most cases base-64 1120 transfer encoding is appropriate, in particular, when used with SMTP 1121 transport. The transfer encoding used depends on the transport 1122 through which the object is to be sent, and is not a characteristic 1123 of the media type. 1125 Note that this discussion refers to the transfer encoding of the CMS 1126 object or "outside" MIME entity. It is completely distinct from, and 1127 unrelated to, the transfer encoding of the MIME entity secured by the 1128 CMS object, the "inside" object, which is described in Section 3.1. 1130 Because there are several types of application/pkcs7-mime objects, a 1131 sending agent SHOULD do as much as possible to help a receiving agent 1132 know about the contents of the object without forcing the receiving 1133 agent to decode the ASN.1 for the object. The Content-Type header 1134 field of all application/pkcs7-mime objects SHOULD include the 1135 optional "smime-type" parameter, as described in the following 1136 sections. 1138 3.2.1. The name and filename Parameters 1140 For the application/pkcs7-mime, sending agents SHOULD emit the 1141 optional "name" parameter to the Content-Type field for compatibility 1142 with older systems. Sending agents SHOULD also emit the optional 1143 Content-Disposition field [RFC2138] with the "filename" parameter. 1144 If a sending agent emits the above parameters, the value of the 1145 parameters SHOULD be a file name with the appropriate extension: 1147 Media Type File 1148 Extension 1149 application/pkcs7-mime (SignedData, EnvelopedData) .p7m 1150 application/pkcs7-mime (degenerate SignedData certificate .p7c 1151 management message) 1152 application/pkcs7-mime (CompressedData) .p7z 1153 application/pkcs7-signature (SignedData) .p7s 1155 In addition, the file name SHOULD be limited to eight characters 1156 followed by a three-letter extension. The eight-character filename 1157 base can be any distinct name; the use of the filename base "smime" 1158 SHOULD be used to indicate that the MIME entity is associated with 1159 S/MIME. 1161 Including a file name serves two purposes. It facilitates easier use 1162 of S/MIME objects as files on disk. It also can convey type 1163 information across gateways. When a MIME entity of type 1164 application/pkcs7-mime (for example) arrives at a gateway that has no 1165 special knowledge of S/MIME, it will default the entity's media type 1166 to application/octet-stream and treat it as a generic attachment, 1167 thus losing the type information. However, the suggested filename 1168 for an attachment is often carried across a gateway. This often 1169 allows the receiving systems to determine the appropriate application 1170 to hand the attachment off to, in this case, a stand-alone S/MIME 1171 processing application. Note that this mechanism is provided as a 1172 convenience for implementations in certain environments. A proper 1173 S/MIME implementation MUST use the media types and MUST NOT rely on 1174 the file extensions. 1176 3.2.2. The smime-type Parameter 1178 The application/pkcs7-mime content type defines the optional "smime- 1179 type" parameter. The intent of this parameter is to convey details 1180 about the security applied (signed or enveloped) along with 1181 information about the contained content. This specification defines 1182 the following smime-types. 1184 Name CMS Type Inner Content 1185 enveloped-data EnvelopedData id-data 1186 signed-data SignedData id-data 1187 certs-only SignedData id-data 1188 compressed-data CompressedData id-data 1189 authEnvelopedData AuthEnvelopedData id-data 1191 In order for consistency to be obtained with future specifications, 1192 the following guidelines SHOULD be followed when assigning a new 1193 smime-type parameter. 1195 1. If both signing and encryption can be applied to the content, 1196 then three values for smime-type SHOULD be assigned "signed-*", 1197 "authEnv-*", and "enveloped-*". If one operation can be 1198 assigned, then this can be omitted. Thus, since "certs-only" can 1199 only be signed, "signed-" is omitted. 1201 2. A common string for a content OID SHOULD be assigned. We use 1202 "data" for the id-data content OID when MIME is the inner 1203 content. 1205 3. If no common string is assigned, then the common string of 1206 "OID." is recommended (for example, 1207 "OID.2.16.840.1.101.3.4.1.2" would be AES-128 CBC). 1209 It is explicitly intended that this field be a suitable hint for mail 1210 client applications to indicate whether a message is "signed", 1211 "authEnveloped" or "enveloped" without having to tunnel into the CMS 1212 payload. 1214 A registry for additional smime-type parameter values has been 1215 defined in [RFC7114]. 1217 3.3. Creating an Enveloped-Only Message 1219 This section describes the format for enveloping a MIME entity 1220 without signing it. It is important to note that sending enveloped 1221 but not signed messages does not provide for data integrity. It is 1222 possible to replace ciphertext in such a way that the processed 1223 message will still be valid, but the meaning can be altered. 1225 Step 1. The MIME entity to be enveloped is prepared according to 1226 Section 3.1. 1228 Step 2. The MIME entity and other required data is processed into a 1229 CMS object of type EnvelopedData. In addition to encrypting 1230 a copy of the content-encryption key for each recipient, a 1231 copy of the content-encryption key SHOULD be encrypted for 1232 the originator and included in the EnvelopedData (see 1233 [RFC5652], Section 6). 1235 Step 3. The EnvelopedData object is wrapped in a CMS ContentInfo 1236 object. 1238 Step 4. The ContentInfo object is inserted into an 1239 application/pkcs7-mime MIME entity. 1241 The smime-type parameter for enveloped-only messages is "enveloped- 1242 data". The file extension for this type of message is ".p7m". 1244 A sample message would be: 1246 Content-Type: application/pkcs7-mime; name=smime.p7m; 1247 smime-type=enveloped-data 1248 Content-Transfer-Encoding: base64 1249 Content-Disposition: attachment; filename=smime.p7m 1251 MIIBHgYJKoZIhvcNAQcDoIIBDzCCAQsCAQAxgcAwgb0CAQAwJjASMRAwDgYDVQQDEwdDYXJ 1252 sUlNBAhBGNGvHgABWvBHTbi7NXXHQMA0GCSqGSIb3DQEBAQUABIGAC3EN5nGIiJi2lsGPcP 1253 2iJ97a4e8kbKQz36zg6Z2i0yx6zYC4mZ7mX7FBs3IWg+f6KgCLx3M1eCbWx8+MDFbbpXadC 1254 DgO8/nUkUNYeNxJtuzubGgzoyEd8Ch4H/dd9gdzTd+taTEgS0ipdSJuNnkVY4/M652jKKHR 1255 LFf02hosdR8wQwYJKoZIhvcNAQcBMBQGCCqGSIb3DQMHBAgtaMXpRwZRNYAgDsiSf8Z9P43 1256 LrY4OxUk660cu1lXeCSFOSOpOJ7FuVyU= 1258 3.4. Creating an Authenticated Enveloped-Only Message 1260 This section describes the format for enveloping a MIME entity 1261 without signing it. Authenticated enveloped messages provide 1262 confidentiality and integrity. It is important to note that sending 1263 authenticated enveloped messages does not provide for authentication 1264 when using S/MIME. It is possible to replace ciphertext in such a 1265 way that the processed message will still be valid, but the meaning 1266 can be altered. However this is substantially more difficult than it 1267 is for an enveloped-only message as the 1269 Step 1. The MIME entity to be enveloped is prepared according to 1270 Section 3.1. 1272 Step 2. The MIME entity and other required data is processed into a 1273 CMS object of type AuthEnvelopedData. In addition to 1274 encrypting a copy of the content-encryption key for each 1275 recipient, a copy of the content-encryption key SHOULD be 1276 encrypted for the originator and included in the 1277 AuthEnvelopedData (see [RFC5083]). 1279 Step 3. The AuthEnvelopedData object is wrapped in a CMS ContentInfo 1280 object. 1282 Step 4. The ContentInfo object is inserted into an 1283 application/pkcs7-mime MIME entity. 1285 The smime-type parameter for authenticated enveloped-only messages is 1286 "authEnvelopedData". The file extension for this type of message is 1287 ".p7m". 1289 A sample message would be: 1291 Content-Type: application/pkcs7-mime; smime-type=authEnvelopedData; 1292 name=smime.p7m 1293 Content-Transfer-Encoding: base64 1294 Content-Disposition: attachment; filename=smime.p7m 1296 MIIDWQYLKoZIhvcNAQkQARegggNIMIIDRAIBADGBvjCBuwIBADAmMBIxEDAO 1297 BgNVBAMTB0NhcmxSU0ECEEY0a8eAAFa8EdNuLs1dcdAwCwYJKoZIhvcNAQEB 1298 BIGAgyZJo0ERTxA4xdTri5P5tVMyh0RARepTUCORZvlUbcUlaI8IpJZH3/J1 1299 Fv6MxTRS4O/K+ZcTlQmYeWLQvwdltQdOIP3mhpqXzTnOYhTK1IDtF2zx75Lg 1300 vE+ilpcLIzXfJB4RCBPtBWaHAof4Wb+VMQvLkk9OolX4mRSH1LPktgAwggJq 1301 BgkqhkiG9w0BBwEwGwYJYIZIAWUDBAEGMA4EDGPizioC9OHSsnNx4oCCAj7Y 1302 Cb8rOy8+55106newEJohC/aDgWbJhrMKzSOwa7JraXOV3HXD3NvKbl665dRx 1303 vmDwSCNaLCRU5q8/AxQx2SvnAbM+JKcEfC/VFdd4SiHNiUECAApLku2rMi5B 1304 WrhW/FXmx9d+cjum2BRwB3wj0q1wajdB0/kVRbQwg697dnlYyUog4vpJERjr 1305 7KAkawZx1RMHaM18wgZjUNpCBXFS3chQi9mTBp2i2Hf5iZ8OOtTx+rCQUmI6 1306 Jhy03vdcPCCARBjn3v0d3upZYDZddMA41CB9fKnnWFjadV1KpYwv80tqsEfx 1307 Vo0lJQ5VtJ8MHJiBpLVKadRIZ4iH2ULC0JtN5mXE1SrFKh7cqbJ4+7nqSRL3 1308 oBTud3rX41DGshOjpqcYHT4sqYlgZkc6dp0g1+hF1p3cGmjHdpysV2NVSUev 1309 ghHbvSqhIsXFzRSWKiZOigmlkv3R5LnjpYyP4brM62Jl7y0qborvV4dNMz7m 1310 D+5YxSlH0KAe8z6TT3LHuQdN7QCkFoiUSCaNhpAFaakkGIpqcqLhpOK4lXxt 1311 kptCG93eUwNCcTxtx6bXufPR5TUHohvZvfeqMp42kL37FJC/A8ZHoOxXy8+X 1312 X5QYxCQNuofWlvnIWv0Nr8w65x6lgVjPYmd/cHwzQKBTBMXN6pBud/PZL5zF 1313 tw3QHlQkBR+UflMWZKeN9L0KdQ27mQlCo5gQS85aifxoiiA2v9+0hxZw91rP 1314 IW4D+GS7oMMoKj8ZNyCJJsyf5smRZ+WxeBoolb3+TiGcBBCsRnfe6noLZiFO 1315 6Zeu2ZwE 1317 3.5. Creating a Signed-Only Message 1319 There are two formats for signed messages defined for S/MIME: 1321 - application/pkcs7-mime with SignedData. 1323 - multipart/signed. 1325 In general, the multipart/signed form is preferred for sending, and 1326 receiving agents MUST be able to handle both. 1328 3.5.1. Choosing a Format for Signed-Only Messages 1330 There are no hard-and-fast rules as to when a particular signed-only 1331 format is chosen. It depends on the capabilities of all the 1332 receivers and the relative importance of receivers with S/MIME 1333 facilities being able to verify the signature versus the importance 1334 of receivers without S/MIME software being able to view the message. 1336 Messages signed using the multipart/signed format can always be 1337 viewed by the receiver whether or not they have S/MIME software. 1338 They can also be viewed whether they are using a MIME-native user 1339 agent or they have messages translated by a gateway. In this 1340 context, "be viewed" means the ability to process the message 1341 essentially as if it were not a signed message, including any other 1342 MIME structure the message might have. 1344 Messages signed using the SignedData format cannot be viewed by a 1345 recipient unless they have S/MIME facilities. However, the 1346 SignedData format protects the message content from being changed by 1347 benign intermediate agents. Such agents might do line wrapping or 1348 content-transfer encoding changes that would break the signature. 1350 3.5.2. Signing Using application/pkcs7-mime with SignedData 1352 This signing format uses the application/pkcs7-mime media type. The 1353 steps to create this format are: 1355 Step 1. The MIME entity is prepared according to Section 3.1. 1357 Step 2. The MIME entity and other required data are processed into a 1358 CMS object of type SignedData. 1360 Step 3. The SignedData object is wrapped in a CMS ContentInfo 1361 object. 1363 Step 4. The ContentInfo object is inserted into an 1364 application/pkcs7-mime MIME entity. 1366 The smime-type parameter for messages using application/pkcs7-mime 1367 with SignedData is "signed-data". The file extension for this type 1368 of message is ".p7m". 1370 A sample message would be: 1372 Content-Type: application/pkcs7-mime; smime-type=signed-data; 1373 name=smime.p7m 1374 Content-Transfer-Encoding: base64 1375 Content-Disposition: attachment; filename=smime.p7m 1377 MIIDmQYJKoZIhvcNAQcCoIIDijCCA4YCAQExCTAHBgUrDgMCGjAtBgkqhkiG9w0BBwGgIAQ 1378 eDQpUaGlzIGlzIHNvbWUgc2FtcGxlIGNvbnRlbnQuoIIC4DCCAtwwggKboAMCAQICAgDIMA 1379 kGByqGSM44BAMwEjEQMA4GA1UEAxMHQ2FybERTUzAeFw05OTA4MTcwMTEwNDlaFw0zOTEyM 1380 zEyMzU5NTlaMBMxETAPBgNVBAMTCEFsaWNlRFNTMIIBtjCCASsGByqGSM44BAEwggEeAoGB 1381 AIGNze2D6gqeOT7CSCij5EeT3Q7XqA7sU8WrhAhP/5Thc0h+DNbzREjR/p+vpKGJL+HZMMg 1382 23j+bv7dM3F9piuR10DcMkQiVm96nXvn89J8v3UOoi1TxP7AHCEdNXYjDw7Wz41UIddU5dh 1383 DEeL3/nbCElzfy5FEbteQJllzzflvbAhUA4kemGkVmuBPG2o+4NyErYov3k80CgYAmONAUi 1384 TKqOfs+bdlLWWpMdiM5BAI1XPLLGjDDHlBd3ZtZ4s2qBT1YwHuiNrhuB699ikIlp/R1z0oI 1385 Xks+kPht6pzJIYo7dhTpzi5dowfNI4W4LzABfG1JiRGJNkS9+MiVSlNWteL5c+waYTYfEX/ 1386 Cve3RUP+YdMLRgUpgObo2OQOBhAACgYBc47ladRSWC6l63eM/qeysXty9txMRNKYWiSgRI9 1387 k0hmd1dRMSPUNbb+VRv/qJ8qIbPiR9PQeNW2PIu0WloErjhdbOBoA/6CN+GvIkq1MauCcNH 1388 u8Iv2YUgFxirGX6FYvxuzTU0pY39mFHssQyhPB+QUD9RqdjTjPypeL08oPluKOBgTB/MAwG 1389 A1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgbAMB8GA1UdIwQYMBaAFHBEPoIub4feStN14z0 1390 gvEMrk/EfMB0GA1UdDgQWBBS+bKGz48H37UNwpM4TAeL945f+zTAfBgNVHREEGDAWgRRBbG 1391 ljZURTU0BleGFtcGxlLmNvbTAJBgcqhkjOOAQDAzAAMC0CFFUMpBkfQiuJcSIzjYNqtT1na 1392 79FAhUAn2FTUlQLXLLd2ud2HeIQUltDXr0xYzBhAgEBMBgwEjEQMA4GA1UEAxMHQ2FybERT 1393 UwICAMgwBwYFKw4DAhowCQYHKoZIzjgEAwQuMCwCFD1cSW6LIUFzeXle3YI5SKSBer/sAhQ 1394 mCq7s/CTFHOEjgASeUjbMpx5g6A== 1396 3.5.3. Signing Using the multipart/signed Format 1398 This format is a clear-signing format. Recipients without any S/MIME 1399 or CMS processing facilities are able to view the message. It makes 1400 use of the multipart/signed media type described in [RFC1847]. The 1401 multipart/signed media type has two parts. The first part contains 1402 the MIME entity that is signed; the second part contains the 1403 "detached signature" CMS SignedData object in which the 1404 encapContentInfo eContent field is absent. 1406 3.5.3.1. The application/pkcs7-signature Media Type 1408 This media type always contains a CMS ContentInfo containing a single 1409 CMS object of type SignedData. The SignedData encapContentInfo 1410 eContent field MUST be absent. The signerInfos field contains the 1411 signatures for the MIME entity. 1413 The file extension for signed-only messages using application/pkcs7- 1414 signature is ".p7s". 1416 3.5.3.2. Creating a multipart/signed Message 1418 Step 1. The MIME entity to be signed is prepared according to 1419 Section 3.1, taking special care for clear-signing. 1421 Step 2. The MIME entity is presented to CMS processing in order to 1422 obtain an object of type SignedData in which the 1423 encapContentInfo eContent field is absent. 1425 Step 3. The MIME entity is inserted into the first part of a 1426 multipart/signed message with no processing other than that 1427 described in Section 3.1. 1429 Step 4. Transfer encoding is applied to the "detached signature" CMS 1430 SignedData object, and it is inserted into a MIME entity of 1431 type application/pkcs7-signature. 1433 Step 5. The MIME entity of the application/pkcs7-signature is 1434 inserted into the second part of the multipart/signed 1435 entity. 1437 The multipart/signed Content-Type has two required parameters: the 1438 protocol parameter and the micalg parameter. 1440 The protocol parameter MUST be "application/pkcs7-signature". Note 1441 that quotation marks are required around the protocol parameter 1442 because MIME requires that the "/" character in the parameter value 1443 MUST be quoted. 1445 The micalg parameter allows for one-pass processing when the 1446 signature is being verified. The value of the micalg parameter is 1447 dependent on the message digest algorithm(s) used in the calculation 1448 of the Message Integrity Check. If multiple message digest 1449 algorithms are used, they MUST be separated by commas per [MIME- 1450 SECURE]. The values to be placed in the micalg parameter SHOULD be 1451 from the following: 1453 Algorithm Value Used 1454 MD5 md5 1455 SHA-1 sha-1 1456 SHA-224 sha-224 1457 SHA-256 sha-256 1458 SHA-384 sha-384 1459 SHA-512 sha-512 1460 Any other (defined separately in algorithm profile or "unknown" if 1461 not defined) 1463 (Historical note: some early implementations of S/MIME emitted and 1464 expected "rsa-md5", "rsa-sha1", and "sha1" for the micalg parameter.) 1465 Receiving agents SHOULD be able to recover gracefully from a micalg 1466 parameter value that they do not recognize. Future names for this 1467 parameter will be consistent with the IANA "Hash Function Textual 1468 Names" registry. 1470 3.5.3.3. Sample multipart/signed Message 1472 Content-Type: multipart/signed; 1473 micalg=SHA1; 1474 boundary="----=_NextBoundry____Fri,_06_Sep_2002_00:25:21"; 1475 protocol="application/pkcs7-signature" 1477 This is a multi-part message in MIME format. 1479 ------=_NextBoundry____Fri,_06_Sep_2002_00:25:21 1481 This is some sample content. 1482 ------=_NextBoundry____Fri,_06_Sep_2002_00:25:21 1483 Content-Type: application/pkcs7-signature; name=smime.p7s 1484 Content-Transfer-Encoding: base64 1485 Content-Disposition: attachment; filename=smime.p7s 1487 MIIDdwYJKoZIhvcNAQcCoIIDaDCCA2QCAQExCTAHBgUrDgMCGjALBgkqhkiG9w0BBwGgggL 1488 gMIIC3DCCApugAwIBAgICAMgwCQYHKoZIzjgEAzASMRAwDgYDVQQDEwdDYXJsRFNTMB4XDT 1489 k5MDgxNzAxMTA0OVoXDTM5MTIzMTIzNTk1OVowEzERMA8GA1UEAxMIQWxpY2VEU1MwggG2M 1490 IIBKwYHKoZIzjgEATCCAR4CgYEAgY3N7YPqCp45PsJIKKPkR5PdDteoDuxTxauECE//lOFz 1491 SH4M1vNESNH+n6+koYkv4dkwyDbeP5u/t0zcX2mK5HXQNwyRCJWb3qde+fz0ny/dQ6iLVPE 1492 /sAcIR01diMPDtbPjVQh11Tl2EMR4vf+dsISXN/LkURu15AmWXPN+W9sCFQDiR6YaRWa4E8 1493 baj7g3IStii/eTzQKBgCY40BSJMqo5+z5t2UtZakx2IzkEAjVc8ssaMMMeUF3dm1nizaoFP 1494 VjAe6I2uG4Hr32KQiWn9HXPSgheSz6Q+G3qnMkhijt2FOnOLl2jB80jhbgvMAF8bUmJEYk2 1495 RL34yJVKU1a14vlz7BphNh8Rf8K97dFQ/5h0wtGBSmA5ujY5A4GEAAKBgFzjuVp1FJYLqXr 1496 d4z+p7Kxe3L23ExE0phaJKBEj2TSGZ3V1ExI9Q1tv5VG/+onyohs+JH09B41bY8i7RaWgSu 1497 OF1s4GgD/oI34a8iSrUxq4Jw0e7wi/ZhSAXGKsZfoVi/G7NNTSljf2YUeyxDKE8H5BQP1Gp 1498 2NOM/Kl4vTyg+W4o4GBMH8wDAYDVR0TAQH/BAIwADAOBgNVHQ8BAf8EBAMCBsAwHwYDVR0j 1499 BBgwFoAUcEQ+gi5vh95K03XjPSC8QyuT8R8wHQYDVR0OBBYEFL5sobPjwfftQ3CkzhMB4v3 1500 jl/7NMB8GA1UdEQQYMBaBFEFsaWNlRFNTQGV4YW1wbGUuY29tMAkGByqGSM44BAMDMAAwLQ 1501 IUVQykGR9CK4lxIjONg2q1PWdrv0UCFQCfYVNSVAtcst3a53Yd4hBSW0NevTFjMGECAQEwG 1502 DASMRAwDgYDVQQDEwdDYXJsRFNTAgIAyDAHBgUrDgMCGjAJBgcqhkjOOAQDBC4wLAIUM/mG 1503 f6gkgp9Z0XtRdGimJeB/BxUCFGFFJqwYRt1WYcIOQoGiaowqGzVI 1505 ------=_NextBoundry____Fri,_06_Sep_2002_00:25:21-- 1507 The content that is digested (the first part of the multipart/signed) 1508 consists of the bytes: 1510 54 68 69 73 20 69 73 20 73 6f 6d 65 20 73 61 6d 70 6c 65 20 63 6f 6e 1511 74 65 6e 74 2e 0d 0a 1513 3.6. Creating a Compressed-Only Message 1515 This section describes the format for compressing a MIME entity. 1516 Please note that versions of S/MIME prior to version 3.1 did not 1517 specify any use of CompressedData, and will not recognize it. The 1518 use of a capability to indicate the ability to receive CompressedData 1519 is described in [RFC3274] and is the preferred method for 1520 compatibility. 1522 Step 1. The MIME entity to be compressed is prepared according to 1523 Section 3.1. 1525 Step 2. The MIME entity and other required data are processed into a 1526 CMS object of type CompressedData. 1528 Step 3. The CompressedData object is wrapped in a CMS ContentInfo 1529 object. 1531 Step 4. The ContentInfo object is inserted into an 1532 application/pkcs7-mime MIME entity. 1534 The smime-type parameter for compressed-only messages is "compressed- 1535 data". The file extension for this type of message is ".p7z". 1537 A sample message would be: 1539 Content-Type: application/pkcs7-mime; smime-type=compressed-data; 1540 name=smime.p7z 1541 Content-Transfer-Encoding: base64 1542 Content-Disposition: attachment; filename=smime.p7z 1544 eNoLycgsVgCi4vzcVIXixNyCnFSF5Py8ktS8Ej0AlCkKVA== 1546 3.7. Multiple Operations 1548 The signed-only, enveloped-only, and compressed-only MIME formats can 1549 be nested. This works because these formats are all MIME entities 1550 that encapsulate other MIME entities. 1552 An S/MIME implementation MUST be able to receive and process 1553 arbitrarily nested S/MIME within reasonable resource limits of the 1554 recipient computer. 1556 It is possible to apply any of the signing, encrypting, and 1557 compressing operations in any order. It is up to the implementer and 1558 the user to choose. When signing first, the signatories are then 1559 securely obscured by the enveloping. When enveloping first the 1560 signatories are exposed, but it is possible to verify signatures 1561 without removing the enveloping. This can be useful in an 1562 environment where automatic signature verification is desired, as no 1563 private key material is required to verify a signature. 1565 There are security ramifications to choosing whether to sign first or 1566 encrypt first. A recipient of a message that is encrypted and then 1567 signed can validate that the encrypted block was unaltered, but 1568 cannot determine any relationship between the signer and the 1569 unencrypted contents of the message. A recipient of a message that 1570 is signed then encrypted can assume that the signed message itself 1571 has not been altered, but that a careful attacker could have changed 1572 the unauthenticated portions of the encrypted message. 1574 When using compression, keep the following guidelines in mind: 1576 - Compression of binary encoded encrypted data is discouraged, since 1577 it will not yield significant compression. Base64 encrypted data 1578 could very well benefit, however. 1580 - If a lossy compression algorithm is used with signing, you will 1581 need to compress first, then sign. 1583 3.8. Creating a Certificate Management Message 1585 The certificate management message or MIME entity is used to 1586 transport certificates and/or Certificate Revocation Lists, such as 1587 in response to a registration request. 1589 Step 1. The certificates and/or Certificate Revocation Lists are 1590 made available to the CMS generating process that creates a 1591 CMS object of type SignedData. The SignedData 1592 encapContentInfo eContent field MUST be absent and 1593 signerInfos field MUST be empty. 1595 Step 2. The SignedData object is wrapped in a CMS ContentInfo 1596 object. 1598 Step 3. The ContentInfo object is enclosed in an 1599 application/pkcs7-mime MIME entity. 1601 The smime-type parameter for a certificate management message is 1602 "certs-only". The file extension for this type of message is ".p7c". 1604 3.9. Registration Requests 1606 A sending agent that signs messages MUST have a certificate for the 1607 signature so that a receiving agent can verify the signature. There 1608 are many ways of getting certificates, such as through an exchange 1609 with a certification authority, through a hardware token or diskette, 1610 and so on. 1612 S/MIME v2 [SMIMEv2] specified a method for "registering" public keys 1613 with certificate authorities using an application/pkcs10 body part. 1614 Since that time, the IETF PKIX Working Group has developed other 1615 methods for requesting certificates. However, S/MIME v4.0 does not 1616 require a particular certificate request mechanism. 1618 3.10. Identifying an S/MIME Message 1620 Because S/MIME takes into account interoperation in non-MIME 1621 environments, several different mechanisms are employed to carry the 1622 type information, and it becomes a bit difficult to identify S/MIME 1623 messages. The following table lists criteria for determining whether 1624 or not a message is an S/MIME message. A message is considered an 1625 S/MIME message if it matches any of the criteria listed below. 1627 The file suffix in the table below comes from the "name" parameter in 1628 the Content-Type header field, or the "filename" parameter on the 1629 Content-Disposition header field. These parameters that give the 1630 file suffix are not listed below as part of the parameter section. 1632 Media type parameters file 1633 suffix 1634 application/pkcs7-mime n/a n/a 1635 multipart/signed protocol="application/pkcs7-signature" n/a 1636 application/octet- n/a p7m, 1637 stream p7s, 1638 p7c, 1639 p7z 1641 4. Certificate Processing 1643 A receiving agent MUST provide some certificate retrieval mechanism 1644 in order to gain access to certificates for recipients of digital 1645 envelopes. This specification does not cover how S/MIME agents 1646 handle certificates, only what they do after a certificate has been 1647 validated or rejected. S/MIME certificate issues are covered in 1648 [RFC5750]. 1650 At a minimum, for initial S/MIME deployment, a user agent could 1651 automatically generate a message to an intended recipient requesting 1652 that recipient's certificate in a signed return message. Receiving 1653 and sending agents SHOULD also provide a mechanism to allow a user to 1654 "store and protect" certificates for correspondents in such a way so 1655 as to guarantee their later retrieval. 1657 4.1. Key Pair Generation 1659 All generated key pairs MUST be generated from a good source of non- 1660 deterministic random input [RFC4086] and the private key MUST be 1661 protected in a secure fashion. 1663 An S/MIME user agent MUST NOT generate asymmetric keys less than 2048 1664 bits for use with the RSA signature algorithm. 1666 For 2048-bit through 4096-bit RSA with SHA-256 see [RFC5754] and 1667 [FIPS186-4]. The first reference provides the signature algorithm's 1668 object identifier, and the second provides the signature algorithm's 1669 definition. 1671 For RSASSA-PSS with SHA-256, see [RFC4056]. For RSAES-OAEP, see 1672 [RFC3560]. 1674 4.2. Signature Generation 1676 The following are the requirements for an S/MIME agent generated RSA 1677 and RSASSA-PSS signatures: 1679 key size <= 2047 : SHOULD NOT (see Historic Mail Considerations) 1680 2048 <= key size <= 4096 : SHOULD (see Security Considerations) 1681 4096 < key size : MAY (see Security Considerations) 1683 Key sizes for ECDSA and EdDSA are fixed by the curve. 1685 4.3. Signature Verification 1687 The following are the requirements for S/MIME receiving agents during 1688 signature verification of RSA and RSASSA-PSS signatures: 1690 key size <= 2047 : SHOULD NOT (see Historic Mail Considerations) 1691 2048 <= key size <= 4096 : MUST (see Security Considerations) 1692 4096 < key size : MAY (see Security Considerations) 1694 Key sizes for ECDSA and EdDSA are fixed by the curve. 1696 4.4. Encryption 1698 The following are the requirements for an S/MIME agent when 1699 establishing keys for content encryption using the RSA, and RSA-OAEP 1700 algorithms: 1702 key size <= 2047 : SHOULD NOT (see Historic Mail Considerations) 1703 2048 <= key size <= 4096 : SHOULD (see Security Considerations) 1704 4096 < key size : MAY (see Security Considerations) 1706 Key sizes for ECDH are fixed by the curve. 1708 4.5. Decryption 1710 The following are the requirements for an S/MIME agent when 1711 establishing keys for content decryption using the RSA and RSAES-OAEP 1712 algorithms: 1714 key size <= 2047 : MAY (see Historic Mail Considerations) 1715 2048 <= key size <= 4096 : MUST (see Security Considerations) 1716 4096 < key size : MAY (see Security Considerations) 1718 Key sizes for ECDH are fixed by the curve. 1720 5. IANA Considerations 1722 The following information updates the media type registration for 1723 application/pkcs7-mime and application/pkcs7-signature to refer to 1724 this document as opposed to RFC 2311. 1726 Note that other documents can define additional MIME media types for 1727 S/MIME. 1729 5.1. Media Type for application/pkcs7-mime 1730 Type name: application 1732 Subtype Name: pkcs7-mime 1734 Required Parameters: NONE 1736 Optional Parameters: smime-type/signed-data 1737 smime-type/enveloped-data 1738 smime-type/compressed-data 1739 smime-type/certs-only 1740 name 1742 Encoding Considerations: See Section 3 of this document 1744 Security Considerations: See Section 6 of this document 1746 Interoperability Considerations: See Sections 1-6 of this document 1748 Published Specification: RFC 2311, RFC 2633, and this document 1750 Applications that use this media type: Security applications 1752 Additional information: NONE 1754 Person & email to contact for further information: 1755 S/MIME working group chairs smime-chairs@ietf.org 1757 Intended usage: COMMON 1759 Restrictions on usage: NONE 1761 Author: Sean Turner 1763 Change Controller: S/MIME working group delegated from the IESG 1765 5.2. Media Type for application/pkcs7-signature 1766 Type name: application 1768 Subtype Name: pkcs7-signature 1770 Required Parameters: NONE 1772 Optional Parameters: NONE 1774 Encoding Considerations: See Section 3 of this document 1776 Security Considerations: See Section 6 of this document 1778 Interoperability Considerations: See Sections 1-6 of this document 1780 Published Specification: RFC 2311, RFC 2633, and this document 1782 Applications that use this media type: Security applications 1784 Additional information: NONE 1786 Person & email to contact for further information: 1787 S/MIME working group chairs smime-chairs@ietf.org 1789 Intended usage: COMMON 1791 Restrictions on usage: NONE 1793 Author: Sean Turner 1795 Change Controller: S/MIME working group delegated from the IESG 1797 5.3. Register authEnvelopedData smime-type 1799 IANA is required to register the following value in the "Parameter 1800 Values for the smime-type Parameter" registry. The values to be 1801 registered are: 1803 smime-type value: authEnvelopedData 1805 Reference: [[This Document, Section 3.2.2]] 1807 6. Security Considerations 1809 Cryptographic algorithms will be broken or weakened over time. 1810 Implementers and users need to check that the cryptographic 1811 algorithms listed in this document continue to provide the expected 1812 level of security. The IETF from time to time may issue documents 1813 dealing with the current state of the art. For example: 1815 - The Million Message Attack described in RFC 3218 [RFC3218]. 1817 - The Diffie-Hellman "small-subgroup" attacks described in RFC 2785 1818 [RFC2785]. 1820 - The attacks against hash algorithms described in RFC 4270 1821 [RFC4270]. 1823 This specification uses Public-Key Cryptography technologies. It is 1824 assumed that the private key is protected to ensure that it is not 1825 accessed or altered by unauthorized parties. 1827 It is impossible for most people or software to estimate the value of 1828 a message's content. Further, it is impossible for most people or 1829 software to estimate the actual cost of recovering an encrypted 1830 message content that is encrypted with a key of a particular size. 1831 Further, it is quite difficult to determine the cost of a failed 1832 decryption if a recipient cannot process a message's content. Thus, 1833 choosing between different key sizes (or choosing whether to just use 1834 plaintext) is also impossible for most people or software. However, 1835 decisions based on these criteria are made all the time, and 1836 therefore this specification gives a framework for using those 1837 estimates in choosing algorithms. 1839 The choice of 2048 bits as the RSA asymmetric key size in this 1840 specification is based on the desire to provide at least 100 bits of 1841 security. The key sizes that must be supported to conform to this 1842 specification seem appropriate for the Internet based on [RFC3766]. 1843 Of course, there are environments, such as financial and medical 1844 systems, that may select different key sizes. For this reason, an 1845 implementation MAY support key sizes beyond those recommended in this 1846 specification. 1848 Receiving agents that validate signatures and sending agents that 1849 encrypt messages need to be cautious of cryptographic processing 1850 usage when validating signatures and encrypting messages using keys 1851 larger than those mandated in this specification. An attacker could 1852 send certificates with keys that would result in excessive 1853 cryptographic processing, for example, keys larger than those 1854 mandated in this specification, which could swamp the processing 1855 element. Agents that use such keys without first validating the 1856 certificate to a trust anchor are advised to have some sort of 1857 cryptographic resource management system to prevent such attacks. 1859 Using weak cryptography in S/MIME offers little actual security over 1860 sending plaintext. However, other features of S/MIME, such as the 1861 specification of AES and the ability to announce stronger 1862 cryptographic capabilities to parties with whom you communicate, 1863 allow senders to create messages that use strong encryption. Using 1864 weak cryptography is never recommended unless the only alternative is 1865 no cryptography. 1867 RSA and DSA keys of less than 2048 bits are now considered by many 1868 experts to be cryptographically insecure (due to advances in 1869 computing power), and should no longer be used to protect messages. 1870 Such keys were previously considered secure, so processing previously 1871 received signed and encrypted mail will often result in the use of 1872 weak keys. Implementations that wish to support previous versions of 1873 S/MIME or process old messages need to consider the security risks 1874 that result from smaller key sizes (e.g., spoofed messages) versus 1875 the costs of denial of service. If an implementation supports 1876 verification of digital signatures generated with RSA and DSA keys of 1877 less than 1024 bits, it MUST warn the user. Implementers should 1878 consider providing different warnings for newly received messages and 1879 previously stored messages. Server implementations (e.g., secure 1880 mail list servers) where user warnings are not appropriate SHOULD 1881 reject messages with weak signatures. 1883 Implementers SHOULD be aware that multiple active key pairs can be 1884 associated with a single individual. For example, one key pair can 1885 be used to support confidentiality, while a different key pair can be 1886 used for digital signatures. 1888 If a sending agent is sending the same message using different 1889 strengths of cryptography, an attacker watching the communications 1890 channel might be able to determine the contents of the strongly 1891 encrypted message by decrypting the weakly encrypted version. In 1892 other words, a sender SHOULD NOT send a copy of a message using 1893 weaker cryptography than they would use for the original of the 1894 message. 1896 Modification of the ciphertext can go undetected if authentication is 1897 not also used, which is the case when sending EnvelopedData without 1898 wrapping it in SignedData or enclosing SignedData within it. This is 1899 one of the reasons for moving from EnvelopedData to AuthEnvelopedData 1900 as the authenticated encryption algorithms provide the authentication 1901 without needing the SignedData layer. 1903 If an implementation is concerned about compliance with National 1904 Institute of Standards and Technology (NIST) key size 1905 recommendations, then see [SP800-57]. 1907 If messaging environments make use of the fact that a message is 1908 signed to change the behavior of message processing (examples would 1909 be running rules or UI display hints), without first verifying that 1910 the message is actually signed and knowing the state of the 1911 signature, this can lead to incorrect handling of the message. 1912 Visual indicators on messages may need to have the signature 1913 validation code checked periodically if the indicator is supposed to 1914 give information on the current status of a message. 1916 Many people assume that the use of an authenticated encryption 1917 algorithm is all that is needed to be in a situtation where the 1918 sender of the message will be authenticated. In almost all cases 1919 this is not a correct statement. There are a number of preconditions 1920 that need to hold for an authenticated encryption algorithm to 1921 provide this service: 1923 - The starting key must be bound to a single entity. The use of a 1924 group key only would allow for the statement that a message was 1925 sent by one of the entities that held the key but will not 1926 identify a specific entity. 1928 - The message must have exactly one sender and one recipient. 1929 Having more than one recipient would allow for the second 1930 recipient to create a message that the first recipient would 1931 believe is from the sender by stripping them as a recipient from 1932 the message. 1934 - A direct path needs to exist from the starting key to the key used 1935 as the content encryption key (CEK) which guarantees that no third 1936 party could have seen the resulting CEK. This means that one 1937 needs to be using an algorithm that is called a "Direct 1938 Encryption" or a "Direct Key Agreement" algorithm in other 1939 contexts. This means that the starting key is used directly as 1940 the CEK key, or that the starting key is used to create a secret 1941 which then is transformed into the CEK via a KDF step. 1943 S/MIME implementations almost universally use ephemeral-static rather 1944 than static-static key agreement and do not use a pre-existing shared 1945 secret when doing encryption, this means that the first precondition 1946 is not met. There is a document [RFC6278] which defined how to use 1947 static-static key agreement with CMS so that is readably doable. 1948 Currently, all S/MIME key agreement methods derive a KEK and wrap a 1949 CEK. This violates the third precondition above. New key key 1950 agreement algorithms that directly created the CEK without creating 1951 an intervening KEK would need to be defined. 1953 Even when all of the preconditions are met and origination of a 1954 message is established by the use of an authenticated encryption 1955 algorithm, users need to be aware that there is no way to prove this 1956 to a third party. This is because either of the parties can 1957 successfully create the message (or just alter the content) based on 1958 the fact that the CEK is going to be known to both parties. Thus the 1959 origination is always built on a presumption that "I did not send 1960 this message to myself." 1962 All of the authenticated encryption algorithms in this document use 1963 counter mode for the encryption portion of the algorithm. This means 1964 that the length of the plain text will always be known as the cipher 1965 text length and the plain text length are always the same. This 1966 information can enable passive observers to infer information based 1967 solely on the length of the message. Applications for which this is 1968 a significant problem need to provide some type of padding algorithm 1969 so that the length of the message does not provide this information. 1971 7. References 1973 7.1. Normative References 1975 [ASN.1] "Information Technology - Abstract Syntax Notation 1976 (ASN.1)". 1978 ASN.1 syntax consists of the following references [X.680], 1979 [X.681], [X.682], and [X.683]. 1981 [CHARSETS] 1982 "Character sets assigned by IANA.", 1983 . 1985 [CMS] "Cryptograhic Message Syntax". 1987 This is the set of documents dealing with the 1988 cryptographic message syntax and refers to [RFC5652] and 1989 [RFC5083]. 1991 [ESS] "Enhanced Security Services for S/MIME". 1993 This is the set of documents dealing with enhanged 1994 security services and refers to [RFC2634] and [RFC5035]. 1996 [FIPS186-4] 1997 National Institute of Standards and Technology (NIST), 1998 "Digital Signature Standard (DSS)", Federal Information 1999 Processing Standards Publication 186-4, July 2013. 2001 [I-D.ietf-curdle-cms-ecdh-new-curves] 2002 Housley, R., "Use of the Elliptic Curve Diffie-Hellamn Key 2003 Agreement Algorithm with X25519 and X448 in the 2004 Cryptographic Message Syntax (CMS)", draft-ietf-curdle- 2005 cms-ecdh-new-curves-01 (work in progress), September 2016. 2007 [I-D.ietf-curdle-cms-eddsa-signatures] 2008 Housley, R., "Use of EdDSA Signatures in the Cryptographic 2009 Message Syntax (CMS)", draft-ietf-curdle-cms-eddsa- 2010 signatures-03 (work in progress), January 2017. 2012 [I-D.ietf-lamps-rfc5750-bis] 2013 Schaad, J., Ramsdell, B., and S. Turner, "Secure/ 2014 Multipurpose Internet Mail Extensions (S/ MIME) Version 2015 4.0 Certificate Handling", draft-ietf-lamps-rfc5750-bis-01 2016 (work in progress), October 2016. 2018 [MIME-SPEC] 2019 "MIME Message Specifications". 2021 This is the set of documents that define how to use MIME. 2022 This set of documents is [RFC2045], [RFC2046], [RFC2047], 2023 [RFC2049], [RFC4288], and [RFC4289]. 2025 [RFC1847] Galvin, J., Murphy, S., Crocker, S., and N. Freed, 2026 "Security Multiparts for MIME: Multipart/Signed and 2027 Multipart/Encrypted", RFC 1847, DOI 10.17487/RFC1847, 2028 October 1995, . 2030 [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2031 Extensions (MIME) Part One: Format of Internet Message 2032 Bodies", RFC 2045, DOI 10.17487/RFC2045, November 1996, 2033 . 2035 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2036 Extensions (MIME) Part Two: Media Types", RFC 2046, 2037 DOI 10.17487/RFC2046, November 1996, 2038 . 2040 [RFC2047] Moore, K., "MIME (Multipurpose Internet Mail Extensions) 2041 Part Three: Message Header Extensions for Non-ASCII Text", 2042 RFC 2047, DOI 10.17487/RFC2047, November 1996, 2043 . 2045 [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2046 Extensions (MIME) Part Five: Conformance Criteria and 2047 Examples", RFC 2049, DOI 10.17487/RFC2049, November 1996, 2048 . 2050 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2051 Requirement Levels", BCP 14, RFC 2119, 2052 DOI 10.17487/RFC2119, March 1997, 2053 . 2055 [RFC2138] Rigney, C., Rubens, A., Simpson, W., and S. Willens, 2056 "Remote Authentication Dial In User Service (RADIUS)", 2057 RFC 2138, DOI 10.17487/RFC2138, April 1997, 2058 . 2060 [RFC2634] Hoffman, P., Ed., "Enhanced Security Services for S/MIME", 2061 RFC 2634, DOI 10.17487/RFC2634, June 1999, 2062 . 2064 [RFC3274] Gutmann, P., "Compressed Data Content Type for 2065 Cryptographic Message Syntax (CMS)", RFC 3274, 2066 DOI 10.17487/RFC3274, June 2002, 2067 . 2069 [RFC3370] Housley, R., "Cryptographic Message Syntax (CMS) 2070 Algorithms", RFC 3370, DOI 10.17487/RFC3370, August 2002, 2071 . 2073 [RFC3560] Housley, R., "Use of the RSAES-OAEP Key Transport 2074 Algorithm in Cryptographic Message Syntax (CMS)", 2075 RFC 3560, DOI 10.17487/RFC3560, July 2003, 2076 . 2078 [RFC3565] Schaad, J., "Use of the Advanced Encryption Standard (AES) 2079 Encryption Algorithm in Cryptographic Message Syntax 2080 (CMS)", RFC 3565, DOI 10.17487/RFC3565, July 2003, 2081 . 2083 [RFC4056] Schaad, J., "Use of the RSASSA-PSS Signature Algorithm in 2084 Cryptographic Message Syntax (CMS)", RFC 4056, 2085 DOI 10.17487/RFC4056, June 2005, 2086 . 2088 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 2089 "Randomness Requirements for Security", BCP 106, RFC 4086, 2090 DOI 10.17487/RFC4086, June 2005, 2091 . 2093 [RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and 2094 Registration Procedures", RFC 4288, DOI 10.17487/RFC4288, 2095 December 2005, . 2097 [RFC4289] Freed, N. and J. Klensin, "Multipurpose Internet Mail 2098 Extensions (MIME) Part Four: Registration Procedures", 2099 BCP 13, RFC 4289, DOI 10.17487/RFC4289, December 2005, 2100 . 2102 [RFC5035] Schaad, J., "Enhanced Security Services (ESS) Update: 2103 Adding CertID Algorithm Agility", RFC 5035, 2104 DOI 10.17487/RFC5035, August 2007, 2105 . 2107 [RFC5083] Housley, R., "Cryptographic Message Syntax (CMS) 2108 Authenticated-Enveloped-Data Content Type", RFC 5083, 2109 DOI 10.17487/RFC5083, November 2007, 2110 . 2112 [RFC5084] Housley, R., "Using AES-CCM and AES-GCM Authenticated 2113 Encryption in the Cryptographic Message Syntax (CMS)", 2114 RFC 5084, DOI 10.17487/RFC5084, November 2007, 2115 . 2117 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 2118 RFC 5652, DOI 10.17487/RFC5652, September 2009, 2119 . 2121 [RFC5753] Turner, S. and D. Brown, "Use of Elliptic Curve 2122 Cryptography (ECC) Algorithms in Cryptographic Message 2123 Syntax (CMS)", RFC 5753, DOI 10.17487/RFC5753, January 2124 2010, . 2126 [RFC5754] Turner, S., "Using SHA2 Algorithms with Cryptographic 2127 Message Syntax", RFC 5754, DOI 10.17487/RFC5754, January 2128 2010, . 2130 [SMIMEv4.0] 2131 "S/MIME version 4.0". 2133 This group of documents represents S/MIME version 4.0. 2134 This set of documents are [RFC2634], 2135 [I-D.ietf-lamps-rfc5750-bis], [[This Document]], 2136 [RFC5652], and [RFC5035]. 2138 [X.680] "Information Technology - Abstract Syntax Notation One 2139 (ASN.1): Specification of basic notation. ITU-T 2140 Recommendation X.680 (2002)", ITU-T X.680, ISO/ 2141 IEC 8824-1:2008, November 2008. 2143 [X.681] "Information Technology - Abstract Syntax Notation One 2144 (ASN.1): Information object specification", ITU-T X.681, 2145 ISO/IEC 8824-2:2008, November 2008. 2147 [X.682] "Information Technology - Abstract Syntax Notation One 2148 (ASN.1): Constraint specification", ITU-T X.682, ISO/ 2149 IEC 8824-3:2008, November 2008. 2151 [X.683] "Information Technology - Abstract Syntax Notation One 2152 (ASN.1): Parameteriztion of ASN.1 specifications", 2153 ITU-T X.683, ISO/IEC 8824-4:2008, November 2008. 2155 [X.690] "Information Technology - ASN.1 encoding rules: 2156 Specification of Basic Encoding Rules (BER), Canonical 2157 Encoding Rules (CER) and Distinguished Encoding Rules 2158 (DER).", ITU-T X.690, ISO/IEC 8825-1:2002, July 2002. 2160 7.2. Informative References 2162 [FIPS186-2] 2163 National Institute of Standards and Technology (NIST), 2164 "Digital Signature Standard (DSS) [With Change Notice 1]", 2165 Federal Information Processing Standards 2166 Publication 186-2, January 2000. 2168 [RFC2268] Rivest, R., "A Description of the RC2(r) Encryption 2169 Algorithm", RFC 2268, DOI 10.17487/RFC2268, March 1998, 2170 . 2172 [RFC2311] Dusse, S., Hoffman, P., Ramsdell, B., Lundblade, L., and 2173 L. Repka, "S/MIME Version 2 Message Specification", 2174 RFC 2311, DOI 10.17487/RFC2311, March 1998, 2175 . 2177 [RFC2312] Dusse, S., Hoffman, P., Ramsdell, B., and J. Weinstein, 2178 "S/MIME Version 2 Certificate Handling", RFC 2312, 2179 DOI 10.17487/RFC2312, March 1998, 2180 . 2182 [RFC2313] Kaliski, B., "PKCS #1: RSA Encryption Version 1.5", 2183 RFC 2313, DOI 10.17487/RFC2313, March 1998, 2184 . 2186 [RFC2314] Kaliski, B., "PKCS #10: Certification Request Syntax 2187 Version 1.5", RFC 2314, DOI 10.17487/RFC2314, March 1998, 2188 . 2190 [RFC2315] Kaliski, B., "PKCS #7: Cryptographic Message Syntax 2191 Version 1.5", RFC 2315, DOI 10.17487/RFC2315, March 1998, 2192 . 2194 [RFC2630] Housley, R., "Cryptographic Message Syntax", RFC 2630, 2195 DOI 10.17487/RFC2630, June 1999, 2196 . 2198 [RFC2631] Rescorla, E., "Diffie-Hellman Key Agreement Method", 2199 RFC 2631, DOI 10.17487/RFC2631, June 1999, 2200 . 2202 [RFC2632] Ramsdell, B., Ed., "S/MIME Version 3 Certificate 2203 Handling", RFC 2632, DOI 10.17487/RFC2632, June 1999, 2204 . 2206 [RFC2633] Ramsdell, B., Ed., "S/MIME Version 3 Message 2207 Specification", RFC 2633, DOI 10.17487/RFC2633, June 1999, 2208 . 2210 [RFC2785] Zuccherato, R., "Methods for Avoiding the "Small-Subgroup" 2211 Attacks on the Diffie-Hellman Key Agreement Method for S/ 2212 MIME", RFC 2785, DOI 10.17487/RFC2785, March 2000, 2213 . 2215 [RFC3218] Rescorla, E., "Preventing the Million Message Attack on 2216 Cryptographic Message Syntax", RFC 3218, 2217 DOI 10.17487/RFC3218, January 2002, 2218 . 2220 [RFC3766] Orman, H. and P. Hoffman, "Determining Strengths For 2221 Public Keys Used For Exchanging Symmetric Keys", BCP 86, 2222 RFC 3766, DOI 10.17487/RFC3766, April 2004, 2223 . 2225 [RFC3850] Ramsdell, B., Ed., "Secure/Multipurpose Internet Mail 2226 Extensions (S/MIME) Version 3.1 Certificate Handling", 2227 RFC 3850, DOI 10.17487/RFC3850, July 2004, 2228 . 2230 [RFC3851] Ramsdell, B., Ed., "Secure/Multipurpose Internet Mail 2231 Extensions (S/MIME) Version 3.1 Message Specification", 2232 RFC 3851, DOI 10.17487/RFC3851, July 2004, 2233 . 2235 [RFC3852] Housley, R., "Cryptographic Message Syntax (CMS)", 2236 RFC 3852, DOI 10.17487/RFC3852, July 2004, 2237 . 2239 [RFC4134] Hoffman, P., Ed., "Examples of S/MIME Messages", RFC 4134, 2240 DOI 10.17487/RFC4134, July 2005, 2241 . 2243 [RFC4270] Hoffman, P. and B. Schneier, "Attacks on Cryptographic 2244 Hashes in Internet Protocols", RFC 4270, 2245 DOI 10.17487/RFC4270, November 2005, 2246 . 2248 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 2249 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 2250 . 2252 [RFC5750] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet 2253 Mail Extensions (S/MIME) Version 3.2 Certificate 2254 Handling", RFC 5750, DOI 10.17487/RFC5750, January 2010, 2255 . 2257 [RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet 2258 Mail Extensions (S/MIME) Version 3.2 Message 2259 Specification", RFC 5751, DOI 10.17487/RFC5751, January 2260 2010, . 2262 [RFC6151] Turner, S. and L. Chen, "Updated Security Considerations 2263 for the MD5 Message-Digest and the HMAC-MD5 Algorithms", 2264 RFC 6151, DOI 10.17487/RFC6151, March 2011, 2265 . 2267 [RFC6194] Polk, T., Chen, L., Turner, S., and P. Hoffman, "Security 2268 Considerations for the SHA-0 and SHA-1 Message-Digest 2269 Algorithms", RFC 6194, DOI 10.17487/RFC6194, March 2011, 2270 . 2272 [RFC6278] Herzog, J. and R. Khazan, "Use of Static-Static Elliptic 2273 Curve Diffie-Hellman Key Agreement in Cryptographic 2274 Message Syntax", RFC 6278, DOI 10.17487/RFC6278, June 2275 2011, . 2277 [RFC7114] Leiba, B., "Creation of a Registry for smime-type 2278 Parameter Values", RFC 7114, DOI 10.17487/RFC7114, January 2279 2014, . 2281 [RFC7905] Langley, A., Chang, W., Mavrogiannopoulos, N., 2282 Strombergson, J., and S. Josefsson, "ChaCha20-Poly1305 2283 Cipher Suites for Transport Layer Security (TLS)", 2284 RFC 7905, DOI 10.17487/RFC7905, June 2016, 2285 . 2287 [SMIMEv2] "S/MIME version v2". 2289 This group of documents represents S/MIME version 2. This 2290 set of documents are [RFC2311], [RFC2312], [RFC2313], 2291 [RFC2314], and [RFC2315]. 2293 [SMIMEv3] "S/MIME version 3". 2295 This group of documents represents S/MIME version 3. This 2296 set of documents are [RFC2630], [RFC2631], [RFC2632], 2297 [RFC2633], [RFC2634], and [RFC5035]. 2299 [SMIMEv3.1] 2300 "S/MIME version 3.1". 2302 This group of documents represents S/MIME version 3.1. 2303 This set of documents are [RFC2634], [RFC3850], [RFC3851], 2304 [RFC3852], and [RFC5035]. 2306 [SMIMEv3.2] 2307 "S/MIME version 3.2". 2309 This group of documents represents S/MIME version 3.2. 2310 This set of documents are [RFC2634], [RFC5750], [RFC5751], 2311 [RFC5652], and [RFC5035]. 2313 [SP800-56A] 2314 National Institute of Standards and Technology (NIST), 2315 "Special Publication 800-56A Revision 2: Recommendation 2316 Pair-Wise Key Establishment Schemes Using Discrete 2317 Logarithm Cryptography", May 2013. 2319 [SP800-57] 2320 National Institute of Standards and Technology (NIST), 2321 "Special Publication 800-57: Recommendation for Key 2322 Management", August 2005. 2324 [TripleDES] 2325 Tuchman, W., "Hellman Presents No Shortcut Solutions to 2326 DES"", IEEE Spectrum v. 16, n. 7, pp 40-41, July 1979. 2328 Appendix A. ASN.1 Module 2330 Note: The ASN.1 module contained herein is unchanged from RFC 3851 2331 [SMIMEv3.1] with the exception of a change to the prefersBinaryInside 2332 ASN.1 comment. This module uses the 1988 version of ASN.1. 2334 SecureMimeMessageV3dot1 2336 { iso(1) member-body(2) us(840) rsadsi(113549) 2337 pkcs(1) pkcs-9(9) smime(16) modules(0) msg-v3dot1(21) } 2339 DEFINITIONS IMPLICIT TAGS ::= 2341 BEGIN 2343 IMPORTS 2345 -- Cryptographic Message Syntax [CMS] 2346 SubjectKeyIdentifier, IssuerAndSerialNumber, 2347 RecipientKeyIdentifier 2348 FROM CryptographicMessageSyntax 2349 { iso(1) member-body(2) us(840) rsadsi(113549) 2350 pkcs(1) pkcs-9(9) smime(16) modules(0) cms-2001(14) }; 2352 -- id-aa is the arc with all new authenticated and unauthenticated 2353 -- attributes produced by the S/MIME Working Group 2355 id-aa OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840) 2356 rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) attributes(2)} 2358 -- S/MIME Capabilities provides a method of broadcasting the 2359 -- symmetric capabilities understood. Algorithms SHOULD be ordered 2360 -- by preference and grouped by type 2362 smimeCapabilities OBJECT IDENTIFIER ::= {iso(1) member-body(2) 2363 us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 15} 2365 SMIMECapability ::= SEQUENCE { 2366 capabilityID OBJECT IDENTIFIER, 2367 parameters ANY DEFINED BY capabilityID OPTIONAL } 2369 SMIMECapabilities ::= SEQUENCE OF SMIMECapability 2371 -- Encryption Key Preference provides a method of broadcasting the 2372 -- preferred encryption certificate. 2374 id-aa-encrypKeyPref OBJECT IDENTIFIER ::= {id-aa 11} 2376 SMIMEEncryptionKeyPreference ::= CHOICE { 2377 issuerAndSerialNumber [0] IssuerAndSerialNumber, 2378 receipentKeyId [1] RecipientKeyIdentifier, 2379 subjectAltKeyIdentifier [2] SubjectKeyIdentifier 2380 } 2382 -- receipentKeyId is spelt incorrectly, but kept for historical 2383 -- reasons. 2385 id-smime OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) 2386 rsadsi(113549) pkcs(1) pkcs9(9) 16 } 2388 id-cap OBJECT IDENTIFIER ::= { id-smime 11 } 2390 -- The preferBinaryInside OID indicates an ability to receive 2391 -- messages with binary encoding inside the CMS wrapper. 2392 -- The preferBinaryInside attribute's value field is ABSENT. 2394 id-cap-preferBinaryInside OBJECT IDENTIFIER ::= { id-cap 1 } 2396 -- The following list OIDs to be used with S/MIME V3 2398 -- Signature Algorithms Not Found in [CMSALG], [CMS-SHA2], [RSAPSS], 2399 -- and [RSAOAEP] 2401 -- 2402 -- md2WithRSAEncryption OBJECT IDENTIFIER ::= 2403 -- {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 2404 -- 2} 2406 -- 2407 -- Other Signed Attributes 2408 -- 2409 -- signingTime OBJECT IDENTIFIER ::= 2410 -- {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 2411 -- 5} 2412 -- See [CMS] for a description of how to encode the attribute 2413 -- value. 2415 SMIMECapabilitiesParametersForRC2CBC ::= INTEGER 2416 -- (RC2 Key Length (number of bits)) 2418 END 2420 Appendix B. Historic Mail Considerations 2422 Over the course of updating the S/MIME specifications, the set of 2423 recommended algorithms has been modified each time the document has 2424 been updated. This means that if a user has historic emails and 2425 their user agent has been updated to only support the current set of 2426 recommended algorithms some of those old emails will no longer be 2427 accessible. It is strongly suggested that user agents implement some 2428 of the following algorithms for dealing with historic emails. 2430 This appendix contains a number of references to documents that have 2431 been obsoleted or replaced, this is intentional as frequently the 2432 updated documents do not have the same information in them. 2434 B.1. DigestAlgorithmIdentifier 2436 The following algorithms have been called our for some level of 2437 support by previous S/MIME specifications: 2439 - SHA-1 was dropped in [SMIMEv4.0]. SHA-1 is no longer considerd to 2440 be secure as it is no longer collision-resistant. The IETF 2441 statement on SHA-1 can be found in [RFC6194] but it is out-of-date 2442 relative to the most recient advances. 2444 - MD5 was dropped in [SMIMEv4.0]. MD5 is no longer considered to be 2445 secure as it is no longer collision-resistant. Details can be 2446 found in [RFC6151]. 2448 B.2. Signature Algorithms 2450 There are a number of problems with validating signatures on 2451 sufficently historic messages. For this reason it is strongly 2452 suggested that UAs treat these signatures differently from those on 2453 current messages. These problems include: 2455 - CAs are not required to keep certificates on a CRL beyond one 2456 update after a certificate has expired. This means that unless 2457 CRLs are cached as part of the message it is not always possible 2458 to check if a certificate has been revoked. The same problems 2459 exist with OCSP responses as they may be based on a CRL rather 2460 than on the certificate database. 2462 - RSA and DSA keys of less than 2048 bits are now considered by many 2463 experts to be cryptographically insecure (due to advances in 2464 computing power). Such keys were previously considered secure, so 2465 processing of historic signed messages will often result in the 2466 use of weak keys. Implementations that wish to support previous 2467 versions of S/MIME or process old messages need to consider the 2468 security risks that result from smaller key sizes (e.g., spoofed 2469 messages) versus the costs of denial of service. 2471 [SMIMEv3.1] set the lower limit on suggested key sizes for 2472 creating and validation at 1024 bits. Prior to that the lower 2473 bound on key sizes was 512 bits. 2475 - Hash functions used to validate signatures on historic messages 2476 may longer be considered to be secure. (See below.) While there 2477 are not currently any known practical pre-image or second pre- 2478 image attacks against MD5 or SHA-1, the fact they are no longer 2479 considered to be collision resistent the security levels of the 2480 signatures are generally considered suspect. 2482 - The previous two issues apply to the certificates used to validate 2483 the binding of the public key to the identity that signed the 2484 message as well. 2486 The following algorithms have been called out for some level of 2487 support by previous S/MIME specifications: 2489 - RSA with MD5 was dropped in [SMIMEv4.0]. MD5 is no longer 2490 considered to be secure as it is no longer collision-resistant. 2491 Details can be found in [RFC6151]. 2493 - RSA and DSA with SHA-1 were dropped in [SMIMEv4.0]. SHA-1 is no 2494 longer considered to be secure as it is no longer collision- 2495 resistant. The IETF statment on SHA-1 can be found in [RFC6194] 2496 but it is out-of-date relative to the most recent advances. 2498 - DSA with SHA-256 was dropped in [SMIMEv4.0]. DSA has been 2499 replaced by elliptic curve versions. 2501 As requirements for manditory to implement has changed over time, 2502 some issues have been created that can cause interopatability 2503 problems: 2505 - S/MIME v2 clients are only required to verify digital signatures 2506 using the rsaEncryption algorithm with SHA-1 or MD5, and might not 2507 implement id-dsa-with-sha1 or id-dsa at all. 2509 - S/MIME v3 clients might only implement signing or signature 2510 verification using id-dsa-with-sha1, and might also use id-dsa as 2511 an AlgorithmIdentifier in this field. 2513 - Note that S/MIME v3.1 clients support verifying id-dsa-with-sha1 2514 and rsaEncryption and might not implement sha256withRSAEncryption. 2516 NOTE: Receiving clients SHOULD recognize id-dsa as equivalent to id- 2517 dsa-with-sha1, and sending clients MUST use id-dsa-with-sha1 if using 2518 that algorithm. 2520 For 512-bit RSA with SHA-1 see [RFC3370] and [FIPS186-2] without 2521 Change Notice 1, for 512-bit RSA with SHA-256 see [RFC5754] and 2522 [FIPS186-2] without Change Notice 1, and for 1024-bit through 2523 2048-bit RSA with SHA-256 see [RFC5754] and [FIPS186-2] with Change 2524 Notice 1. The first reference provides the signature algorithm's 2525 object identifier, and the second provides the signature algorithm's 2526 definition. 2528 For 512-bit DSA with SHA-1 see [RFC3370] and [FIPS186-2] without 2529 Change Notice 1, for 512-bit DSA with SHA-256 see [RFC5754] and 2531 [FIPS186-2] without Change Notice 1, for 1024-bit DSA with SHA-1 see 2532 [RFC3370] and [FIPS186-2] with Change Notice 1, for 1024-bit and 2533 above DSA with SHA-256 see [RFC5754] and [FIPS186-4]. The first 2534 reference provides the signature algorithm's object identifier and 2535 the second provides the signature algorithm's definition. 2537 B.3. ContentEncryptionAlgorithmIdentifier 2539 The following algorithms have been called out for some level of 2540 support by previous S/MIME specifications: 2542 - RC2/40 [RFC2268] was dropped in [SMIMEv3.2]. The algorithm is 2543 known to be insecure and, if supported, should only be used to 2544 decrypt existing email. 2546 - DES EDE3 CBC [TripleDES], also known as "tripleDES" is dropped in 2547 [SMIMEv4.0]. This algorithms is removed from the supported list 2548 due to the fact that it has a 64-bit block size and the fact that 2549 it offers less that 128-bits of security. This algorithm should 2550 be supported only to decrypt existing email, it should not be used 2551 to encrypt new emails. 2553 B.4. KeyEncryptionAlgorithmIdentifier 2555 The following algorithms have been called out for some level of 2556 support by previous S/MIME specifications: 2558 - DH ephemeral-static mode, as specified in [RFC3370] and 2559 [SP800-57], was dropped in [SMIMEv4.0]. 2561 - RSA key sizes have been increased over time. Decrypting old mail 2562 with smaller key sizes is reasonable, however new mail should use 2563 the updated key sizes. 2565 For 1024-bit DH, see [RFC3370]. For 1024-bit and larger DH, see 2566 [SP800-56A]; regardless, use the KDF, which is from X9.42, specified 2567 in [RFC3370]. 2569 Appendix C. Moving S/MIME v2 Message Specification to Historic Status 2571 The S/MIME v3 [SMIMEv3], v3.1 [SMIMEv3.1], and v3.2 [SMIMEv3.2] are 2572 backwards compatible with the S/MIME v2 Message Specification 2573 [SMIMEv2], with the exception of the algorithms (dropped RC2/40 2574 requirement and added DSA and RSASSA-PSS requirements). Therefore, 2575 it is recommended that RFC 2311 [SMIMEv2] be moved to Historic 2576 status. 2578 Appendix D. Acknowledgments 2580 Many thanks go out to the other authors of the S/MIME version 2 2581 Message Specification RFC: Steve Dusse, Paul Hoffman, Laurence 2582 Lundblade, and Lisa Repka. Without v2, there wouldn't be a v3, v3.1, 2583 v3.2 or v4.0. 2585 Some of the examples in this document were stolen from [RFC4134]. 2586 Thanks go the the people who wrote and verified the examples in that 2587 document. 2589 A number of the members of the S/MIME Working Group have also worked 2590 very hard and contributed to this document. Any list of people is 2591 doomed to omission, and for that I apologize. In alphabetical order, 2592 the following people stand out in my mind because they made direct 2593 contributions to various versions of this document: 2595 Tony Capel, Piers Chivers, Dave Crocker, Bill Flanigan, Peter 2596 Gutmann, Alfred Hoenes, Paul Hoffman, Russ Housley, William Ottaway, 2597 and John Pawling. 2599 Authors' Addresses 2601 Jim Schaad 2602 August Cellars 2604 Email: ietf@augustcellars.com 2606 Blake Ramsdell 2607 Brute Squad Labs, Inc. 2609 Email: blaker@gmail.com 2611 Sean Turner 2612 sn3rd 2614 Email: sean@sn3rd.com