idnits 2.17.00 (12 Aug 2021) /tmp/idnits39579/draft-ietf-lamps-rfc5751-bis-01.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 1169 has weird spacing: '...sedData id-...' == Line 1568 has weird spacing: '...s7-mime any ...' == 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 (August 29, 2016) is 2090 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 1394, but not defined -- Looks like a reference, but probably isn't: '0' on line 2272 -- Looks like a reference, but probably isn't: '1' on line 2273 -- Looks like a reference, but probably isn't: '2' on line 2274 == Missing Reference: 'CMSALG' is mentioned on line 2293, but not defined == Missing Reference: 'CMS-SHA2' is mentioned on line 2293, but not defined == Missing Reference: 'RSAPSS' is mentioned on line 2293, but not defined == Missing Reference: 'RSAOAEP' is mentioned on line 2294, but not defined == Unused Reference: 'RFC2049' is defined on line 1961, but no explicit reference was found in the text == Unused Reference: 'RFC4288' is defined on line 2009, but no explicit reference was found in the text == Unused Reference: 'RFC4289' is defined on line 2013, but no explicit reference was found in the text == Unused Reference: 'RFC2314' is defined on line 2193, but no explicit reference was found in the text == Unused Reference: 'RFC2633' is defined on line 2199, but no explicit reference was found in the text == Unused Reference: 'RFC3852' is defined on line 2206, 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-2' -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS186-3' -- 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'. -- Possible downref: Non-RFC (?) normative reference: ref. 'SP800-56A' -- 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: 2 errors (**), 0 flaws (~~), 17 warnings (==), 23 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: March 2, 2017 S. Turner 7 sn3rd 8 August 29, 2016 10 Secure/Multipurpose Internet Mail Extensions (S/MIME) Version 3.5 11 Message Specification 12 draft-ietf-lamps-rfc5751-bis-01 14 Abstract 16 This document defines Secure/Multipurpose Internet Mail Extensions 17 (S/MIME) version 3.5. 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 March 2, 2017. 48 Copyright Notice 50 Copyright (c) 2016 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 . . . . . . . . . 7 84 1.7. Changes since S/MIME v3.2 . . . . . . . . . . . . . . . . 9 85 2. CMS Options . . . . . . . . . . . . . . . . . . . . . . . . . 9 86 2.1. DigestAlgorithmIdentifier . . . . . . . . . . . . . . . . 9 87 2.2. SignatureAlgorithmIdentifier . . . . . . . . . . . . . . 10 88 2.3. KeyEncryptionAlgorithmIdentifier . . . . . . . . . . . . 10 89 2.4. General Syntax . . . . . . . . . . . . . . . . . . . . . 11 90 2.4.1. Data Content Type . . . . . . . . . . . . . . . . . . 11 91 2.4.2. SignedData Content Type . . . . . . . . . . . . . . . 11 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 . . . . . . . . . . . 12 96 2.5.1. Signing Time Attribute . . . . . . . . . . . . . . . 13 97 2.5.2. SMIME Capabilities Attribute . . . . . . . . . . . . 13 98 2.5.3. Encryption Key Preference Attribute . . . . . . . . . 15 99 2.6. SignerIdentifier SignerInfo Type . . . . . . . . . . . . 16 100 2.7. ContentEncryptionAlgorithmIdentifier . . . . . . . . . . 16 101 2.7.1. Deciding Which Encryption Method to Use . . . . . . . 17 102 2.7.2. Choosing Weak Encryption . . . . . . . . . . . . . . 18 103 2.7.3. Multiple Recipients . . . . . . . . . . . . . . . . . 18 104 3. Creating S/MIME Messages . . . . . . . . . . . . . . . . . . 19 105 3.1. Preparing the MIME Entity for Signing, Enveloping, or 106 Compressing . . . . . . . . . . . . . . . . . . . . . . . 19 107 3.1.1. Canonicalization . . . . . . . . . . . . . . . . . . 20 108 3.1.2. Transfer Encoding . . . . . . . . . . . . . . . . . . 21 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 . . . . . . . . . . 23 112 3.2.1. The name and filename Parameters . . . . . . . . . . 24 113 3.2.2. The smime-type Parameter . . . . . . . . . . . . . . 25 114 3.3. Creating an Enveloped-Only Message . . . . . . . . . . . 26 115 3.4. Creating an Authenticated Enveloped-Only Message . . . . 26 116 3.5. Creating a Signed-Only Message . . . . . . . . . . . . . 27 117 3.5.1. Choosing a Format for Signed-Only Messages . . . . . 28 118 3.5.2. Signing Using application/pkcs7-mime with SignedData 28 119 3.5.3. Signing Using the multipart/signed Format . . . . . . 29 120 3.6. Creating a Compressed-Only Message . . . . . . . . . . . 31 121 3.7. Multiple Operations . . . . . . . . . . . . . . . . . . . 32 122 3.8. Creating a Certificate Management Message . . . . . . . . 33 123 3.9. Registration Requests . . . . . . . . . . . . . . . . . . 33 124 3.10. Identifying an S/MIME Message . . . . . . . . . . . . . . 33 125 4. Certificate Processing . . . . . . . . . . . . . . . . . . . 34 126 4.1. Key Pair Generation . . . . . . . . . . . . . . . . . . . 34 127 4.2. Signature Generation . . . . . . . . . . . . . . . . . . 35 128 4.3. Signature Verification . . . . . . . . . . . . . . . . . 35 129 4.4. Encryption . . . . . . . . . . . . . . . . . . . . . . . 35 130 4.5. Decryption . . . . . . . . . . . . . . . . . . . . . . . 35 131 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 36 132 5.1. Media Type for application/pkcs7-mime . . . . . . . . . . 36 133 5.2. Media Type for application/pkcs7-signature . . . . . . . 37 134 5.3. Register authEnvelopedData smime-type . . . . . . . . . . 38 135 6. Security Considerations . . . . . . . . . . . . . . . . . . . 38 136 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 42 137 7.1. Normative References . . . . . . . . . . . . . . . . . . 42 138 7.2. Informative References . . . . . . . . . . . . . . . . . 45 139 Appendix A. ASN.1 Module . . . . . . . . . . . . . . . . . . . . 48 140 Appendix B. Processing of Historic Mail . . . . . . . . . . . . 50 141 B.1. DigestAlgorithmIdentifier . . . . . . . . . . . . . . . . 51 142 B.2. Signature Algorithms . . . . . . . . . . . . . . . . . . 51 143 B.3. ContentEncryptionAlgorithmIdentifier . . . . . . . . . . 52 145 Appendix C. Moving S/MIME v2 Message Specification to Historic 146 Status . . . . . . . . . . . . . . . . . . . . . . . 53 147 Appendix D. Acknowledgments . . . . . . . . . . . . . . . . . . 53 148 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 53 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 3.5 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]. RFC 2311 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. 398 Updated references. Added informational references to SMIMEv2, 399 SMIMEv3, and SMIMEv3.1. 401 Appendix C: Added Appendix B to move S/MIME v2 to Historic status. 403 1.7. Changes since S/MIME v3.2 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): Add 409 AES-256 GCM , remove AES-192 CBC, mark tripleDES as historic. 411 2. CMS Options 413 CMS allows for a wide variety of options in content, attributes, and 414 algorithm support. This section puts forth a number of support 415 requirements and recommendations in order to achieve a base level of 416 interoperability among all S/MIME implementations. [RFC3370] and 417 [RFC5754] provides additional details regarding the use of the 418 cryptographic algorithms. [ESS] provides additional details 419 regarding the use of additional attributes. 421 2.1. DigestAlgorithmIdentifier 423 The algorithms here are used for digesting the body of the message 424 and are not the same as the digest algorithms used as part the 425 signature algorithms. The result of this is placed in the message- 426 digest attribute of the signed attributes. It is RECOMMENDED that 427 the algorithm used for digesting the body of the message be of 428 similar or greater strength than the signature algorithm. 430 Sending and Receiving agents: 432 - MUST support SHA-256 [RFC5754] 433 - MUST support SHA-512. 435 2.2. SignatureAlgorithmIdentifier 437 Receiving agents: 439 - MUST support ECDSA with curve P-256 and SHA-256. 441 - MUST support EdDSA with curve 25519 using PureEdDSA mode. 443 - MUST- support RSA with SHA-256. 445 - SHOULD support RSASSA-PSS with SHA-256. 447 - MUST NOT support EdDSA using the pre-hash mode. 449 Sending agents: 451 - MUST support at least one of the following algorithms: RSASSA-PSS 452 with SHA-256, ECDSA with curve P-256 and SHA-256 or EdDSA with 453 curve 25519 using PureEdDSA mode. 455 - MUST- support RSA with SHA-256. 457 - MUST NOT support EdDSA using the pre-hash mode. 459 Both ECDSA and EdDSA are included in the list of required algorithms 460 for political reasons. NIST is unable to provide the seeds that were 461 used to create their standardized curves, this means that there is a 462 section of the community which believes that there might be a 463 backdoor to these curves. The EdDSA curves were created in response 464 to this feeling. However, there are still significant sections of 465 the industry which need to have NIST approved algorithms. For this 466 reason, both sets of curves are represented in the recieving agent 467 list, but only a requirement for one is in the sending agent list. 469 See Section 4.1 for information on key size and algorithm references. 471 2.3. KeyEncryptionAlgorithmIdentifier 473 Receiving and sending agents: 475 - MUST support RSA Encryption, as specified in [RFC3370]. 477 - SHOULD+ support RSAES-OAEP, as specified in [RFC3560]. 479 - SHOULD- support DH ephemeral-static mode, as specified in 480 [RFC3370] and [SP800-57]. 482 When DH ephemeral-static is used, a key wrap algorithm is also 483 specified in the KeyEncryptionAlgorithmIdentifier [RFC5652]. The 484 underlying encryption functions for the key wrap and content 485 encryption algorithm ([RFC3370] and [RFC3565]) and the key sizes for 486 the two algorithms MUST be the same (e.g., AES-128 key wrap algorithm 487 with AES-128 content encryption algorithm). As AES-128 CBC is the 488 mandatory-to-implement content encryption algorithm, the AES-128 key 489 wrap algorithm MUST also be supported when DH ephemeral-static is 490 used. 492 Note that S/MIME v3.1 clients might only implement key encryption and 493 decryption using the rsaEncryption algorithm. Note that S/MIME v3 494 clients might only implement key encryption and decryption using the 495 Diffie-Hellman algorithm. Also note that S/MIME v2 clients are only 496 capable of decrypting content-encryption keys using the rsaEncryption 497 algorithm. 499 2.4. General Syntax 501 There are several CMS content types. Of these, only the Data, 502 SignedData, EnvelopedData, AuthEnvelopedData, and CompressedData 503 content types are currently used for S/MIME. 505 2.4.1. Data Content Type 507 Sending agents MUST use the id-data content type identifier to 508 identify the "inner" MIME message content. For example, when 509 applying a digital signature to MIME data, the CMS SignedData 510 encapContentInfo eContentType MUST include the id-data object 511 identifier and the media type MUST be stored in the SignedData 512 encapContentInfo eContent OCTET STRING (unless the sending agent is 513 using multipart/signed, in which case the eContent is absent, per 514 Section 3.5.3 of this document). As another example, when applying 515 encryption to MIME data, the CMS EnvelopedData encryptedContentInfo 516 contentType MUST include the id-data object identifier and the 517 encrypted MIME content MUST be stored in the EnvelopedData 518 encryptedContentInfo encryptedContent OCTET STRING. 520 2.4.2. SignedData Content Type 522 Sending agents MUST use the SignedData content type to apply a 523 digital signature to a message or, in a degenerate case where there 524 is no signature information, to convey certificates. Applying a 525 signature to a message provides authentication, message integrity, 526 and non-repudiation of origin. 528 2.4.3. EnvelopedData Content Type 530 This content type is used to apply data confidentiality to a message. 531 A sender needs to have access to a public key for each intended 532 message recipient to use this service. 534 2.4.4. AuthEnvelopedData Content Type 536 This content type is used to apply data confidentiality and message 537 integrity to a message. This content type does not provide 538 authentication or non-repudiation. A sender needs to have access to 539 a public key for each intended message recipient to use this service. 541 2.4.5. CompressedData Content Type 543 This content type is used to apply data compression to a message. 544 This content type does not provide authentication, message integrity, 545 non-repudiation, or data confidentiality, and is only used to reduce 546 the message's size. 548 See Section 3.7 for further guidance on the use of this type in 549 conjunction with other CMS types. 551 2.5. Attributes and the SignerInfo Type 553 The SignerInfo type allows the inclusion of unsigned and signed 554 attributes along with a signature. 556 Receiving agents MUST be able to handle zero or one instance of each 557 of the signed attributes listed here. Sending agents SHOULD generate 558 one instance of each of the following signed attributes in each 559 S/MIME message: 561 - Signing Time (Section 2.5.1 in this document) 563 - SMIME Capabilities (Section 2.5.2 in this document) 565 - Encryption Key Preference (Section 2.5.3 in this document) 567 - Message Digest (Section 11.2 in [RFC5652]) 569 - Content Type (Section 11.1 in [RFC5652]) 571 Further, receiving agents SHOULD be able to handle zero or one 572 instance of the signingCertificate and signingCertificatev2 signed 573 attributes, as defined in Section 5 of RFC 2634 [ESS] and Section 3 574 of RFC 5035 [ESS]. 576 Sending agents SHOULD generate one instance of the signingCertificate 577 or signingCertificatev2 signed attribute in each SignerInfo 578 structure. 580 Additional attributes and values for these attributes might be 581 defined in the future. Receiving agents SHOULD handle attributes or 582 values that they do not recognize in a graceful manner. 584 Interactive sending agents that include signed attributes that are 585 not listed here SHOULD display those attributes to the user, so that 586 the user is aware of all of the data being signed. 588 2.5.1. Signing Time Attribute 590 The signing-time attribute is used to convey the time that a message 591 was signed. The time of signing will most likely be created by a 592 message originator and therefore is only as trustworthy as the 593 originator. 595 Sending agents MUST encode signing time through the year 2049 as 596 UTCTime; signing times in 2050 or later MUST be encoded as 597 GeneralizedTime. When the UTCTime CHOICE is used, S/MIME agents MUST 598 interpret the year field (YY) as follows: 600 If YY is greater than or equal to 50, the year is interpreted as 601 19YY; if YY is less than 50, the year is interpreted as 20YY. 603 Receiving agents MUST be able to process signing-time attributes that 604 are encoded in either UTCTime or GeneralizedTime. 606 2.5.2. SMIME Capabilities Attribute 608 The SMIMECapabilities attribute includes signature algorithms (such 609 as "sha256WithRSAEncryption"), symmetric algorithms (such as "AES-128 610 CBC"), authenticated symmetric algorithms (such as "AES-GCM") and key 611 encipherment algorithms (such as "rsaEncryption"). There are also 612 several identifiers that indicate support for other optional features 613 such as binary encoding and compression. The SMIMECapabilities were 614 designed to be flexible and extensible so that, in the future, a 615 means of identifying other capabilities and preferences such as 616 certificates can be added in a way that will not cause current 617 clients to break. 619 If present, the SMIMECapabilities attribute MUST be a 620 SignedAttribute; it MUST NOT be an UnsignedAttribute. CMS defines 621 SignedAttributes as a SET OF Attribute. The SignedAttributes in a 622 signerInfo MUST NOT include multiple instances of the 623 SMIMECapabilities attribute. CMS defines the ASN.1 syntax for 624 Attribute to include attrValues SET OF AttributeValue. A 625 SMIMECapabilities attribute MUST only include a single instance of 626 AttributeValue. There MUST NOT be zero or multiple instances of 627 AttributeValue present in the attrValues SET OF AttributeValue. 629 The semantics of the SMIMECapabilities attribute specify a partial 630 list as to what the client announcing the SMIMECapabilities can 631 support. A client does not have to list every capability it 632 supports, and need not list all its capabilities so that the 633 capabilities list doesn't get too long. In an SMIMECapabilities 634 attribute, the object identifiers (OIDs) are listed in order of their 635 preference, but SHOULD be separated logically along the lines of 636 their categories (signature algorithms, symmetric algorithms, key 637 encipherment algorithms, etc.). 639 The structure of the SMIMECapabilities attribute is to facilitate 640 simple table lookups and binary comparisons in order to determine 641 matches. For instance, the DER-encoding for the SMIMECapability for 642 AES-128 CBC MUST be identically encoded regardless of the 643 implementation. Because of the requirement for identical encoding, 644 individuals documenting algorithms to be used in the 645 SMIMECapabilities attribute SHOULD explicitly document the correct 646 byte sequence for the common cases. 648 For any capability, the associated parameters for the OID MUST 649 specify all of the parameters necessary to differentiate between two 650 instances of the same algorithm. 652 The OIDs that correspond to algorithms SHOULD use the same OID as the 653 actual algorithm, except in the case where the algorithm usage is 654 ambiguous from the OID. For instance, in an earlier specification, 655 rsaEncryption was ambiguous because it could refer to either a 656 signature algorithm or a key encipherment algorithm. In the event 657 that an OID is ambiguous, it needs to be arbitrated by the maintainer 658 of the registered SMIMECapabilities list as to which type of 659 algorithm will use the OID, and a new OID MUST be allocated under the 660 smimeCapabilities OID to satisfy the other use of the OID. 662 The registered SMIMECapabilities list specifies the parameters for 663 OIDs that need them, most notably key lengths in the case of 664 variable-length symmetric ciphers. In the event that there are no 665 differentiating parameters for a particular OID, the parameters MUST 666 be omitted, and MUST NOT be encoded as NULL. Additional values for 667 the SMIMECapabilities attribute might be defined in the future. 668 Receiving agents MUST handle a SMIMECapabilities object that has 669 values that it does not recognize in a graceful manner. 671 Section 2.7.1 explains a strategy for caching capabilities. 673 2.5.3. Encryption Key Preference Attribute 675 The encryption key preference attribute allows the signer to 676 unambiguously describe which of the signer's certificates has the 677 signer's preferred encryption key. This attribute is designed to 678 enhance behavior for interoperating with those clients that use 679 separate keys for encryption and signing. This attribute is used to 680 convey to anyone viewing the attribute which of the listed 681 certificates is appropriate for encrypting a session key for future 682 encrypted messages. 684 If present, the SMIMEEncryptionKeyPreference attribute MUST be a 685 SignedAttribute; it MUST NOT be an UnsignedAttribute. CMS defines 686 SignedAttributes as a SET OF Attribute. The SignedAttributes in a 687 signerInfo MUST NOT include multiple instances of the 688 SMIMEEncryptionKeyPreference attribute. CMS defines the ASN.1 syntax 689 for Attribute to include attrValues SET OF AttributeValue. A 690 SMIMEEncryptionKeyPreference attribute MUST only include a single 691 instance of AttributeValue. There MUST NOT be zero or multiple 692 instances of AttributeValue present in the attrValues SET OF 693 AttributeValue. 695 The sending agent SHOULD include the referenced certificate in the 696 set of certificates included in the signed message if this attribute 697 is used. The certificate MAY be omitted if it has been previously 698 made available to the receiving agent. Sending agents SHOULD use 699 this attribute if the commonly used or preferred encryption 700 certificate is not the same as the certificate used to sign the 701 message. 703 Receiving agents SHOULD store the preference data if the signature on 704 the message is valid and the signing time is greater than the 705 currently stored value. (As with the SMIMECapabilities, the clock 706 skew SHOULD be checked and the data not used if the skew is too 707 great.) Receiving agents SHOULD respect the sender's encryption key 708 preference attribute if possible. This, however, represents only a 709 preference and the receiving agent can use any certificate in 710 replying to the sender that is valid. 712 Section 2.7.1 explains a strategy for caching preference data. 714 2.5.3.1. Selection of Recipient Key Management Certificate 716 In order to determine the key management certificate to be used when 717 sending a future CMS EnvelopedData message for a particular 718 recipient, the following steps SHOULD be followed: 720 - If an SMIMEEncryptionKeyPreference attribute is found in a 721 SignedData object received from the desired recipient, this 722 identifies the X.509 certificate that SHOULD be used as the X.509 723 key management certificate for the recipient. 725 - If an SMIMEEncryptionKeyPreference attribute is not found in a 726 SignedData object received from the desired recipient, the set of 727 X.509 certificates SHOULD be searched for a X.509 certificate with 728 the same subject name as the signer of a X.509 certificate that 729 can be used for key management. 731 - Or use some other method of determining the user's key management 732 key. If a X.509 key management certificate is not found, then 733 encryption cannot be done with the signer of the message. If 734 multiple X.509 key management certificates are found, the S/MIME 735 agent can make an arbitrary choice between them. 737 2.6. SignerIdentifier SignerInfo Type 739 S/MIME v3.5 implementations MUST support both issuerAndSerialNumber 740 and subjectKeyIdentifier. Messages that use the subjectKeyIdentifier 741 choice cannot be read by S/MIME v2 clients. 743 It is important to understand that some certificates use a value for 744 subjectKeyIdentifier that is not suitable for uniquely identifying a 745 certificate. Implementations MUST be prepared for multiple 746 certificates for potentially different entities to have the same 747 value for subjectKeyIdentifier, and MUST be prepared to try each 748 matching certificate during signature verification before indicating 749 an error condition. 751 2.7. ContentEncryptionAlgorithmIdentifier 753 Sending and receiving agents: 755 - MUST support encryption and decryption with AES-128 GCM and 756 AES-256 GCM [RFC5084]. 758 - MUST- support encryption and decryption with AES-128 CBC 759 [RFC3565]. 761 - SHOULD+ support encryption and decryption with ChaCha20-Poly1305 762 [RFC7905]. 764 2.7.1. Deciding Which Encryption Method to Use 766 When a sending agent creates an encrypted message, it has to decide 767 which type of encryption to use. The decision process involves using 768 information garnered from the capabilities lists included in messages 769 received from the recipient, as well as out-of-band information such 770 as private agreements, user preferences, legal restrictions, and so 771 on. 773 Section 2.5.2 defines a method by which a sending agent can 774 optionally announce, among other things, its decrypting capabilities 775 in its order of preference. The following method for processing and 776 remembering the encryption capabilities attribute in incoming signed 777 messages SHOULD be used. 779 - If the receiving agent has not yet created a list of capabilities 780 for the sender's public key, then, after verifying the signature 781 on the incoming message and checking the timestamp, the receiving 782 agent SHOULD create a new list containing at least the signing 783 time and the symmetric capabilities. 785 - If such a list already exists, the receiving agent SHOULD verify 786 that the signing time in the incoming message is greater than the 787 signing time stored in the list and that the signature is valid. 788 If so, the receiving agent SHOULD update both the signing time and 789 capabilities in the list. Values of the signing time that lie far 790 in the future (that is, a greater discrepancy than any reasonable 791 clock skew), or a capabilities list in messages whose signature 792 could not be verified, MUST NOT be accepted. 794 The list of capabilities SHOULD be stored for future use in creating 795 messages. 797 Before sending a message, the sending agent MUST decide whether it is 798 willing to use weak encryption for the particular data in the 799 message. If the sending agent decides that weak encryption is 800 unacceptable for this data, then the sending agent MUST NOT use a 801 weak algorithm. The decision to use or not use weak encryption 802 overrides any other decision in this section about which encryption 803 algorithm to use. 805 Section 2.7.1.1 and Section 2.7.1.2 describe the decisions a sending 806 agent SHOULD use in deciding which type of encryption will be applied 807 to a message. These rules are ordered, so the sending agent SHOULD 808 make its decision in the order given. 810 2.7.1.1. Rule 1: Known Capabilities 812 If the sending agent has received a set of capabilities from the 813 recipient for the message the agent is about to encrypt, then the 814 sending agent SHOULD use that information by selecting the first 815 capability in the list (that is, the capability most preferred by the 816 intended recipient) that the sending agent knows how to encrypt. The 817 sending agent SHOULD use one of the capabilities in the list if the 818 agent reasonably expects the recipient to be able to decrypt the 819 message. 821 2.7.1.2. Rule 2: Unknown Capabilities, Unknown Version of S/MIME 823 If the following two conditions are met: 825 - the sending agent has no knowledge of the encryption capabilities 826 of the recipient, and 828 - the sending agent has no knowledge of the version of S/MIME of the 829 recipient, 831 then the sending agent SHOULD use AES-256 GCM because it is a 832 stronger algorithm and is required by S/MIME v3.5. If the sending 833 agent chooses not to use AES-256 GCM in this step, it SHOULD use 834 AES-128 CBC. 836 2.7.2. Choosing Weak Encryption 838 All algorithms that use 112-bit keys are considered by many to be 839 weak encryption. A sending agent that is controlled by a human 840 SHOULD allow a human sender to determine the risks of sending data 841 using a weak encryption algorithm before sending the data, and 842 possibly allow the human to use a stronger encryption method such as 843 AES GCM or AES CBC. 845 2.7.3. Multiple Recipients 847 If a sending agent is composing an encrypted message to a group of 848 recipients where the encryption capabilities of some of the 849 recipients do not overlap, the sending agent is forced to send more 850 than one message. Please note that if the sending agent chooses to 851 send a message encrypted with a strong algorithm, and then send the 852 same message encrypted with a weak algorithm, someone watching the 853 communications channel could learn the contents of the strongly 854 encrypted message simply by decrypting the weakly encrypted message. 856 3. Creating S/MIME Messages 858 This section describes the S/MIME message formats and how they are 859 created. S/MIME messages are a combination of MIME bodies and CMS 860 content types. Several media types as well as several CMS content 861 types are used. The data to be secured is always a canonical MIME 862 entity. The MIME entity and other data, such as certificates and 863 algorithm identifiers, are given to CMS processing facilities that 864 produce a CMS object. Finally, the CMS object is wrapped in MIME. 865 The Enhanced Security Services for S/MIME [ESS] document provides 866 descriptions of how nested, secured S/MIME messages are formatted. 867 ESS provides a description of how a triple-wrapped S/MIME message is 868 formatted using multipart/signed and application/pkcs7-mime for the 869 signatures. 871 S/MIME provides one format for enveloped-only data, several formats 872 for signed-only data, and several formats for signed and enveloped 873 data. Several formats are required to accommodate several 874 environments, in particular for signed messages. The criteria for 875 choosing among these formats are also described. 877 The reader of this section is expected to understand MIME as 878 described in [MIME-SPEC] and [RFC1847]. 880 3.1. Preparing the MIME Entity for Signing, Enveloping, or Compressing 882 S/MIME is used to secure MIME entities. A MIME entity can be a sub- 883 part, sub-parts of a message, or the whole message with all its sub- 884 parts. A MIME entity that is the whole message includes only the 885 MIME message headers and MIME body, and does not include the RFC-822 886 header. Note that S/MIME can also be used to secure MIME entities 887 used in applications other than Internet mail. If protection of the 888 RFC-822 header is required, the use of the message/rfc822 media type 889 is explained later in this section. 891 The MIME entity that is secured and described in this section can be 892 thought of as the "inside" MIME entity. That is, it is the 893 "innermost" object in what is possibly a larger MIME message. 894 Processing "outside" MIME entities into CMS content types is 895 described in Section 3.2, Section 3.5, and elsewhere. 897 The procedure for preparing a MIME entity is given in [MIME-SPEC]. 898 The same procedure is used here with some additional restrictions 899 when signing. The description of the procedures from [MIME-SPEC] is 900 repeated here, but it is suggested that the reader refer to that 901 document for the exact procedure. This section also describes 902 additional requirements. 904 A single procedure is used for creating MIME entities that are to 905 have any combination of signing, enveloping, and compressing applied. 906 Some additional steps are recommended to defend against known 907 corruptions that can occur during mail transport that are of 908 particular importance for clear-signing using the multipart/signed 909 format. It is recommended that these additional steps be performed 910 on enveloped messages, or signed and enveloped messages, so that the 911 message can be forwarded to any environment without modification. 913 These steps are descriptive rather than prescriptive. The 914 implementer is free to use any procedure as long as the result is the 915 same. 917 Step 1. The MIME entity is prepared according to the local 918 conventions. 920 Step 2. The leaf parts of the MIME entity are converted to canonical 921 form. 923 Step 3. Appropriate transfer encoding is applied to the leaves of 924 the MIME entity. 926 When an S/MIME message is received, the security services on the 927 message are processed, and the result is the MIME entity. That MIME 928 entity is typically passed to a MIME-capable user agent where it is 929 further decoded and presented to the user or receiving application. 931 In order to protect outer, non-content-related message header fields 932 (for instance, the "Subject", "To", "From", and "Cc" fields), the 933 sending client MAY wrap a full MIME message in a message/rfc822 934 wrapper in order to apply S/MIME security services to these header 935 fields. It is up to the receiving client to decide how to present 936 this "inner" header along with the unprotected "outer" header. 938 When an S/MIME message is received, if the top-level protected MIME 939 entity has a Content-Type of message/rfc822, it can be assumed that 940 the intent was to provide header protection. This entity SHOULD be 941 presented as the top-level message, taking into account header 942 merging issues as previously discussed. 944 3.1.1. Canonicalization 946 Each MIME entity MUST be converted to a canonical form that is 947 uniquely and unambiguously representable in the environment where the 948 signature is created and the environment where the signature will be 949 verified. MIME entities MUST be canonicalized for enveloping and 950 compressing as well as signing. 952 The exact details of canonicalization depend on the actual media type 953 and subtype of an entity, and are not described here. Instead, the 954 standard for the particular media type SHOULD be consulted. For 955 example, canonicalization of type text/plain is different from 956 canonicalization of audio/basic. Other than text types, most types 957 have only one representation regardless of computing platform or 958 environment that can be considered their canonical representation. 959 In general, canonicalization will be performed by the non-security 960 part of the sending agent rather than the S/MIME implementation. 962 The most common and important canonicalization is for text, which is 963 often represented differently in different environments. MIME 964 entities of major type "text" MUST have both their line endings and 965 character set canonicalized. The line ending MUST be the pair of 966 characters , and the charset SHOULD be a registered charset 967 [CHARSETS]. The details of the canonicalization are specified in 968 [MIME-SPEC]. 970 Note that some charsets such as ISO-2022 have multiple 971 representations for the same characters. When preparing such text 972 for signing, the canonical representation specified for the charset 973 MUST be used. 975 3.1.2. Transfer Encoding 977 When generating any of the secured MIME entities below, except the 978 signing using the multipart/signed format, no transfer encoding is 979 required at all. S/MIME implementations MUST be able to deal with 980 binary MIME objects. If no Content-Transfer-Encoding header field is 981 present, the transfer encoding is presumed to be 7BIT. 983 S/MIME implementations SHOULD however use transfer encoding described 984 in Section 3.1.3 for all MIME entities they secure. The reason for 985 securing only 7-bit MIME entities, even for enveloped data that are 986 not exposed to the transport, is that it allows the MIME entity to be 987 handled in any environment without changing it. For example, a 988 trusted gateway might remove the envelope, but not the signature, of 989 a message, and then forward the signed message on to the end 990 recipient so that they can verify the signatures directly. If the 991 transport internal to the site is not 8-bit clean, such as on a wide- 992 area network with a single mail gateway, verifying the signature will 993 not be possible unless the original MIME entity was only 7-bit data. 995 S/MIME implementations that "know" that all intended recipients are 996 capable of handling inner (all but the outermost) binary MIME objects 997 SHOULD use binary encoding as opposed to a 7-bit-safe transfer 998 encoding for the inner entities. The use of a 7-bit-safe encoding 999 (such as base64) would unnecessarily expand the message size. 1001 Implementations MAY "know" that recipient implementations are capable 1002 of handling inner binary MIME entities either by interpreting the id- 1003 cap-preferBinaryInside SMIMECapabilities attribute, by prior 1004 agreement, or by other means. 1006 If one or more intended recipients are unable to handle inner binary 1007 MIME objects, or if this capability is unknown for any of the 1008 intended recipients, S/MIME implementations SHOULD use transfer 1009 encoding described in Section 3.1.3 for all MIME entities they 1010 secure. 1012 3.1.3. Transfer Encoding for Signing Using multipart/signed 1014 If a multipart/signed entity is ever to be transmitted over the 1015 standard Internet SMTP infrastructure or other transport that is 1016 constrained to 7-bit text, it MUST have transfer encoding applied so 1017 that it is represented as 7-bit text. MIME entities that are 7-bit 1018 data already need no transfer encoding. Entities such as 8-bit text 1019 and binary data can be encoded with quoted-printable or base-64 1020 transfer encoding. 1022 The primary reason for the 7-bit requirement is that the Internet 1023 mail transport infrastructure cannot guarantee transport of 8-bit or 1024 binary data. Even though many segments of the transport 1025 infrastructure now handle 8-bit and even binary data, it is sometimes 1026 not possible to know whether the transport path is 8-bit clean. If a 1027 mail message with 8-bit data were to encounter a message transfer 1028 agent that cannot transmit 8-bit or binary data, the agent has three 1029 options, none of which are acceptable for a clear-signed message: 1031 - The agent could change the transfer encoding; this would 1032 invalidate the signature. 1034 - The agent could transmit the data anyway, which would most likely 1035 result in the 8th bit being corrupted; this too would invalidate 1036 the signature. 1038 - The agent could return the message to the sender. 1040 [RFC1847] prohibits an agent from changing the transfer encoding of 1041 the first part of a multipart/signed message. If a compliant agent 1042 that cannot transmit 8-bit or binary data encounters a 1043 multipart/signed message with 8-bit or binary data in the first part, 1044 it would have to return the message to the sender as undeliverable. 1046 3.1.4. Sample Canonical MIME Entity 1048 This example shows a multipart/mixed message with full transfer 1049 encoding. This message contains a text part and an attachment. The 1050 sample message text includes characters that are not US-ASCII and 1051 thus need to be transfer encoded. Though not shown here, the end of 1052 each line is . The line ending of the MIME headers, the 1053 text, and the transfer encoded parts, all MUST be . 1055 Note that this example is not of an S/MIME message. 1057 Content-Type: multipart/mixed; boundary=bar 1059 --bar 1060 Content-Type: text/plain; charset=iso-8859-1 1061 Content-Transfer-Encoding: quoted-printable 1063 =A1Hola Michael! 1065 How do you like the new S/MIME specification? 1067 It's generally a good idea to encode lines that begin with 1068 From=20because some mail transport agents will insert a greater- 1069 than (>) sign, thus invalidating the signature. 1071 Also, in some cases it might be desirable to encode any =20 1072 trailing whitespace that occurs on lines in order to ensure =20 1073 that the message signature is not invalidated when passing =20 1074 a gateway that modifies such whitespace (like BITNET). =20 1076 --bar 1077 Content-Type: image/jpeg 1078 Content-Transfer-Encoding: base64 1080 iQCVAwUBMJrRF2N9oWBghPDJAQE9UQQAtl7LuRVndBjrk4EqYBIb3h5QXIX/LC// 1081 jJV5bNvkZIGPIcEmI5iFd9boEgvpirHtIREEqLQRkYNoBActFBZmh9GC3C041WGq 1082 uMbrbxc+nIs1TIKlA08rVi9ig/2Yh7LFrK5Ein57U/W72vgSxLhe/zhdfolT9Brn 1083 HOxEa44b+EI= 1085 --bar-- 1087 3.2. The application/pkcs7-mime Media Type 1089 The application/pkcs7-mime media type is used to carry CMS content 1090 types including EnvelopedData, SignedData, and CompressedData. The 1091 details of constructing these entities are described in subsequent 1092 sections. This section describes the general characteristics of the 1093 application/pkcs7-mime media type. 1095 The carried CMS object always contains a MIME entity that is prepared 1096 as described in Section 3.1 if the eContentType is id-data. Other 1097 contents MAY be carried when the eContentType contains different 1098 values. See [ESS] for an example of this with signed receipts. 1100 Since CMS content types are binary data, in most cases base-64 1101 transfer encoding is appropriate, in particular, when used with SMTP 1102 transport. The transfer encoding used depends on the transport 1103 through which the object is to be sent, and is not a characteristic 1104 of the media type. 1106 Note that this discussion refers to the transfer encoding of the CMS 1107 object or "outside" MIME entity. It is completely distinct from, and 1108 unrelated to, the transfer encoding of the MIME entity secured by the 1109 CMS object, the "inside" object, which is described in Section 3.1. 1111 Because there are several types of application/pkcs7-mime objects, a 1112 sending agent SHOULD do as much as possible to help a receiving agent 1113 know about the contents of the object without forcing the receiving 1114 agent to decode the ASN.1 for the object. The Content-Type header 1115 field of all application/pkcs7-mime objects SHOULD include the 1116 optional "smime-type" parameter, as described in the following 1117 sections. 1119 3.2.1. The name and filename Parameters 1121 For the application/pkcs7-mime, sending agents SHOULD emit the 1122 optional "name" parameter to the Content-Type field for compatibility 1123 with older systems. Sending agents SHOULD also emit the optional 1124 Content-Disposition field [RFC2138] with the "filename" parameter. 1125 If a sending agent emits the above parameters, the value of the 1126 parameters SHOULD be a file name with the appropriate extension: 1128 Media Type File 1129 Extension 1130 application/pkcs7-mime (SignedData, EnvelopedData) .p7m 1131 application/pkcs7-mime (degenerate SignedData certificate .p7c 1132 management message) 1133 application/pkcs7-mime (CompressedData) .p7z 1134 application/pkcs7-signature (SignedData) .p7s 1136 In addition, the file name SHOULD be limited to eight characters 1137 followed by a three-letter extension. The eight-character filename 1138 base can be any distinct name; the use of the filename base "smime" 1139 SHOULD be used to indicate that the MIME entity is associated with 1140 S/MIME. 1142 Including a file name serves two purposes. It facilitates easier use 1143 of S/MIME objects as files on disk. It also can convey type 1144 information across gateways. When a MIME entity of type 1145 application/pkcs7-mime (for example) arrives at a gateway that has no 1146 special knowledge of S/MIME, it will default the entity's media type 1147 to application/octet-stream and treat it as a generic attachment, 1148 thus losing the type information. However, the suggested filename 1149 for an attachment is often carried across a gateway. This often 1150 allows the receiving systems to determine the appropriate application 1151 to hand the attachment off to, in this case, a stand-alone S/MIME 1152 processing application. Note that this mechanism is provided as a 1153 convenience for implementations in certain environments. A proper 1154 S/MIME implementation MUST use the media types and MUST NOT rely on 1155 the file extensions. 1157 3.2.2. The smime-type Parameter 1159 The application/pkcs7-mime content type defines the optional "smime- 1160 type" parameter. The intent of this parameter is to convey details 1161 about the security applied (signed or enveloped) along with 1162 information about the contained content. This specification defines 1163 the following smime-types. 1165 Name CMS Type Inner Content 1166 enveloped-data EnvelopedData id-data 1167 signed-data SignedData id-data 1168 certs-only SignedData id-data 1169 compressed-data CompressedData id-data 1170 authEnvelopedData AuthEnvelopedData id-data 1172 In order for consistency to be obtained with future specifications, 1173 the following guidelines SHOULD be followed when assigning a new 1174 smime-type parameter. 1176 1. If both signing and encryption can be applied to the content, 1177 then two values for smime-type SHOULD be assigned "signed-*" and 1178 "enveloped-*". If one operation can be assigned, then this can 1179 be omitted. Thus, since "certs-only" can only be signed, 1180 "signed-" is omitted. 1182 2. A common string for a content OID SHOULD be assigned. We use 1183 "data" for the id-data content OID when MIME is the inner 1184 content. 1186 3. If no common string is assigned, then the common string of 1187 "OID." is recommended (for example, 1188 "OID.2.16.840.1.101.3.4.1.2" would be AES-128 CBC). 1190 It is explicitly intended that this field be a suitable hint for mail 1191 client applications to indicate whether a message is "signed" or 1192 "enveloped" without having to tunnel into the CMS payload. 1194 3.3. Creating an Enveloped-Only Message 1196 This section describes the format for enveloping a MIME entity 1197 without signing it. It is important to note that sending enveloped 1198 but not signed messages does not provide for data integrity. It is 1199 possible to replace ciphertext in such a way that the processed 1200 message will still be valid, but the meaning can be altered. 1202 Step 1. The MIME entity to be enveloped is prepared according to 1203 Section 3.1. 1205 Step 2. The MIME entity and other required data is processed into a 1206 CMS object of type EnvelopedData. In addition to encrypting 1207 a copy of the content-encryption key for each recipient, a 1208 copy of the content-encryption key SHOULD be encrypted for 1209 the originator and included in the EnvelopedData (see 1210 [RFC5652], Section 6). 1212 Step 3. The EnvelopedData object is wrapped in a CMS ContentInfo 1213 object. 1215 Step 4. The ContentInfo object is inserted into an 1216 application/pkcs7-mime MIME entity. 1218 The smime-type parameter for enveloped-only messages is "enveloped- 1219 data". The file extension for this type of message is ".p7m". 1221 A sample message would be: 1223 Content-Type: application/pkcs7-mime; smime-type=enveloped-data; 1224 name=smime.p7m 1225 Content-Transfer-Encoding: base64 1226 Content-Disposition: attachment; filename=smime.p7m 1228 rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6 1229 7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H 1230 f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 1231 0GhIGfHfQbnj756YT64V 1233 3.4. Creating an Authenticated Enveloped-Only Message 1235 This section describes the format for enveloping a MIME entity 1236 without signing it. Authenticated enveloped messages provide 1237 confidentiality and integrity. It is important to note that sending 1238 authenticated enveloped messages does not provide for authentication 1239 when using S/MIME. It is possible to replace ciphertext in such a 1240 way that the processed message will still be valid, but the meaning 1241 can be altered. However this is substantially more difficult than it 1242 is for an enveloped-only message as the 1244 Step 1. The MIME entity to be enveloped is prepared according to 1245 Section 3.1. 1247 Step 2. The MIME entity and other required data is processed into a 1248 CMS object of type AuthEnvelopedData. In addition to 1249 encrypting a copy of the content-encryption key for each 1250 recipient, a copy of the content-encryption key SHOULD be 1251 encrypted for the originator and included in the 1252 AuthEnvelopedData (see [RFC5083]). 1254 Step 3. The AuthEnvelopedData object is wrapped in a CMS ContentInfo 1255 object. 1257 Step 4. The ContentInfo object is inserted into an 1258 application/pkcs7-mime MIME entity. 1260 The smime-type parameter for authenticated enveloped-only messages is 1261 "authEnvelopedData". The file extension for this type of message is 1262 ".p7m". 1264 A sample message would be: 1266 Content-Type: application/pkcs7-mime; smime-type=authEnvelopedData; 1267 name=smime.p7m 1268 Content-Transfer-Encoding: base64 1269 Content-Disposition: attachment; filename=smime.p7m 1271 rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6 1272 7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H 1273 f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 1274 0GhIGfHfQbnj756YT64V 1276 3.5. Creating a Signed-Only Message 1278 There are two formats for signed messages defined for S/MIME: 1280 - application/pkcs7-mime with SignedData. 1282 - multipart/signed. 1284 In general, the multipart/signed form is preferred for sending, and 1285 receiving agents MUST be able to handle both. 1287 3.5.1. Choosing a Format for Signed-Only Messages 1289 There are no hard-and-fast rules as to when a particular signed-only 1290 format is chosen. It depends on the capabilities of all the 1291 receivers and the relative importance of receivers with S/MIME 1292 facilities being able to verify the signature versus the importance 1293 of receivers without S/MIME software being able to view the message. 1295 Messages signed using the multipart/signed format can always be 1296 viewed by the receiver whether or not they have S/MIME software. 1297 They can also be viewed whether they are using a MIME-native user 1298 agent or they have messages translated by a gateway. In this 1299 context, "be viewed" means the ability to process the message 1300 essentially as if it were not a signed message, including any other 1301 MIME structure the message might have. 1303 Messages signed using the SignedData format cannot be viewed by a 1304 recipient unless they have S/MIME facilities. However, the 1305 SignedData format protects the message content from being changed by 1306 benign intermediate agents. Such agents might do line wrapping or 1307 content-transfer encoding changes that would break the signature. 1309 3.5.2. Signing Using application/pkcs7-mime with SignedData 1311 This signing format uses the application/pkcs7-mime media type. The 1312 steps to create this format are: 1314 Step 1. The MIME entity is prepared according to Section 3.1. 1316 Step 2. The MIME entity and other required data are processed into a 1317 CMS object of type SignedData. 1319 Step 3. The SignedData object is wrapped in a CMS ContentInfo 1320 object. 1322 Step 4. The ContentInfo object is inserted into an 1323 application/pkcs7-mime MIME entity. 1325 The smime-type parameter for messages using application/pkcs7-mime 1326 with SignedData is "signed-data". The file extension for this type 1327 of message is ".p7m". 1329 A sample message would be: 1331 Content-Type: application/pkcs7-mime; smime-type=signed-data; 1332 name=smime.p7m 1333 Content-Transfer-Encoding: base64 1334 Content-Disposition: attachment; filename=smime.p7m 1336 567GhIGfHfYT6ghyHhHUujpfyF4f8HHGTrfvhJhjH776tbB9HG4VQbnj7 1337 77n8HHGT9HG4VQpfyF467GhIGfHfYT6rfvbnj756tbBghyHhHUujhJhjH 1338 HUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H7n8HHGghyHh 1339 6YT64V0GhIGfHfQbnj75 1341 3.5.3. Signing Using the multipart/signed Format 1343 This format is a clear-signing format. Recipients without any S/MIME 1344 or CMS processing facilities are able to view the message. It makes 1345 use of the multipart/signed media type described in [RFC1847]. The 1346 multipart/signed media type has two parts. The first part contains 1347 the MIME entity that is signed; the second part contains the 1348 "detached signature" CMS SignedData object in which the 1349 encapContentInfo eContent field is absent. 1351 3.5.3.1. The application/pkcs7-signature Media Type 1353 This media type always contains a CMS ContentInfo containing a single 1354 CMS object of type SignedData. The SignedData encapContentInfo 1355 eContent field MUST be absent. The signerInfos field contains the 1356 signatures for the MIME entity. 1358 The file extension for signed-only messages using application/pkcs7- 1359 signature is ".p7s". 1361 3.5.3.2. Creating a multipart/signed Message 1363 Step 1. The MIME entity to be signed is prepared according to 1364 Section 3.1, taking special care for clear-signing. 1366 Step 2. The MIME entity is presented to CMS processing in order to 1367 obtain an object of type SignedData in which the 1368 encapContentInfo eContent field is absent. 1370 Step 3. The MIME entity is inserted into the first part of a 1371 multipart/signed message with no processing other than that 1372 described in Section 3.1. 1374 Step 4. Transfer encoding is applied to the "detached signature" CMS 1375 SignedData object, and it is inserted into a MIME entity of 1376 type application/pkcs7-signature. 1378 Step 5. The MIME entity of the application/pkcs7-signature is 1379 inserted into the second part of the multipart/signed 1380 entity. 1382 The multipart/signed Content-Type has two required parameters: the 1383 protocol parameter and the micalg parameter. 1385 The protocol parameter MUST be "application/pkcs7-signature". Note 1386 that quotation marks are required around the protocol parameter 1387 because MIME requires that the "/" character in the parameter value 1388 MUST be quoted. 1390 The micalg parameter allows for one-pass processing when the 1391 signature is being verified. The value of the micalg parameter is 1392 dependent on the message digest algorithm(s) used in the calculation 1393 of the Message Integrity Check. If multiple message digest 1394 algorithms are used, they MUST be separated by commas per [MIME- 1395 SECURE]. The values to be placed in the micalg parameter SHOULD be 1396 from the following: 1398 Algorithm Value Used 1399 MD5 md5 1400 SHA-1 sha-1 1401 SHA-224 sha-224 1402 SHA-256 sha-256 1403 SHA-384 sha-384 1404 SHA-512 sha-512 1405 Any other (defined separately in algorithm profile or "unknown" if 1406 not defined) 1408 (Historical note: some early implementations of S/MIME emitted and 1409 expected "rsa-md5", "rsa-sha1", and "sha1" for the micalg parameter.) 1410 Receiving agents SHOULD be able to recover gracefully from a micalg 1411 parameter value that they do not recognize. Future names for this 1412 parameter will be consistent with the IANA "Hash Function Textual 1413 Names" registry. 1415 3.5.3.3. Sample multipart/signed Message 1416 Content-Type: multipart/signed; 1417 protocol="application/pkcs7-signature"; 1418 micalg=sha-1; boundary=boundary42 1420 --boundary42 1421 Content-Type: text/plain 1423 This is a clear-signed message. 1425 --boundary42 1426 Content-Type: application/pkcs7-signature; name=smime.p7s 1427 Content-Transfer-Encoding: base64 1428 Content-Disposition: attachment; filename=smime.p7s 1430 ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6 1431 4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj 1432 n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 1433 7GhIGfHfYT64VQbnj756 1435 --boundary42-- 1437 The content that is digested (the first part of the multipart/signed) 1438 consists of the bytes: 1440 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 78 74 2f 70 6c 61 69 1441 6e 0d 0a 0d 0a 54 68 69 73 20 69 73 20 61 20 63 6c 65 61 72 2d 73 69 1442 67 6e 65 64 20 6d 65 73 73 61 67 65 2e 0d 0a 1444 3.6. Creating a Compressed-Only Message 1446 This section describes the format for compressing a MIME entity. 1447 Please note that versions of S/MIME prior to version 3.1 did not 1448 specify any use of CompressedData, and will not recognize it. The 1449 use of a capability to indicate the ability to receive CompressedData 1450 is described in [RFC3274] and is the preferred method for 1451 compatibility. 1453 Step 1. The MIME entity to be compressed is prepared according to 1454 Section 3.1. 1456 Step 2. The MIME entity and other required data are processed into a 1457 CMS object of type CompressedData. 1459 Step 3. The CompressedData object is wrapped in a CMS ContentInfo 1460 object. 1462 Step 4. The ContentInfo object is inserted into an 1463 application/pkcs7-mime MIME entity. 1465 The smime-type parameter for compressed-only messages is "compressed- 1466 data". The file extension for this type of message is ".p7z". 1468 A sample message would be: 1470 Content-Type: application/pkcs7-mime; smime-type=compressed-data; 1471 name=smime.p7z 1472 Content-Transfer-Encoding: base64 1473 Content-Disposition: attachment; filename=smime.p7z 1475 rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6 1476 7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H 1477 f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 1478 0GhIGfHfQbnj756YT64V 1480 3.7. Multiple Operations 1482 The signed-only, enveloped-only, and compressed-only MIME formats can 1483 be nested. This works because these formats are all MIME entities 1484 that encapsulate other MIME entities. 1486 An S/MIME implementation MUST be able to receive and process 1487 arbitrarily nested S/MIME within reasonable resource limits of the 1488 recipient computer. 1490 It is possible to apply any of the signing, encrypting, and 1491 compressing operations in any order. It is up to the implementer and 1492 the user to choose. When signing first, the signatories are then 1493 securely obscured by the enveloping. When enveloping first the 1494 signatories are exposed, but it is possible to verify signatures 1495 without removing the enveloping. This can be useful in an 1496 environment where automatic signature verification is desired, as no 1497 private key material is required to verify a signature. 1499 There are security ramifications to choosing whether to sign first or 1500 encrypt first. A recipient of a message that is encrypted and then 1501 signed can validate that the encrypted block was unaltered, but 1502 cannot determine any relationship between the signer and the 1503 unencrypted contents of the message. A recipient of a message that 1504 is signed then encrypted can assume that the signed message itself 1505 has not been altered, but that a careful attacker could have changed 1506 the unauthenticated portions of the encrypted message. 1508 When using compression, keep the following guidelines in mind: 1510 - Compression of binary encoded encrypted data is discouraged, since 1511 it will not yield significant compression. Base64 encrypted data 1512 could very well benefit, however. 1514 - If a lossy compression algorithm is used with signing, you will 1515 need to compress first, then sign. 1517 3.8. Creating a Certificate Management Message 1519 The certificate management message or MIME entity is used to 1520 transport certificates and/or Certificate Revocation Lists, such as 1521 in response to a registration request. 1523 Step 1. The certificates and/or Certificate Revocation Lists are 1524 made available to the CMS generating process that creates a 1525 CMS object of type SignedData. The SignedData 1526 encapContentInfo eContent field MUST be absent and 1527 signerInfos field MUST be empty. 1529 Step 2. The SignedData object is wrapped in a CMS ContentInfo 1530 object. 1532 Step 3. The ContentInfo object is enclosed in an 1533 application/pkcs7-mime MIME entity. 1535 The smime-type parameter for a certificate management message is 1536 "certs-only". The file extension for this type of message is ".p7c". 1538 3.9. Registration Requests 1540 A sending agent that signs messages MUST have a certificate for the 1541 signature so that a receiving agent can verify the signature. There 1542 are many ways of getting certificates, such as through an exchange 1543 with a certification authority, through a hardware token or diskette, 1544 and so on. 1546 S/MIME v2 [SMIMEv2] specified a method for "registering" public keys 1547 with certificate authorities using an application/pkcs10 body part. 1548 Since that time, the IETF PKIX Working Group has developed other 1549 methods for requesting certificates. However, S/MIME v3.2 does not 1550 require a particular certificate request mechanism. 1552 3.10. Identifying an S/MIME Message 1554 Because S/MIME takes into account interoperation in non-MIME 1555 environments, several different mechanisms are employed to carry the 1556 type information, and it becomes a bit difficult to identify S/MIME 1557 messages. The following table lists criteria for determining whether 1558 or not a message is an S/MIME message. A message is considered an 1559 S/MIME message if it matches any of the criteria listed below. 1561 The file suffix in the table below comes from the "name" parameter in 1562 the Content-Type header field, or the "filename" parameter on the 1563 Content-Disposition header field. These parameters that give the 1564 file suffix are not listed below as part of the parameter section. 1566 Media type parameters file 1567 suffix 1568 application/pkcs7-mime any any 1569 multipart/signed protocol="application/pkcs7-signature" any 1570 application/octet- any p7m, 1571 stream p7s, 1572 p7c, 1573 p7z 1575 4. Certificate Processing 1577 A receiving agent MUST provide some certificate retrieval mechanism 1578 in order to gain access to certificates for recipients of digital 1579 envelopes. This specification does not cover how S/MIME agents 1580 handle certificates, only what they do after a certificate has been 1581 validated or rejected. S/MIME certificate issues are covered in 1582 [RFC5750]. 1584 At a minimum, for initial S/MIME deployment, a user agent could 1585 automatically generate a message to an intended recipient requesting 1586 that recipient's certificate in a signed return message. Receiving 1587 and sending agents SHOULD also provide a mechanism to allow a user to 1588 "store and protect" certificates for correspondents in such a way so 1589 as to guarantee their later retrieval. 1591 4.1. Key Pair Generation 1593 All generated key pairs MUST be generated from a good source of non- 1594 deterministic random input [RFC4086] and the private key MUST be 1595 protected in a secure fashion. 1597 An S/MIME user agent MUST NOT generate asymmetric keys less than 1024 1598 bits for use with the RSA signature algorithm. 1600 For 512-bit RSA with SHA-1 see [RFC3370] and [FIPS186-2] without 1601 Change Notice 1, for 512-bit RSA with SHA-256 see [RFC5754] and 1602 [FIPS186-2] without Change Notice 1, and for 1024-bit through 1603 2048-bit RSA with SHA-256 see [RFC5754] and [FIPS186-2] with Change 1604 Notice 1. The first reference provides the signature algorithm's 1605 object identifier, and the second provides the signature algorithm's 1606 definition. 1608 For 512-bit DSA with SHA-1 see [RFC3370] and [FIPS186-2] without 1609 Change Notice 1, for 512-bit DSA with SHA-256 see [RFC5754] and 1610 [FIPS186-2] without Change Notice 1, for 1024-bit DSA with SHA-1 see 1611 [RFC3370] and [FIPS186-2] with Change Notice 1, for 1024-bit and 1612 above DSA with SHA-256 see [RFC5754] and [FIPS186-3]. The first 1613 reference provides the signature algorithm's object identifier and 1614 the second provides the signature algorithm's definition. 1616 For RSASSA-PSS with SHA-256, see [RFC4056]. For 1024-bit DH, see 1617 [RFC3370]. For 1024-bit and larger DH, see [SP800-56A]; regardless, 1618 use the KDF, which is from X9.42, specified in [RFC3370]. For RSAES- 1619 OAEP, see [RFC3560]. 1621 4.2. Signature Generation 1623 The following are the requirements for an S/MIME agent generated RSA 1624 and RSASSA-PSS signatures: 1626 key size <= 2047 : SHOULD NOT (see Historic Mail Considerations) 1627 2048 <= key size <= 4096 : SHOULD (see Security Considerations) 1628 4096 < key size : MAY (see Security Considerations) 1630 4.3. Signature Verification 1632 The following are the requirements for S/MIME receiving agents during 1633 signature verification of RSA and RSASSA-PSS signatures: 1635 key size <= 2047 : SHOULD NOT (see Historic Mail Considerations) 1636 2048 <= key size <= 4096 : MUST (see Security Considerations) 1637 4096 < key size : MAY (see Security Considerations) 1639 4.4. Encryption 1641 The following are the requirements for an S/MIME agent when 1642 establishing keys for content encryption using the RSA, RSA-OAEP, and 1643 DH algorithms: 1645 key size <= 1023 : SHOULD NOT (see Security Considerations) 1646 1024 <= key size <= 2048 : SHOULD (see Security Considerations) 1647 2048 < key size : MAY (see Security Considerations) 1649 4.5. Decryption 1651 The following are the requirements for an S/MIME agent when 1652 establishing keys for content decryption using the RSA, RSAES-OAEP, 1653 and DH algorithms: 1655 key size <= 1023 : MAY (see Security Considerations) 1656 1024 <= key size <= 2048 : MUST (see Security Considerations) 1657 2048 < key size : MAY (see Security Considerations) 1659 5. IANA Considerations 1661 The following information updates the media type registration for 1662 application/pkcs7-mime and application/pkcs7-signature to refer to 1663 this document as opposed to RFC 2311. 1665 Note that other documents can define additional MIME media types for 1666 S/MIME. 1668 5.1. Media Type for application/pkcs7-mime 1669 Type name: application 1671 Subtype Name: pkcs7-mime 1673 Required Parameters: NONE 1675 Optional Parameters: smime-type/signed-data 1676 smime-type/enveloped-data 1677 smime-type/compressed-data 1678 smime-type/certs-only 1679 name 1681 Encoding Considerations: See Section 3 of this document 1683 Security Considerations: See Section 6 of this document 1685 Interoperability Considerations: See Sections 1-6 of this document 1687 Published Specification: RFC 2311, RFC 2633, and this document 1689 Applications that use this media type: Security applications 1691 Additional information: NONE 1693 Person & email to contact for further information: 1694 S/MIME working group chairs smime-chairs@ietf.org 1696 Intended usage: COMMON 1698 Restrictions on usage: NONE 1700 Author: Sean Turner 1702 Change Controller: S/MIME working group delegated from the IESG 1704 5.2. Media Type for application/pkcs7-signature 1705 Type name: application 1707 Subtype Name: pkcs7-signature 1709 Required Parameters: NONE 1711 Optional Parameters: NONE 1713 Encoding Considerations: See Section 3 of this document 1715 Security Considerations: See Section 6 of this document 1717 Interoperability Considerations: See Sections 1-6 of this document 1719 Published Specification: RFC 2311, RFC 2633, and this document 1721 Applications that use this media type: Security applications 1723 Additional information: NONE 1725 Person & email to contact for further information: 1726 S/MIME working group chairs smime-chairs@ietf.org 1728 Intended usage: COMMON 1730 Restrictions on usage: NONE 1732 Author: Sean Turner 1734 Change Controller: S/MIME working group delegated from the IESG 1736 5.3. Register authEnvelopedData smime-type 1738 IANA is required to register the following value in the "Parameter 1739 Values for the smime-type Parameter" registry. The values to be 1740 registered are: 1742 smime-type value: authEnvelopedData 1744 Reference: [[This Document, Section 3.2.2]] 1746 6. Security Considerations 1748 Cryptographic algorithms will be broken or weakened over time. 1749 Implementers and users need to check that the cryptographic 1750 algorithms listed in this document continue to provide the expected 1751 level of security. The IETF from time to time may issue documents 1752 dealing with the current state of the art. For example: 1754 - The Million Message Attack described in RFC 3218 [RFC3218]. 1756 - The Diffie-Hellman "small-subgroup" attacks described in RFC 2785 1757 [RFC2785]. 1759 - The attacks against hash algorithms described in RFC 4270 1760 [RFC4270]. 1762 This specification uses Public-Key Cryptography technologies. It is 1763 assumed that the private key is protected to ensure that it is not 1764 accessed or altered by unauthorized parties. 1766 It is impossible for most people or software to estimate the value of 1767 a message's content. Further, it is impossible for most people or 1768 software to estimate the actual cost of recovering an encrypted 1769 message content that is encrypted with a key of a particular size. 1770 Further, it is quite difficult to determine the cost of a failed 1771 decryption if a recipient cannot process a message's content. Thus, 1772 choosing between different key sizes (or choosing whether to just use 1773 plaintext) is also impossible for most people or software. However, 1774 decisions based on these criteria are made all the time, and 1775 therefore this specification gives a framework for using those 1776 estimates in choosing algorithms. 1778 The choice of 2048 bits as the RSA asymmetric key size in this 1779 specification is based on the desire to provide at least 100 bits of 1780 security. The key sizes that must be supported to conform to this 1781 specification seem appropriate for the Internet based on [RFC3766]. 1782 Of course, there are environments, such as financial and medical 1783 systems, that may select different key sizes. For this reason, an 1784 implementation MAY support key sizes beyond those recommended in this 1785 specification. 1787 Receiving agents that validate signatures and sending agents that 1788 encrypt messages need to be cautious of cryptographic processing 1789 usage when validating signatures and encrypting messages using keys 1790 larger than those mandated in this specification. An attacker could 1791 send certificates with keys that would result in excessive 1792 cryptographic processing, for example, keys larger than those 1793 mandated in this specification, which could swamp the processing 1794 element. Agents that use such keys without first validating the 1795 certificate to a trust anchor are advised to have some sort of 1796 cryptographic resource management system to prevent such attacks. 1798 Using weak cryptography in S/MIME offers little actual security over 1799 sending plaintext. However, other features of S/MIME, such as the 1800 specification of AES and the ability to announce stronger 1801 cryptographic capabilities to parties with whom you communicate, 1802 allow senders to create messages that use strong encryption. Using 1803 weak cryptography is never recommended unless the only alternative is 1804 no cryptography. 1806 RSA and DSA keys of less than 2048 bits are now considered by many 1807 experts to be cryptographically insecure (due to advances in 1808 computing power), and should no longer be used to protect messages. 1809 Such keys were previously considered secure, so processing previously 1810 received signed and encrypted mail will often result in the use of 1811 weak keys. Implementations that wish to support previous versions of 1812 S/MIME or process old messages need to consider the security risks 1813 that result from smaller key sizes (e.g., spoofed messages) versus 1814 the costs of denial of service. If an implementation supports 1815 verification of digital signatures generated with RSA and DSA keys of 1816 less than 1024 bits, it MUST warn the user. Implementers should 1817 consider providing different warnings for newly received messages and 1818 previously stored messages. Server implementations (e.g., secure 1819 mail list servers) where user warnings are not appropriate SHOULD 1820 reject messages with weak signatures. 1822 Implementers SHOULD be aware that multiple active key pairs can be 1823 associated with a single individual. For example, one key pair can 1824 be used to support confidentiality, while a different key pair can be 1825 used for digital signatures. 1827 If a sending agent is sending the same message using different 1828 strengths of cryptography, an attacker watching the communications 1829 channel might be able to determine the contents of the strongly 1830 encrypted message by decrypting the weakly encrypted version. In 1831 other words, a sender SHOULD NOT send a copy of a message using 1832 weaker cryptography than they would use for the original of the 1833 message. 1835 Modification of the ciphertext can go undetected if authentication is 1836 not also used, which is the case when sending EnvelopedData without 1837 wrapping it in SignedData or enclosing SignedData within it. 1839 If an implementation is concerned about compliance with National 1840 Institute of Standards and Technology (NIST) key size 1841 recommendations, then see [SP800-57]. 1843 If messaging environments make use of the fact that a message is 1844 signed to change the behavior of message processing (examples would 1845 be running rules or UI display hints), without first verifying that 1846 the message is actually signed and knowing the state of the 1847 signature, this can lead to incorrect handling of the message. 1848 Visual indicators on messages may need to have the signature 1849 validation code checked periodically if the indicator is supposed to 1850 give information on the current status of a message. 1852 Many people assume that the use of an authenticated encryption 1853 algorithm is all that is needed to be in a situtation where the 1854 sender of the message will be authenticated. In almost all cases 1855 this is not a correct statement. There are a number of preconditions 1856 that need to hold for an authenticated encryption algorithm to 1857 provide this service: 1859 - The starting key must be bound to a single entity. The use of a 1860 group key only would allow for the statement that a message was 1861 sent by one of the entities that held the key but will not 1862 identify a specific entity. 1864 - The message must have exactly one sender and one recipient. 1865 Having more than one recipient would allow for the second 1866 recipient to create a message that the first recipient would 1867 believe is from the sender by stripping them as a recipient from 1868 the message. 1870 - A direct path needs to exist from the starting key to the key used 1871 as the content encryption key (CEK) which guarantees that no third 1872 party could have seen the resulting CEK. This means that one 1873 needs to be using an algorithm that is called a "Direct 1874 Encryption" or a "Direct Key Agreement" algorithm in other 1875 contexts. This means that the starting key is used directly as 1876 the CEK key, or that the starting key is used to create a secret 1877 which then is transformed into the CEK via a KDF step. 1879 S/MIME implementations almost universally use ephemeral-static rather 1880 than static-static key agreement and do not use a pre-existing shared 1881 secret when doing encryption, this means that the first precondition 1882 is not met. There is a document [RFC6278] which defined how to use 1883 static-static key agreement with CMS so that is readably doable. 1884 Currently, all S/MIME key agreement methods derive a KEK and wrap a 1885 CEK. This violates the third precondition above. New key key 1886 agreement algorithms that directly created the CEK without creating 1887 an intervening KEK would need to be defined. 1889 Even when all of the preconditions are met and origination of a 1890 message is established by the use of an authenticated encryption 1891 algorithm, users need to be aware that there is no way to prove this 1892 to a third party. This is because either of the parties can 1893 successfully create the message (or just alter the content) based on 1894 the fact that the CEK is going to be known to both parties. Thus the 1895 origination is always built on a presumption that "I did not send 1896 this message to myself." 1898 7. References 1900 7.1. Normative References 1902 [ASN.1] "Information Technology - Abstract Syntax Notation 1903 (ASN.1)". 1905 ASN.1 syntax consists of the following references [X.680], 1906 [X.681], [X.682], and [X.683]. 1908 [CHARSETS] 1909 "Character sets assigned by IANA.", 1910 . 1912 [CMS] "Cryptograhic Message Syntax". 1914 This is the set of documents dealing with the 1915 cryptographic message syntax and refers to [RFC5652] and 1916 [RFC5083]. 1918 [ESS] "Enhanced Security Services for S/MIME". 1920 This is the set of documents dealing with enhanged 1921 security services and refers to [RFC2634] and [RFC5035]. 1923 [FIPS186-2] 1924 National Institute of Standards and Technology (NIST), 1925 "Digital Signature Standard (DSS) [With Change Notice 1]", 1926 Federal Information Processing Standards 1927 Publication 186-2, January 2000. 1929 [FIPS186-3] 1930 National Institute of Standards and Technology (NIST), 1931 "Digital Signature Standard (DSS)", Federal Information 1932 Processing Standards Publication 186-3, June 2009. 1934 [MIME-SPEC] 1935 "MIME Message Specifications". 1937 This is the set of documents that define how to use MIME. 1938 This set of documents is [RFC2045], [RFC2046], [RFC2047], 1939 [RFC2049], [RFC4288], and [RFC4289]. 1941 [RFC1847] Galvin, J., Murphy, S., Crocker, S., and N. Freed, 1942 "Security Multiparts for MIME: Multipart/Signed and 1943 Multipart/Encrypted", RFC 1847, DOI 10.17487/RFC1847, 1944 October 1995, . 1946 [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 1947 Extensions (MIME) Part One: Format of Internet Message 1948 Bodies", RFC 2045, DOI 10.17487/RFC2045, November 1996, 1949 . 1951 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 1952 Extensions (MIME) Part Two: Media Types", RFC 2046, 1953 DOI 10.17487/RFC2046, November 1996, 1954 . 1956 [RFC2047] Moore, K., "MIME (Multipurpose Internet Mail Extensions) 1957 Part Three: Message Header Extensions for Non-ASCII Text", 1958 RFC 2047, DOI 10.17487/RFC2047, November 1996, 1959 . 1961 [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 1962 Extensions (MIME) Part Five: Conformance Criteria and 1963 Examples", RFC 2049, DOI 10.17487/RFC2049, November 1996, 1964 . 1966 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1967 Requirement Levels", BCP 14, RFC 2119, 1968 DOI 10.17487/RFC2119, March 1997, 1969 . 1971 [RFC2138] Rigney, C., Rubens, A., Simpson, W., and S. Willens, 1972 "Remote Authentication Dial In User Service (RADIUS)", 1973 RFC 2138, DOI 10.17487/RFC2138, April 1997, 1974 . 1976 [RFC2634] Hoffman, P., Ed., "Enhanced Security Services for S/MIME", 1977 RFC 2634, DOI 10.17487/RFC2634, June 1999, 1978 . 1980 [RFC3274] Gutmann, P., "Compressed Data Content Type for 1981 Cryptographic Message Syntax (CMS)", RFC 3274, 1982 DOI 10.17487/RFC3274, June 2002, 1983 . 1985 [RFC3370] Housley, R., "Cryptographic Message Syntax (CMS) 1986 Algorithms", RFC 3370, DOI 10.17487/RFC3370, August 2002, 1987 . 1989 [RFC3560] Housley, R., "Use of the RSAES-OAEP Key Transport 1990 Algorithm in Cryptographic Message Syntax (CMS)", 1991 RFC 3560, DOI 10.17487/RFC3560, July 2003, 1992 . 1994 [RFC3565] Schaad, J., "Use of the Advanced Encryption Standard (AES) 1995 Encryption Algorithm in Cryptographic Message Syntax 1996 (CMS)", RFC 3565, DOI 10.17487/RFC3565, July 2003, 1997 . 1999 [RFC4056] Schaad, J., "Use of the RSASSA-PSS Signature Algorithm in 2000 Cryptographic Message Syntax (CMS)", RFC 4056, 2001 DOI 10.17487/RFC4056, June 2005, 2002 . 2004 [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, 2005 "Randomness Requirements for Security", BCP 106, RFC 4086, 2006 DOI 10.17487/RFC4086, June 2005, 2007 . 2009 [RFC4288] Freed, N. and J. Klensin, "Media Type Specifications and 2010 Registration Procedures", RFC 4288, DOI 10.17487/RFC4288, 2011 December 2005, . 2013 [RFC4289] Freed, N. and J. Klensin, "Multipurpose Internet Mail 2014 Extensions (MIME) Part Four: Registration Procedures", 2015 BCP 13, RFC 4289, DOI 10.17487/RFC4289, December 2005, 2016 . 2018 [RFC5035] Schaad, J., "Enhanced Security Services (ESS) Update: 2019 Adding CertID Algorithm Agility", RFC 5035, 2020 DOI 10.17487/RFC5035, August 2007, 2021 . 2023 [RFC5083] Housley, R., "Cryptographic Message Syntax (CMS) 2024 Authenticated-Enveloped-Data Content Type", RFC 5083, 2025 DOI 10.17487/RFC5083, November 2007, 2026 . 2028 [RFC5084] Housley, R., "Using AES-CCM and AES-GCM Authenticated 2029 Encryption in the Cryptographic Message Syntax (CMS)", 2030 RFC 5084, DOI 10.17487/RFC5084, November 2007, 2031 . 2033 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 2034 RFC 5652, DOI 10.17487/RFC5652, September 2009, 2035 . 2037 [RFC5754] Turner, S., "Using SHA2 Algorithms with Cryptographic 2038 Message Syntax", RFC 5754, DOI 10.17487/RFC5754, January 2039 2010, . 2041 [SMIMEv3.5] 2042 "S/MIME version 3.5". 2044 This group of documents represents S/MIME version 3.5. 2045 This set of documents are [RFC2634], [RFC5750], [[This 2046 Document]], [RFC5652], and [RFC5035]. 2048 [SP800-56A] 2049 National Institute of Standards and Technology (NIST), 2050 "Special Publication 800-56A Revision 2: Recommendation 2051 Pair-Wise Key Establishment Schemes Using Discrete 2052 Logarithm Cryptography", May 2013. 2054 [X.680] "Information Technology - Abstract Syntax Notation One 2055 (ASN.1): Specification of basic notation. ITU-T 2056 Recommendation X.680 (2002)", ITU-T X.680, ISO/ 2057 IEC 8824-1:2008, November 2008. 2059 [X.681] "Information Technology - Abstract Syntax Notation One 2060 (ASN.1): Information object specification", ITU-T X.681, 2061 ISO/IEC 8824-2:2008, November 2008. 2063 [X.682] "Information Technology - Abstract Syntax Notation One 2064 (ASN.1): Constraint specification", ITU-T X.682, ISO/ 2065 IEC 8824-3:2008, November 2008. 2067 [X.683] "Information Technology - Abstract Syntax Notation One 2068 (ASN.1): Parameteriztion of ASN.1 specifications", 2069 ITU-T X.683, ISO/IEC 8824-4:2008, November 2008. 2071 [X.690] "Information Technology - ASN.1 encoding rules: 2072 Specification of Basic Encoding Rules (BER), Canonical 2073 Encoding Rules (CER) and Distinguished Encoding Rules 2074 (DER).", ITU-T X.690, ISO/IEC 8825-1:2002, July 2002. 2076 7.2. Informative References 2078 [RFC2268] Rivest, R., "A Description of the RC2(r) Encryption 2079 Algorithm", RFC 2268, DOI 10.17487/RFC2268, March 1998, 2080 . 2082 [RFC2311] Dusse, S., Hoffman, P., Ramsdell, B., Lundblade, L., and 2083 L. Repka, "S/MIME Version 2 Message Specification", 2084 RFC 2311, DOI 10.17487/RFC2311, March 1998, 2085 . 2087 [RFC2312] Dusse, S., Hoffman, P., Ramsdell, B., and J. Weinstein, 2088 "S/MIME Version 2 Certificate Handling", RFC 2312, 2089 DOI 10.17487/RFC2312, March 1998, 2090 . 2092 [RFC2313] Kaliski, B., "PKCS #1: RSA Encryption Version 1.5", 2093 RFC 2313, DOI 10.17487/RFC2313, March 1998, 2094 . 2096 [RFC2314] Kaliski, B., "PKCS #10: Certification Request Syntax 2097 Version 1.5", RFC 2314, DOI 10.17487/RFC2314, March 1998, 2098 . 2100 [RFC2315] Kaliski, B., "PKCS #7: Cryptographic Message Syntax 2101 Version 1.5", RFC 2315, DOI 10.17487/RFC2315, March 1998, 2102 . 2104 [RFC2630] Housley, R., "Cryptographic Message Syntax", RFC 2630, 2105 DOI 10.17487/RFC2630, June 1999, 2106 . 2108 [RFC2631] Rescorla, E., "Diffie-Hellman Key Agreement Method", 2109 RFC 2631, DOI 10.17487/RFC2631, June 1999, 2110 . 2112 [RFC2632] Ramsdell, B., Ed., "S/MIME Version 3 Certificate 2113 Handling", RFC 2632, DOI 10.17487/RFC2632, June 1999, 2114 . 2116 [RFC2633] Ramsdell, B., Ed., "S/MIME Version 3 Message 2117 Specification", RFC 2633, DOI 10.17487/RFC2633, June 1999, 2118 . 2120 [RFC2785] Zuccherato, R., "Methods for Avoiding the "Small-Subgroup" 2121 Attacks on the Diffie-Hellman Key Agreement Method for S/ 2122 MIME", RFC 2785, DOI 10.17487/RFC2785, March 2000, 2123 . 2125 [RFC3218] Rescorla, E., "Preventing the Million Message Attack on 2126 Cryptographic Message Syntax", RFC 3218, 2127 DOI 10.17487/RFC3218, January 2002, 2128 . 2130 [RFC3766] Orman, H. and P. Hoffman, "Determining Strengths For 2131 Public Keys Used For Exchanging Symmetric Keys", BCP 86, 2132 RFC 3766, DOI 10.17487/RFC3766, April 2004, 2133 . 2135 [RFC3850] Ramsdell, B., Ed., "Secure/Multipurpose Internet Mail 2136 Extensions (S/MIME) Version 3.1 Certificate Handling", 2137 RFC 3850, DOI 10.17487/RFC3850, July 2004, 2138 . 2140 [RFC3851] Ramsdell, B., Ed., "Secure/Multipurpose Internet Mail 2141 Extensions (S/MIME) Version 3.1 Message Specification", 2142 RFC 3851, DOI 10.17487/RFC3851, July 2004, 2143 . 2145 [RFC3852] Housley, R., "Cryptographic Message Syntax (CMS)", 2146 RFC 3852, DOI 10.17487/RFC3852, July 2004, 2147 . 2149 [RFC4270] Hoffman, P. and B. Schneier, "Attacks on Cryptographic 2150 Hashes in Internet Protocols", RFC 4270, 2151 DOI 10.17487/RFC4270, November 2005, 2152 . 2154 [RFC4949] Shirey, R., "Internet Security Glossary, Version 2", 2155 FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, 2156 . 2158 [RFC5750] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet 2159 Mail Extensions (S/MIME) Version 3.2 Certificate 2160 Handling", RFC 5750, DOI 10.17487/RFC5750, January 2010, 2161 . 2163 [RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet 2164 Mail Extensions (S/MIME) Version 3.2 Message 2165 Specification", RFC 5751, DOI 10.17487/RFC5751, January 2166 2010, . 2168 [RFC6151] Turner, S. and L. Chen, "Updated Security Considerations 2169 for the MD5 Message-Digest and the HMAC-MD5 Algorithms", 2170 RFC 6151, DOI 10.17487/RFC6151, March 2011, 2171 . 2173 [RFC6194] Polk, T., Chen, L., Turner, S., and P. Hoffman, "Security 2174 Considerations for the SHA-0 and SHA-1 Message-Digest 2175 Algorithms", RFC 6194, DOI 10.17487/RFC6194, March 2011, 2176 . 2178 [RFC6278] Herzog, J. and R. Khazan, "Use of Static-Static Elliptic 2179 Curve Diffie-Hellman Key Agreement in Cryptographic 2180 Message Syntax", RFC 6278, DOI 10.17487/RFC6278, June 2181 2011, . 2183 [RFC7905] Langley, A., Chang, W., Mavrogiannopoulos, N., 2184 Strombergson, J., and S. Josefsson, "ChaCha20-Poly1305 2185 Cipher Suites for Transport Layer Security (TLS)", 2186 RFC 7905, DOI 10.17487/RFC7905, June 2016, 2187 . 2189 [SMIMEv2] "S/MIME version v2". 2191 This group of documents represents S/MIME version 2. This 2192 set of documents are [RFC2311], [RFC2312], [RFC2313], 2193 [RFC2314], and [RFC2315]. 2195 [SMIMEv3] "S/MIME version 3". 2197 This group of documents represents S/MIME version 3. This 2198 set of documents are [RFC2630], [RFC2631], [RFC2632], 2199 [RFC2633], [RFC2634], and [RFC5035]. 2201 [SMIMEv3.1] 2202 "S/MIME version 3.1". 2204 This group of documents represents S/MIME version 3.1. 2205 This set of documents are [RFC2634], [RFC3850], [RFC3851], 2206 [RFC3852], and [RFC5035]. 2208 [SMIMEv3.2] 2209 "S/MIME version 3.2". 2211 This group of documents represents S/MIME version 3.2. 2212 This set of documents are [RFC2634], [RFC5750], [RFC5751], 2213 [RFC5652], and [RFC5035]. 2215 [SP800-57] 2216 National Institute of Standards and Technology (NIST), 2217 "Special Publication 800-57: Recommendation for Key 2218 Management", August 2005. 2220 [TripleDES] 2221 Tuchman, W., "Hellman Presents No Shortcut Solutions to 2222 DES"", IEEE Spectrum v. 16, n. 7, pp 40-41, July 1979. 2224 Appendix A. ASN.1 Module 2226 Note: The ASN.1 module contained herein is unchanged from RFC 3851 2227 [SMIMEv3.1] with the exception of a change to the prefersBinaryInside 2228 ASN.1 comment. This module uses the 1988 version of ASN.1. 2230 SecureMimeMessageV3dot1 2231 { iso(1) member-body(2) us(840) rsadsi(113549) 2232 pkcs(1) pkcs-9(9) smime(16) modules(0) msg-v3dot1(21) } 2234 DEFINITIONS IMPLICIT TAGS ::= 2236 BEGIN 2238 IMPORTS 2240 -- Cryptographic Message Syntax [CMS] 2241 SubjectKeyIdentifier, IssuerAndSerialNumber, 2242 RecipientKeyIdentifier 2243 FROM CryptographicMessageSyntax 2244 { iso(1) member-body(2) us(840) rsadsi(113549) 2245 pkcs(1) pkcs-9(9) smime(16) modules(0) cms-2001(14) }; 2247 -- id-aa is the arc with all new authenticated and unauthenticated 2248 -- attributes produced by the S/MIME Working Group 2250 id-aa OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840) 2251 rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) attributes(2)} 2253 -- S/MIME Capabilities provides a method of broadcasting the 2254 -- symmetric capabilities understood. Algorithms SHOULD be ordered 2255 -- by preference and grouped by type 2257 smimeCapabilities OBJECT IDENTIFIER ::= {iso(1) member-body(2) 2258 us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 15} 2260 SMIMECapability ::= SEQUENCE { 2261 capabilityID OBJECT IDENTIFIER, 2262 parameters ANY DEFINED BY capabilityID OPTIONAL } 2264 SMIMECapabilities ::= SEQUENCE OF SMIMECapability 2266 -- Encryption Key Preference provides a method of broadcasting the 2267 -- preferred encryption certificate. 2269 id-aa-encrypKeyPref OBJECT IDENTIFIER ::= {id-aa 11} 2271 SMIMEEncryptionKeyPreference ::= CHOICE { 2272 issuerAndSerialNumber [0] IssuerAndSerialNumber, 2273 receipentKeyId [1] RecipientKeyIdentifier, 2274 subjectAltKeyIdentifier [2] SubjectKeyIdentifier 2275 } 2277 -- receipentKeyId is spelt incorrectly, but kept for historical 2278 -- reasons. 2280 id-smime OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) 2281 rsadsi(113549) pkcs(1) pkcs9(9) 16 } 2283 id-cap OBJECT IDENTIFIER ::= { id-smime 11 } 2285 -- The preferBinaryInside OID indicates an ability to receive 2286 -- messages with binary encoding inside the CMS wrapper. 2287 -- The preferBinaryInside attribute's value field is ABSENT. 2289 id-cap-preferBinaryInside OBJECT IDENTIFIER ::= { id-cap 1 } 2291 -- The following list OIDs to be used with S/MIME V3 2293 -- Signature Algorithms Not Found in [CMSALG], [CMS-SHA2], [RSAPSS], 2294 -- and [RSAOAEP] 2296 -- 2297 -- md2WithRSAEncryption OBJECT IDENTIFIER ::= 2298 -- {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 2299 -- 2} 2301 -- 2302 -- Other Signed Attributes 2303 -- 2304 -- signingTime OBJECT IDENTIFIER ::= 2305 -- {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 2306 -- 5} 2307 -- See [CMS] for a description of how to encode the attribute 2308 -- value. 2310 SMIMECapabilitiesParametersForRC2CBC ::= INTEGER 2311 -- (RC2 Key Length (number of bits)) 2313 END 2315 Appendix B. Processing of Historic Mail 2317 Over the course of updating the S/MIME specifications, the set of 2318 recommended algorithms has been modified each time the document has 2319 been updated. This means that if a user has historic emails and 2320 their user agent has been updated to only support the current set of 2321 recommended algorithms some of those old emails will no longer be 2322 accessible. It is strongly suggested that user agents implement some 2323 of the following algorithms for dealing with historic emails. 2325 B.1. DigestAlgorithmIdentifier 2327 The following algorithms have been called our for some level of 2328 support by previous S/MIME specifications: 2330 - SHA-1 was dropped in [SMIMEv3.5]. SHA-1 is no longer considerd to 2331 be secure as it is no longer collision-resistant. The IETF 2332 statement on SHA-1 can be found in [RFC6194] but it is out-of-date 2333 relative to the most recient advances. 2335 - MD5 was dropped in [SMIMEv3.5]. MD5 is no longer considered to be 2336 secure as it is no longer collision-resistant. Details can be 2337 found in [RFC6151]. 2339 B.2. Signature Algorithms 2341 There are a number of problems with validating signatures on 2342 sufficently historic messages. For this reason it is strongly 2343 suggested that UAs treat these signatures differently from those on 2344 current messages. These problems include: 2346 - CAs are not required to keep certificates on a CRL beyond one 2347 update after a certificate has expired. This means that unless 2348 CRLs are cached as part of the message it is not always possible 2349 to check if a certificate has been revoked. The same problems 2350 exist with OCSP responses as they may be based on a CRL rather 2351 than on the certificate database. 2353 - RSA and DSA keys of less than 2048 bits are now considered by many 2354 experts to be cryptographically insecure (due to advances in 2355 computing power). Such keys were previously considered secure, so 2356 processing of historic signed messages will often result in the 2357 use of weak keys. Implementations that wish to support previous 2358 versions of S/MIME or process old messages need to consider the 2359 security risks that result from smaller key sizes (e.g., spoofed 2360 messages) versus the costs of denial of service. 2362 [SMIMEv3.1] set the lower limit on suggested key sizes for 2363 creating and validation at 1024 bits. Prior to that the lower 2364 bound on key sizes was 512 bits. 2366 - Hash functions used to validate signatures on historic messages 2367 may longer be considered to be secure. (See below.) While there 2368 are not currently any known practical pre-image or second pre- 2369 image attacks against MD5 or SHA-1, the fact they are no longer 2370 considered to be collision resistent the security levels of the 2371 signatures are generally considered suspect. 2373 - The previous two issues apply to the certificates used to validate 2374 the binding of the public key to the identity that signed the 2375 message as well. 2377 The following algorithms have been called out for some level of 2378 support by previous S/MIME specifications: 2380 - RSA with MD5 was dropped in [SMIMEv3.5]. MD5 is no longer 2381 considered to be secure as it is no longer collision-resistant. 2382 Details can be found in [RFC6151]. 2384 - RSA and DSA with SHA-1 were dropped in [SMIMEv3.5]. SHA-1 is no 2385 longer considered to be secure as it is no longer collision- 2386 resistant. The IETF statment on SHA-1 can be found in [RFC6194] 2387 but it is out-of-date relative to the most recent advances. 2389 - DSA with SHA-256 was dropped in [SMIMEv3.5]. DSA has been 2390 replaced by elliptic curve versions. 2392 Note that S/MIME v3.1 clients support verifying id-dsa-with-sha1 and 2393 rsaEncryption and might not implement sha256withRSAEncryption. Note 2394 that S/MIME v3 clients might only implement signing or signature 2395 verification using id-dsa-with-sha1, and might also use id-dsa as an 2396 AlgorithmIdentifier in this field. Receiving clients SHOULD 2397 recognize id-dsa as equivalent to id-dsa-with-sha1, and sending 2398 clients MUST use id-dsa-with-sha1 if using that algorithm. Also note 2399 that S/MIME v2 clients are only required to verify digital signatures 2400 using the rsaEncryption algorithm with SHA-1 or MD5, and might not 2401 implement id-dsa-with-sha1 or id-dsa at all. 2403 B.3. ContentEncryptionAlgorithmIdentifier 2405 The following algorithms have been called out for some level of 2406 support by previous S/MIME specifications: 2408 - RC2/40 [RFC2268] was dropped in [SMIMEv3.2]. The algorithm is 2409 known to be insecure and, if supported, should only be used to 2410 decrypt existing email. 2412 - DES EDE3 CBC [TripleDES], also known as "tripleDES" is dropped in 2413 [SMIMEv3.5]. This algorithms is removed from the supported list 2414 due to the fact that it has a 64-bit block size and the fact that 2415 it offers less that 128-bits of security. This algorithm should 2416 be supported only to decrypt existing email, it should not be used 2417 to encrypt new emails. 2419 Appendix C. Moving S/MIME v2 Message Specification to Historic Status 2421 The S/MIME v3 [SMIMEv3], v3.1 [SMIMEv3.1], and v3.2 [SMIMEv3.2] are 2422 backwards compatible with the S/MIME v2 Message Specification 2423 [SMIMEv2], with the exception of the algorithms (dropped RC2/40 2424 requirement and added DSA and RSASSA-PSS requirements). Therefore, 2425 it is recommended that RFC 2311 [SMIMEv2] be moved to Historic 2426 status. 2428 Appendix D. Acknowledgments 2430 Many thanks go out to the other authors of the S/MIME version 2 2431 Message Specification RFC: Steve Dusse, Paul Hoffman, Laurence 2432 Lundblade, and Lisa Repka. Without v2, there wouldn't be a v3, v3.1, 2433 v3.2 or v3.5. 2435 A number of the members of the S/MIME Working Group have also worked 2436 very hard and contributed to this document. Any list of people is 2437 doomed to omission, and for that I apologize. In alphabetical order, 2438 the following people stand out in my mind because they made direct 2439 contributions to various versions of this document: 2441 Tony Capel, Piers Chivers, Dave Crocker, Bill Flanigan, Peter 2442 Gutmann, Alfred Hoenes, Paul Hoffman, Russ Housley, William Ottaway, 2443 and John Pawling. 2445 Authors' Addresses 2447 Jim Schaad 2448 August Cellars 2450 Email: ietf@augustcellars.com 2452 Blake Ramsdell 2453 Brute Squad Labs, Inc. 2455 Email: blaker@gmail.com 2457 Sean Turner 2458 sn3rd 2460 Email: sean@sn3rd.com