idnits 2.17.1 draft-ietf-smime-3851bis-05.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 16. -- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on line 1978. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 1989. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 1996. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 2002. 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 3 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust Copyright Line does not match the current year -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (August 20, 2008) is 5727 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) -- Looks like a reference, but probably isn't: '0' on line 1883 -- Looks like a reference, but probably isn't: '1' on line 1884 -- Looks like a reference, but probably isn't: '2' on line 1885 -- Possible downref: Non-RFC (?) normative reference: ref. 'CERT32' -- Possible downref: Non-RFC (?) normative reference: ref. 'CHARSETS' ** Obsolete normative reference: RFC 3852 (ref. 'CMS') (Obsoleted by RFC 5652) -- Possible downref: Non-RFC (?) normative reference: ref. 'CMS-SHA2' -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS180-3' -- Obsolete informational reference (is this intentional?): RFC 2630 (ref. 'SMIMEv3') (Obsoleted by RFC 3369, RFC 3370) Summary: 2 errors (**), 0 flaws (~~), 2 warnings (==), 15 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 S/MIME WG Blake Ramsdell, SendMail 2 Internet Draft Sean Turner, IECA 3 Intended Status: Standard Track August 20, 2008 4 Obsoletes: 3851 (when approved) 5 Expires: February 20, 2009 7 Secure/Multipurpose Internet Mail Extensions (S/MIME) Version 3.2 8 Message Specification 9 draft-ietf-smime-3851bis-05.txt 11 Status of this Memo 13 By submitting this Internet-Draft, each author represents that any 14 applicable patent or other IPR claims of which he or she is aware 15 have been or will be disclosed, and any of which he or she becomes 16 aware will be disclosed, in accordance with Section 6 of BCP 79. 18 Internet-Drafts are working documents of the Internet Engineering 19 Task Force (IETF), its areas, and its working groups. Note that 20 other groups may also distribute working documents as Internet- 21 Drafts. 23 Internet-Drafts are draft documents valid for a maximum of six months 24 and may be updated, replaced, or obsoleted by other documents at any 25 time. It is inappropriate to use Internet-Drafts as reference 26 material or to cite them other than as "work in progress." 28 The list of current Internet-Drafts can be accessed at 29 http://www.ietf.org/ietf/1id-abstracts.txt 31 The list of Internet-Draft Shadow Directories can be accessed at 32 http://www.ietf.org/shadow.html 34 This Internet-Draft will expire on February 20, 2008. 36 Copyright Notice 38 Copyright (C) The IETF Trust (2008). 40 Abstract 42 This document defines Secure/Multipurpose Internet Mail Extensions 43 (S/MIME) version 3.2. S/MIME provides a consistent way to send and 44 receive secure MIME data. Digital signatures provide authentication, 45 message integrity, and non-repudiation with proof of origin. 47 Encryption provides data confidentiality. Compression can be used to 48 reduce data size. This document obsoletes RFC 3851. 50 Discussion 52 This draft is being discussed on the 'ietf-smime' mailing list. To 53 subscribe, send a message to ietf-smime-request@imc.org with the 54 single word subscribe in the body of the message. There is a Web site 55 for the mailing list at . 57 Table of Contents 59 1. Introduction...................................................3 60 1.1. Specification Overview....................................3 61 1.2. Definitions...............................................4 62 1.3. Conventions used in this document.........................5 63 1.4. Compatibility with Prior Practice of S/MIME...............6 64 1.5. Changes From S/MIME v3 to S/MIME v3.1.....................6 65 1.6. Changes Since S/MIME v3.1.................................6 66 2. CMS Options....................................................8 67 2.1. DigestAlgorithmIdentifier.................................8 68 2.2. SignatureAlgorithmIdentifier..............................8 69 2.3. KeyEncryptionAlgorithmIdentifier..........................9 70 2.4. General Syntax............................................9 71 2.5. Attributes and the SignerInfo Type.......................10 72 2.6. SignerIdentifier SignerInfo Type.........................14 73 2.7. ContentEncryptionAlgorithmIdentifier.....................15 74 3. Creating S/MIME Messages......................................17 75 3.1. Preparing the MIME Entity for Signing, Enveloping or 76 Compressing..............................................17 77 3.2. The application/pkcs7-mime Media Type....................22 78 3.3. Creating an Enveloped-only Message.......................24 79 3.4. Creating a Signed-only Message...........................25 80 3.5. Creating an Compressed-only Message......................29 81 3.6. Multiple Operations......................................30 82 3.7. Creating a Certificate Management Message................30 83 3.8. Registration Requests....................................31 84 3.9. Identifying an S/MIME Message............................31 85 4. Certificate Processing........................................32 86 4.1. Key Pair Generation......................................32 87 4.2. Signature Generation.....................................32 88 4.3. Signature Verification...................................32 89 4.4. Encryption...............................................33 90 4.5. Decryption...............................................33 91 5. IANA Considerations...........................................33 92 5.1. Media Type for application/pkcs7-mime....................34 93 5.2. Media Type for application/pkcs7-signature...............35 95 6. Security Considerations.......................................36 96 7. References....................................................38 97 7.1. Normative References.....................................38 98 7.2. Informative References...................................40 99 Appendix A. ASN.1 Module.........................................42 100 Appendix B. Moving S/MIME v2 Message Specification to 101 Historic Status......................................44 102 Appendix C. Acknowledgements.....................................44 104 1. Introduction 106 S/MIME (Secure/Multipurpose Internet Mail Extensions) provides a 107 consistent way to send and receive secure MIME data. Based on the 108 popular Internet MIME standard, S/MIME provides the following 109 cryptographic security services for electronic messaging 110 applications: authentication, message integrity and non-repudiation 111 of origin (using digital signatures), and data confidentiality (using 112 encryption). As a supplementary service, S/MIME provides for message 113 compression. 115 S/MIME can be used by traditional mail user agents (MUAs) to add 116 cryptographic security services to mail that is sent, and to 117 interpret cryptographic security services in mail that is received. 118 However, S/MIME is not restricted to mail; it can be used with any 119 transport mechanism that transports MIME data, such as HTTP or SIP. 120 As such, S/MIME takes advantage of the object-based features of MIME 121 and allows secure messages to be exchanged in mixed-transport 122 systems. 124 Further, S/MIME can be used in automated message transfer agents that 125 use cryptographic security services that do not require any human 126 intervention, such as the signing of software-generated documents and 127 the encryption of FAX messages sent over the Internet. 129 1.1. Specification Overview 131 This document describes a protocol for adding cryptographic signature 132 and encryption services to MIME data. The MIME standard [MIME-SPEC] 133 provides a general structure for the content of Internet messages and 134 allows extensions for new content type based applications. 136 This specification defines how to create a MIME body part that has 137 been cryptographically enhanced according to CMS [CMS], which is 138 derived from PKCS #7 [PKCS-7]. This specification also defines the 139 application/pkcs7-mime media type that can be used to transport those 140 body parts. 142 This document also discusses how to use the multipart/signed media 143 type defined in [MIME-SECURE] to transport S/MIME signed messages. 144 multipart/signed is used in conjunction with the application/pkcs7- 145 signature media type, which is used to transport a detached S/MIME 146 signature. 148 In order to create S/MIME messages, an S/MIME agent MUST follow the 149 specifications in this document, as well as the specifications listed 150 in the Cryptographic Message Syntax document [CMS], [CMSALG], 151 [RSAPSS], [RSAOAEP], and [CMS-SHA2]. 153 Throughout this specification, there are requirements and 154 recommendations made for how receiving agents handle incoming 155 messages. There are separate requirements and recommendations for 156 how sending agents create outgoing messages. In general, the best 157 strategy is to "be liberal in what you receive and conservative in 158 what you send". Most of the requirements are placed on the handling 159 of incoming messages while the recommendations are mostly on the 160 creation of outgoing messages. 162 The separation for requirements on receiving agents and sending 163 agents also derives from the likelihood that there will be S/MIME 164 systems that involve software other than traditional Internet mail 165 clients. S/MIME can be used with any system that transports MIME 166 data. An automated process that sends an encrypted message might not 167 be able to receive an encrypted message at all, for example. Thus, 168 the requirements and recommendations for the two types of agents are 169 listed separately when appropriate. 171 1.2. Definitions 173 For the purposes of this specification, the following definitions 174 apply. 176 ASN.1: Abstract Syntax Notation One, as defined in ITU-T 177 Recommendation X.680 [X.680]. 179 BER: Basic Encoding Rules for ASN.1, as defined in ITU-T 180 Recommendation X.690 [X.690]. 182 Certificate: A type that binds an entity's name to a public key with 183 a digital signature. 185 DER: Distinguished Encoding Rules for ASN.1, as defined in ITU-T 186 Recommendation X.690 [X.690]. 188 7-bit data: Text data with lines less than 998 characters long, where 189 none of the characters have the 8th bit set, and there are no NULL 190 characters. and occur only as part of a end of 191 line delimiter. 193 8-bit data: Text data with lines less than 998 characters, and where 194 none of the characters are NULL characters. and occur only 195 as part of a end of line delimiter. 197 Binary data: Arbitrary data. 199 Transfer Encoding: A reversible transformation made on data so 8-bit 200 or binary data can be sent via a channel that only transmits 7-bit 201 data. 203 Receiving agent: Software that interprets and processes S/MIME CMS 204 objects, MIME body parts that contain CMS content types, or both. 206 Sending agent: Software that creates S/MIME CMS content types, MIME 207 body parts that contain CMS content types, or both. 209 S/MIME agent: User software that is a receiving agent, a sending 210 agent, or both. 212 1.3. Conventions used in this document 214 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 215 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 216 document are to be interpreted as described in [MUSTSHOULD]. 218 We define some additional terms here: 220 SHOULD+ This term means the same as SHOULD. However, the authors 221 expect that a requirement marked as SHOULD+ will be promoted at 222 some future time to be a MUST. 224 SHOULD- This term means the same as SHOULD. However, the authors 225 expect a requirement marked as SHOULD- will be demoted to a MAY 226 in a future version of this document. 228 MUST- This term means the same as MUST. However, the authors 229 expect that this requirement will no longer be a MUST in a future 230 document. Although its status will be determined at a later 231 time, it is reasonable to expect that if a future revision of a 232 document alters the status of a MUST- requirement, it will remain 233 at least a SHOULD or a SHOULD-. 235 1.4. Compatibility with Prior Practice of S/MIME 237 S/MIME version 3.2 agents SHOULD attempt to have the greatest 238 interoperability possible with agents for prior versions of S/MIME. 239 S/MIME version 2 is described in RFC 2311 through RFC 2315 inclusive 240 [SMIMEv2], S/MIME version 3 is described in RFC 2630 through RFC 2634 241 inclusive [SMIMEv3], and S/MIME version 3.1 is described in RFC 3850 242 through RFC 3852 and RFC 2634 [SMIMEv3.1]. RFC 2311 also has 243 historical information about the development of S/MIME. 245 1.5. Changes From S/MIME v3 to S/MIME v3.1 247 The RSA public key algorithm was changed to a MUST implement key 248 wrapping algorithm, and the Diffie-Hellman algorithm changed to a 249 SHOULD implement. 251 The AES symmetric encryption algorithm has been included as a SHOULD 252 implement. 254 The RSA public key algorithm was changed to a MUST implement 255 signature algorithm. 257 Ambiguous language about the use of "empty" SignedData messages to 258 transmit certificates was clarified to reflect that transmission of 259 certificate revocation lists is also allowed. 261 The use of binary encoding for some MIME entities is now explicitly 262 discussed. 264 Header protection through the use of the message/rfc822 media type 265 has been added. 267 Use of the CompressedData CMS type is allowed, along with required 268 media type and file extension additions. 270 1.6. Changes Since S/MIME v3.1 272 Editorial changes, e.g., replaced "MIME type" with "media type", 273 content-type with Content-Type. 275 Moved "Conventions Used in This Document" to Section 1.2. Added 276 definitions for SHOULD+, SHOULD-, and MUST-. 278 Sec 1.1 and Appendix A: Added references to RFCs for RSA-PSS, RSA- 279 OAEP, and SHA2 CMS Algorithms. Added CMS Multiple Signers 280 Clarification to CMS reference. 282 Sec 1.2: Updated references to ASN.1 to X.680 and BER and DER to 283 X.690. 285 Sec 1.3: Added references to S/MIME MSG 3.1 RFCs. 287 Sec 2.1 (digest algorithm): SHA-256 added as MUST, SHA-1 and MD5 made 288 SHOULD-. 290 Sec 2.2 (signature algorithms): RSA with SHA-256 and DSA with SHA-256 291 added as MUSTs, RSA with SHA-1, DSA with SHA-1, and RSA with MD5 292 changed to SHOULD-, and RSA-PSS with SHA-256 added as SHOULD+. Also 293 added note about what S/MIME v3.1 clients support. 295 Sec 2.3 (key encryption): DH changed to SHOULD- and RSA-OAEP added as 296 SHOULD+. 298 Sec 2.5.1: Added requirement that receiving agents MUST support both 299 GeneralizedTime and UTCTime. 301 Sec 2.5.2: Replaced reference "sha1WithRSAEncrption" with 302 "sha256WithRSAEncryption", "DES-3EDE-CBC" and "AES-128 CBC", and 303 deleted the RC5 example. 305 Sec 2.5.2.1, 2.7, 2.7.1, Appendix A: references to RC2/40 removed. 307 Sec 2.7 (content encryption): AES-128 CBC added as MUST, AES-192 and 308 AES-256 CBC SHOULD+, tripleDES now SHOULD-. 310 Sec 2.7.1: Updated pointers from 2.7.2.1 through 2.7.2.4 to 2.7.1.1 311 to 2.7.1.2. 313 Sec 3.2.2: Replaced "encrypted" with "enveloped." Update OID example 314 to use AES-128 CBC oid. 316 Sec 4: Updated reference to CERT v3.2. 318 Sec 4.1: Updated RSA and DSA key size discussion. Moved last four 319 sentences to security considerations. Updated reference to randomness 320 requirements for security. 322 Sec 5: Added IANA registration templates to update media type 323 registry to point to this document as opposed to RFC 2311. 325 Sec 6: Updated Security Considerations. 327 Sec 7: Moved references from Appendix B to this section. Update 328 references. Added informational references to SMIMEv2, SMIMEv3, and 329 SMIMEv3.1. 331 App B: Added Appendix B to move S/MIME v2 to historic status. 333 2. CMS Options 335 CMS allows for a wide variety of options in content, attributes, and 336 algorithm support. This section puts forth a number of support 337 requirements and recommendations in order to achieve a base level of 338 interoperability among all S/MIME implementations. [CMSALG] and [CMS- 339 SHA2] provides additional details regarding the use of the 340 cryptographic algorithms. [ESS] provides additional details 341 regarding the use of additional attributes. 343 2.1. DigestAlgorithmIdentifier 345 Sending and receiving agents MUST support SHA-256 [CMS-SHA2] and 346 SHOULD- support SHA-1 [CMSALG]. Receiving agents SHOULD- support MD5 347 [CMSALG] for the purpose of providing backward compatibility with 348 MD5-digested S/MIME v2 SignedData objects. 350 2.2. SignatureAlgorithmIdentifier 352 Receiving agents: 354 - MUST support RSA with SHA-256, as specified in [CMS-SHA2] 356 - SHOULD+ support DSA with SHA-256, as specified in [CMS-SHA2] 358 - SHOULD+ support RSA-PSS with SHA-256, as specified in [RSAPSS] 360 - SHOULD- support RSA with SHA-1, as specified in [CMSALG] 362 - SHOULD- support DSA with SHA-1, as specified in [CMSALG] 364 - SHOULD- support RSA with MD5, as specified in [CMSALG]. 366 Sending agents: 368 - MUST support RSA with SHA-256, as specified in [CMS-SHA2] 370 - SHOULD+ support DSA with SHA-256, as specified in [CMS-SHA2] 372 - SHOULD+ support RSA-PSS with SHA-256, as specified in [RSAPSS] 374 - SHOULD- support RSA with SHA-1 or DSA with SHA-1, as specified in 375 [CMSALG] 377 - SHOULD- support RSA with MD5, as specified in [CMSALG]. 379 Note that S/MIME v3.1 clients support verifying id-dsa-with-sha1 and 380 rsaEncryption and might not implement sha256withRSAEncryption. Note 381 that S/MIME v3 clients might only implement signing or signature 382 verification using id-dsa-with-sha1, and might also use id-dsa as an 383 AlgorithmIdentifier in this field. Receiving clients SHOULD 384 recognize id-dsa as equivalent to id-dsa-with-sha1, and sending 385 clients MUST use id-dsa-with-sha1 if using that algorithm. Also note 386 that S/MIME v2 clients are only required to verify digital signatures 387 using the rsaEncryption algorithm with SHA-1 or MD5, and might not 388 implement id-dsa-with-sha1 or id-dsa at all. 390 2.3. KeyEncryptionAlgorithmIdentifier 392 Receiving and sending agents: 394 - MUST support RSA Encryption, as specified in [CMSALG] 396 - SHOULD+ support RSA-OAEP, as specified in [RSAOAEP] 398 - SHOULD- support DH ephemeral-static mode, as specified 399 in [CMSALG]. 401 Note that S/MIME v3.1 clients might only implement key encryption and 402 decryption using the rsaEncryption algorithm. Note that S/MIME v3 403 clients might only implement key encryption and decryption using the 404 Diffie-Hellman algorithm. Also note that S/MIME v2 clients are only 405 capable of decrypting content-encryption keys using the rsaEncryption 406 algorithm. 408 2.4. General Syntax 410 There are several CMS content types. Of these, only the Data, 411 SignedData, EnvelopedData, and CompressedData content types are 412 currently used for S/MIME. 414 2.4.1. Data Content Type 416 Sending agents MUST use the id-data content type identifier to 417 identify the "inner" MIME message content. For example, when 418 applying a digital signature to MIME data, the CMS SignedData 419 encapContentInfo eContentType MUST include the id-data object 420 identifier and the media type MUST be stored in the SignedData 421 encapContentInfo eContent OCTET STRING (unless the sending agent is 422 using multipart/signed, in which case the eContent is absent, per 423 section 3.4.3 of this document). As another example, when applying 424 encryption to MIME data, the CMS EnvelopedData encryptedContentInfo 425 contentType MUST include the id-data object identifier and the 426 encrypted MIME content MUST be stored in the EnvelopedData 427 encryptedContentInfo encryptedContent OCTET STRING. 429 2.4.2. SignedData Content Type 431 Sending agents MUST use the SignedData content type to apply a 432 digital signature to a message or, in a degenerate case where there 433 is no signature information, to convey certificates. Applying a 434 signature to a message provides authentication, message integrity, 435 and non-repudiation of origin. 437 2.4.3. EnvelopedData Content Type 439 This content type is used to apply data confidentiality to a message. 440 A sender needs to have access to a public key for each intended 441 message recipient to use this service. 443 2.4.4. CompressedData Content Type 445 This content type is used to apply data compression to a message. 446 This content type does not provide authentication, message integrity, 447 non-repudiation, or data confidentiality, and is only used to reduce 448 the message's size. 450 See section 3.6 for further guidance on the use of this type in 451 conjunction with other CMS types. 453 2.5. Attributes and the SignerInfo Type 455 The SignerInfo type allows the inclusion of unsigned and signed 456 attributes along with a signature. 458 Receiving agents MUST be able to handle zero or one instance of each 459 of the signed attributes listed here. Sending agents SHOULD generate 460 one instance of each of the following signed attributes in each 461 S/MIME message: 463 - signingTime (section 2.5.1 in this document) 465 - sMIMECapabilities (section 2.5.2 in this document) 467 - sMIMEEncryptionKeyPreference (section 2.5.3 in this document) 469 - id-messageDigest (section 11.2 in [CMS]) 471 - id-contentType (section 11.1 in [CMS]) 473 Further, receiving agents SHOULD be able to handle zero or one 474 instance in the signingCertificate signed attribute, as defined in 475 section 5 of [ESS]. 477 Sending agents SHOULD generate one instance of the signingCertificate 478 signed attribute in each SignerInfo structure. 480 Additional attributes and values for these attributes might be 481 defined in the future. Receiving agents SHOULD handle attributes or 482 values that they do not recognize in a graceful manner. 484 Interactive sending agents that include signed attributes that are 485 not listed here SHOULD display those attributes to the user, so that 486 the user is aware of all of the data being signed. 488 2.5.1. Signing-Time Attribute 490 The signing-time attribute is used to convey the time that a message 491 was signed. The time of signing will most likely be created by a 492 message originator and therefore is only as trustworthy as the 493 originator. 495 Sending agents MUST encode signing time through the year 2049 as 496 UTCTime; signing times in 2050 or later MUST be encoded as 497 GeneralizedTime. When the UTCTime CHOICE is used, S/MIME agents MUST 498 interpret the year field (YY) as follows: 500 If YY is greater than or equal to 50, the year is interpreted as 501 19YY; if YY is less than 50, the year is interpreted as 20YY. 503 Receiving agents MUST be able to process signing-time attributes that 504 are encoded in either UTCTime or GeneralizedTime. 506 2.5.2. SMIMECapabilities Attribute 508 The SMIMECapabilities attribute includes signature algorithms (such 509 as "sha256WithRSAEncryption"), symmetric algorithms (such as "AES-128 510 CBC"), and key encipherment algorithms (such as "rsaEncryption"). 511 There are also several identifiers which indicate support for other 512 optional features such as binary encoding and compression. The 513 SMIMECapabilities were designed to be flexible and extensible so 514 that, in the future, a means of identifying other capabilities and 515 preferences such as certificates can be added in a way that will not 516 cause current clients to break. 518 If present, the SMIMECapabilities attribute MUST be a 519 SignedAttribute; it MUST NOT be an UnsignedAttribute. CMS defines 520 SignedAttributes as a SET OF Attribute. The SignedAttributes in a 521 signerInfo MUST NOT include multiple instances of the 522 SMIMECapabilities attribute. CMS defines the ASN.1 syntax for 523 Attribute to include attrValues SET OF AttributeValue. A 524 SMIMECapabilities attribute MUST only include a single instance of 525 AttributeValue. There MUST NOT be zero or multiple instances of 526 AttributeValue present in the attrValues SET OF AttributeValue. 528 The semantics of the SMIMECapabilities attribute specify a partial 529 list as to what the client announcing the SMIMECapabilities can 530 support. A client does not have to list every capability it 531 supports, and need not list all its capabilities so that the 532 capabilities list doesn't get too long. In an SMIMECapabilities 533 attribute, the object identifiers (OIDs) are listed in order of their 534 preference, but SHOULD be separated logically along the lines of 535 their categories (signature algorithms, symmetric algorithms, key 536 encipherment algorithms, etc.) 538 The structure of the SMIMECapabilities attribute is to facilitate 539 simple table lookups and binary comparisons in order to determine 540 matches. For instance, the DER-encoding for the SMIMECapability for 541 AES-128 CBC MUST be identically encoded regardless of the 542 implementation. Because of the requirement for identical encoding, 543 individuals documenting algorithms to be used in the 544 SMIMECapabilities attribute SHOULD explicitly document the correct 545 byte sequence for the common cases. 547 For any capability, the associated parameters for the OID MUST 548 specify all of the parameters necessary to differentiate between two 549 instances of the same algorithm. 551 The OIDs that correspond to algorithms SHOULD use the same OID as the 552 actual algorithm, except in the case where the algorithm usage is 553 ambiguous from the OID. For instance, in an earlier specification, 554 rsaEncryption was ambiguous because it could refer to either a 555 signature algorithm or a key encipherment algorithm. In the event 556 that an OID is ambiguous, it needs to be arbitrated by the maintainer 557 of the registered SMIMECapabilities list as to which type of 558 algorithm will use the OID, and a new OID MUST be allocated under the 559 smimeCapabilities OID to satisfy the other use of the OID. 561 The registered SMIMECapabilities list specifies the parameters for 562 OIDs that need them, most notably key lengths in the case of 563 variable-length symmetric ciphers. In the event that there are no 564 differentiating parameters for a particular OID, the parameters MUST 565 be omitted, and MUST NOT be encoded as NULL. Additional values for 566 the SMIMECapabilities attribute might be defined in the future. 567 Receiving agents MUST handle a SMIMECapabilities object that has 568 values that it does not recognize in a graceful manner. 570 Section 2.7.1 explains a strategy for caching capabilities. 572 2.5.3. Encryption Key Preference Attribute 574 The encryption key preference attribute allows the signer to 575 unambiguously describe which of the signer's certificates has the 576 signer's preferred encryption key. This attribute is designed to 577 enhance behavior for interoperating with those clients that use 578 separate keys for encryption and signing. This attribute is used to 579 convey to anyone viewing the attribute which of the listed 580 certificates is appropriate for encrypting a session key for future 581 encrypted messages. 583 If present, the SMIMEEncryptionKeyPreference attribute MUST be a 584 SignedAttribute; it MUST NOT be an UnsignedAttribute. CMS defines 585 SignedAttributes as a SET OF Attribute. The SignedAttributes in a 586 signerInfo MUST NOT include multiple instances of the 587 SMIMEEncryptionKeyPreference attribute. CMS defines the ASN.1 syntax 588 for Attribute to include attrValues SET OF AttributeValue. A 589 SMIMEEncryptionKeyPreference attribute MUST only include a single 590 instance of AttributeValue. There MUST NOT be zero or multiple 591 instances of AttributeValue present in the attrValues SET OF 592 AttributeValue. 594 The sending agent SHOULD include the referenced certificate in the 595 set of certificates included in the signed message if this attribute 596 is used. The certificate MAY be omitted if it has been previously 597 made available to the receiving agent. Sending agents SHOULD use 598 this attribute if the commonly used or preferred encryption 599 certificate is not the same as the certificate used to sign the 600 message. 602 Receiving agents SHOULD store the preference data if the signature on 603 the message is valid and the signing time is greater than the 604 currently stored value. (As with the SMIMECapabilities, the clock 605 skew SHOULD be checked and the data not used if the skew is too 606 great.) Receiving agents SHOULD respect the sender's encryption key 607 preference attribute if possible. This, however, represents only a 608 preference and the receiving agent can use any certificate in 609 replying to the sender that is valid. 611 Section 2.7.1 explains a strategy for caching preference data. 613 2.5.3.1. Selection of Recipient Key Management Certificate 615 In order to determine the key management certificate to be used when 616 sending a future CMS EnvelopedData message for a particular 617 recipient, the following steps SHOULD be followed: 619 - If an SMIMEEncryptionKeyPreference attribute is found in a 620 SignedData object received from the desired recipient, this 621 identifies the X.509 certificate that SHOULD be used as the X.509 622 key management certificate for the recipient. 624 - If an SMIMEEncryptionKeyPreference attribute is not found in a 625 SignedData object received from the desired recipient, the set of 626 X.509 certificates SHOULD be searched for a X.509 certificate 627 with the same subject name as the signer of a X.509 certificate 628 which can be used for key management. 630 - Or use some other method of determining the user's key management 631 key. If a X.509 key management certificate is not found, then 632 encryption cannot be done with the signer of the message. If 633 multiple X.509 key management certificates are found, the S/MIME 634 agent can make an arbitrary choice between them. 636 2.6. SignerIdentifier SignerInfo Type 638 S/MIME v3.2 implementations MUST support both issuerAndSerialNumber 639 as well as subjectKeyIdentifier. Messages that use the 640 subjectKeyIdentifier choice cannot be read by S/MIME v2 clients. 642 It is important to understand that some certificates use a value for 643 subjectKeyIdentifier that is not suitable for uniquely identifying a 644 certificate. Implementations MUST be prepared for multiple 645 certificates for potentially different entities to have the same 646 value for subjectKeyIdentifier, and MUST be prepared to try each 647 matching certificate during signature verification before indicating 648 an error condition. 650 2.7. ContentEncryptionAlgorithmIdentifier 652 Sending and receiving agents: 654 - MUST support encryption and decryption with AES-128 CBC [CMSAES] 656 - SHOULD+ support encryption and decryption with AES-192 CBC and 657 AES-256 CBC [CMSAES] 659 - SHOULD- support encryption and decryption with DES EDE3 CBC, 660 hereinafter called "tripleDES" [CMSALG]. 662 2.7.1. Deciding Which Encryption Method To Use 664 When a sending agent creates an encrypted message, it has to decide 665 which type of encryption to use. The decision process involves using 666 information garnered from the capabilities lists included in messages 667 received from the recipient, as well as out-of-band information such 668 as private agreements, user preferences, legal restrictions, and so 669 on. 671 Section 2.5.2 defines a method by which a sending agent can 672 optionally announce, among other things, its decrypting capabilities 673 in its order of preference. The following method for processing and 674 remembering the encryption capabilities attribute in incoming signed 675 messages SHOULD be used. 677 - If the receiving agent has not yet created a list of capabilities 678 for the sender's public key, then, after verifying the signature 679 on the incoming message and checking the timestamp, the receiving 680 agent SHOULD create a new list containing at least the signing 681 time and the symmetric capabilities. 683 - If such a list already exists, the receiving agent SHOULD verify 684 that the signing time in the incoming message is greater than the 685 signing time stored in the list and that the signature is valid. 686 If so, the receiving agent SHOULD update both the signing time 687 and capabilities in the list. Values of the signing time that 688 lie far in the future (that is, a greater discrepancy than any 689 reasonable clock skew), or a capabilities list in messages whose 690 signature could not be verified, MUST NOT be accepted. 692 The list of capabilities SHOULD be stored for future use in creating 693 messages. 695 Before sending a message, the sending agent MUST decide whether it is 696 willing to use weak encryption for the particular data in the 697 message. If the sending agent decides that weak encryption is 698 unacceptable for this data, then the sending agent MUST NOT use a 699 weak algorithm. The decision to use or not use weak encryption 700 overrides any other decision in this section about which encryption 701 algorithm to use. 703 Sections 2.7.1.1 through 2.7.1.2 describe the decisions a sending 704 agent SHOULD use in deciding which type of encryption will be applied 705 to a message. These rules are ordered, so the sending agent SHOULD 706 make its decision in the order given. 708 2.7.1.1. Rule 1: Known Capabilities 710 If the sending agent has received a set of capabilities from the 711 recipient for the message the agent is about to encrypt, then the 712 sending agent SHOULD use that information by selecting the first 713 capability in the list (that is, the capability most preferred by the 714 intended recipient) that the sending agent knows how to encrypt. The 715 sending agent SHOULD use one of the capabilities in the list if the 716 agent reasonably expects the recipient to be able to decrypt the 717 message. 719 2.7.1.2. Rule 2: Unknown Capabilities, Unknown Version of S/MIME 721 If the following two conditions are met: 723 - The sending agent has no knowledge of the encryption capabilities 724 of the recipient, and 726 - The sending agent has no knowledge of the version of S/MIME of the 727 recipient, 729 then the sending agent SHOULD use AES-128 because it is a stronger 730 algorithm and is required by S/MIME v3.2. If the sending agent 731 chooses not to use AES-128 in this step, it SHOULD use tripleDES. 733 2.7.2. Choosing Weak Encryption 735 All algorithms that use 40 bit keys are considered by many to be weak 736 encryption. A sending agent that is controlled by a human SHOULD 737 allow a human sender to determine the risks of sending data using a 738 weak encryption algorithm before sending the data, and possibly allow 739 the human to use a stronger encryption method such as tripleDES or 740 AES. 742 2.7.3. Multiple Recipients 744 If a sending agent is composing an encrypted message to a group of 745 recipients where the encryption capabilities of some of the 746 recipients do not overlap, the sending agent is forced to send more 747 than one message. Please note that if the sending agent chooses to 748 send a message encrypted with a strong algorithm, and then send the 749 same message encrypted with a weak algorithm, someone watching the 750 communications channel could learn the contents of the strongly- 751 encrypted message simply by decrypting the weakly-encrypted message. 753 3. Creating S/MIME Messages 755 This section describes the S/MIME message formats and how they are 756 created. S/MIME messages are a combination of MIME bodies and CMS 757 content types. Several media types as well as several CMS content 758 types are used. The data to be secured is always a canonical MIME 759 entity. The MIME entity and other data, such as certificates and 760 algorithm identifiers, are given to CMS processing facilities which 761 produce a CMS object. Finally, the CMS object is wrapped in MIME. 762 The Enhanced Security Services for S/MIME [ESS] document provides 763 descriptions of how nested, secured S/MIME messages are formatted. 764 ESS provides a description of how a triple-wrapped S/MIME message is 765 formatted using multipart/signed and application/pkcs7-mime for the 766 signatures. 768 S/MIME provides one format for enveloped-only data, several formats 769 for signed-only data, and several formats for signed and enveloped 770 data. Several formats are required to accommodate several 771 environments, in particular for signed messages. The criteria for 772 choosing among these formats are also described. 774 The reader of this section is expected to understand MIME as 775 described in [MIME-SPEC] and [MIME-SECURE]. 777 3.1. Preparing the MIME Entity for Signing, Enveloping or Compressing 779 S/MIME is used to secure MIME entities. A MIME entity can be a sub- 780 part, sub-parts of a message, or the whole message with all its sub- 781 parts. A MIME entity that is the whole message includes only the 782 MIME message headers and MIME body, and does not include the RFC-822 783 header. Note that S/MIME can also be used to secure MIME entities 784 used in applications other than Internet mail. If protection of the 785 RFC-822 header is required, the use of the message/rfc822 media type 786 is explained later in this section. 788 The MIME entity that is secured and described in this section can be 789 thought of as the "inside" MIME entity. That is, it is the 790 "innermost" object in what is possibly a larger MIME message. 791 Processing "outside" MIME entities into CMS content types is 792 described in Section 3.2, 3.4, and elsewhere. 794 The procedure for preparing a MIME entity is given in [MIME-SPEC]. 795 The same procedure is used here with some additional restrictions 796 when signing. Description of the procedures from [MIME-SPEC] are 797 repeated here, but it is suggested that the reader refer to that 798 document for the exact procedure. This section also describes 799 additional requirements. 801 A single procedure is used for creating MIME entities that are to 802 have any combination of signing, enveloping, and compressing applied. 803 Some additional steps are recommended to defend against known 804 corruptions that can occur during mail transport that are of 805 particular importance for clear-signing using the multipart/signed 806 format. It is recommended that these additional steps be performed 807 on enveloped messages, or signed and enveloped messages, so that the 808 message can be forwarded to any environment without modification. 810 These steps are descriptive rather than prescriptive. The 811 implementer is free to use any procedure as long as the result is the 812 same. 814 Step 1. The MIME entity is prepared according to the local 815 conventions. 817 Step 2. The leaf parts of the MIME entity are converted to 818 canonical form. 820 Step 3. Appropriate transfer encoding is applied to the leaves 821 of the MIME entity. 823 When an S/MIME message is received, the security services on the 824 message are processed, and the result is the MIME entity. That MIME 825 entity is typically passed to a MIME-capable user agent where it is 826 further decoded and presented to the user or receiving application. 828 In order to protect outer, non-content related message header fields 829 (for instance, the "Subject", "To", "From" and "Cc" fields), the 830 sending client MAY wrap a full MIME message in a message/rfc822 831 wrapper in order to apply S/MIME security services to these header 832 fields. It is up to the receiving client to decide how to present 833 this "inner" header along with the unprotected "outer" header. 835 When an S/MIME message is received, if the top-level protected MIME 836 entity has a Content-Type of message/rfc822, it can be assumed that 837 the intent was to provide header protection. This entity SHOULD be 838 presented as the top-level message, taking into account header 839 merging issues as previously discussed. 841 3.1.1. Canonicalization 843 Each MIME entity MUST be converted to a canonical form that is 844 uniquely and unambiguously representable in the environment where the 845 signature is created and the environment where the signature will be 846 verified. MIME entities MUST be canonicalized for enveloping and 847 compressing as well as signing. 849 The exact details of canonicalization depend on the actual media type 850 and subtype of an entity, and are not described here. Instead, the 851 standard for the particular media type SHOULD be consulted. For 852 example, canonicalization of type text/plain is different from 853 canonicalization of audio/basic. Other than text types, most types 854 have only one representation regardless of computing platform or 855 environment which can be considered their canonical representation. 856 In general, canonicalization will be performed by the non-security 857 part of the sending agent rather than the S/MIME implementation. 859 The most common and important canonicalization is for text, which is 860 often represented differently in different environments. MIME 861 entities of major type "text" MUST have both their line endings and 862 character set canonicalized. The line ending MUST be the pair of 863 characters , and the charset SHOULD be a registered charset 864 [CHARSETS]. The details of the canonicalization are specified in 865 [MIME-SPEC]. The chosen charset SHOULD be named in the charset 866 parameter so that the receiving agent can unambiguously determine the 867 charset used. 869 Note that some charsets such as ISO-2022 have multiple 870 representations for the same characters. When preparing such text 871 for signing, the canonical representation specified for the charset 872 MUST be used. 874 3.1.2. Transfer Encoding 876 When generating any of the secured MIME entities below, except the 877 signing using the multipart/signed format, no transfer encoding is 878 required at all. S/MIME implementations MUST be able to deal with 879 binary MIME objects. If no Content-Transfer-Encoding header field is 880 present, the transfer encoding is presumed to be 7BIT. 882 S/MIME implementations SHOULD however use transfer encoding described 883 in section 3.1.3 for all MIME entities they secure. The reason for 884 securing only 7-bit MIME entities, even for enveloped data that are 885 not exposed to the transport, is that it allows the MIME entity to be 886 handled in any environment without changing it. For example, a 887 trusted gateway might remove the envelope, but not the signature, of 888 a message, and then forward the signed message on to the end 889 recipient so that they can verify the signatures directly. If the 890 transport internal to the site is not 8-bit clean, such as on a wide- 891 area network with a single mail gateway, verifying the signature will 892 not be possible unless the original MIME entity was only 7-bit data. 894 S/MIME implementations which "know" that all intended recipient(s) 895 are capable of handling inner (all but the outermost) binary MIME 896 objects SHOULD use binary encoding as opposed to a 7-bit-safe 897 transfer encoding for the inner entities. The use of a 7-bit-safe 898 encoding (such as base64) would unnecessarily expand the message 899 size. Implementations MAY "know" that recipient implementations are 900 capable of handling inner binary MIME entities either by interpreting 901 the id-cap-preferBinaryInside sMIMECapabilities attribute, by prior 902 agreement, or by other means. 904 If one or more intended recipients are unable to handle inner binary 905 MIME objects, or if this capability is unknown for any of the 906 intended recipients, S/MIME implementations SHOULD use transfer 907 encoding described in section 3.1.3 for all MIME entities they 908 secure. 910 3.1.3. Transfer Encoding for Signing Using multipart/signed 912 If a multipart/signed entity is ever to be transmitted over the 913 standard Internet SMTP infrastructure or other transport that is 914 constrained to 7-bit text, it MUST have transfer encoding applied so 915 that it is represented as 7-bit text. MIME entities that are 7-bit 916 data already need no transfer encoding. Entities such as 8-bit text 917 and binary data can be encoded with quoted-printable or base-64 918 transfer encoding. 920 The primary reason for the 7-bit requirement is that the Internet 921 mail transport infrastructure cannot guarantee transport of 8-bit or 922 binary data. Even though many segments of the transport 923 infrastructure now handle 8-bit and even binary data, it is sometimes 924 not possible to know whether the transport path is 8-bit clean. If a 925 mail message with 8-bit data were to encounter a message transfer 926 agent that can not transmit 8-bit or binary data, the agent has three 927 options, none of which are acceptable for a clear-signed message: 929 - The agent could change the transfer encoding; this would 930 invalidate the signature. 932 - The agent could transmit the data anyway, which would most likely 933 result in the 8th bit being corrupted; this too would invalidate 934 the signature. 936 - The agent could return the message to the sender. 938 [MIME-SECURE] prohibits an agent from changing the transfer encoding 939 of the first part of a multipart/signed message. If a compliant 940 agent that can not transmit 8-bit or binary data encounters a 941 multipart/signed message with 8-bit or binary data in the first part, 942 it would have to return the message to the sender as undeliverable. 944 3.1.4. Sample Canonical MIME Entity 946 This example shows a multipart/mixed message with full transfer 947 encoding. This message contains a text part and an attachment. The 948 sample message text includes characters that are not US-ASCII and 949 thus need to be transfer encoded. Though not shown here, the end of 950 each line is . The line ending of the MIME headers, the 951 text, and transfer encoded parts, all MUST be . 953 Note that this example is not of an S/MIME message. 955 Content-Type: multipart/mixed; boundary=bar 957 --bar 958 Content-Type: text/plain; charset=iso-8859-1 959 Content-Transfer-Encoding: quoted-printable 961 =A1Hola Michael! 963 How do you like the new S/MIME specification? 965 It's generally a good idea to encode lines that begin with 966 From=20because some mail transport agents will insert a greater- 967 than (>) sign, thus invalidating the signature. 969 Also, in some cases it might be desirable to encode any =20 970 trailing whitespace that occurs on lines in order to ensure =20 971 that the message signature is not invalidated when passing =20 972 a gateway that modifies such whitespace (like BITNET). =20 973 --bar 974 Content-Type: image/jpeg 975 Content-Transfer-Encoding: base64 977 iQCVAwUBMJrRF2N9oWBghPDJAQE9UQQAtl7LuRVndBjrk4EqYBIb3h5QXIX/LC// 978 jJV5bNvkZIGPIcEmI5iFd9boEgvpirHtIREEqLQRkYNoBActFBZmh9GC3C041WGq 979 uMbrbxc+nIs1TIKlA08rVi9ig/2Yh7LFrK5Ein57U/W72vgSxLhe/zhdfolT9Brn 980 HOxEa44b+EI= 982 --bar-- 984 3.2. The application/pkcs7-mime Media Type 986 The application/pkcs7-mime media type is used to carry CMS content 987 types including EnvelopedData, SignedData, and CompressedData. The 988 details of constructing these entities are described in subsequent 989 sections. This section describes the general characteristics of the 990 application/pkcs7-mime media type. 992 The carried CMS object always contains a MIME entity that is prepared 993 as described in section 3.1 if the eContentType is id-data. Other 994 contents MAY be carried when the eContentType contains different 995 values. See [ESS] for an example of this with signed receipts. 997 Since CMS content types are binary data, in most cases base-64 998 transfer encoding is appropriate, in particular, when used with SMTP 999 transport. The transfer encoding used depends on the transport 1000 through which the object is to be sent, and is not a characteristic 1001 of the media type. 1003 Note that this discussion refers to the transfer encoding of the CMS 1004 object or "outside" MIME entity. It is completely distinct from, and 1005 unrelated to, the transfer encoding of the MIME entity secured by the 1006 CMS object, the "inside" object, which is described in section 3.1. 1008 Because there are several types of application/pkcs7-mime objects, a 1009 sending agent SHOULD do as much as possible to help a receiving agent 1010 know about the contents of the object without forcing the receiving 1011 agent to decode the ASN.1 for the object. The Content-Type header 1012 field of all application/pkcs7-mime objects SHOULD include the 1013 optional "smime-type" parameter, as described in the following 1014 sections. 1016 3.2.1. The name and filename Parameters 1018 For the application/pkcs7-mime, sending agents SHOULD emit the 1019 optional "name" parameter to the Content-Type field for compatibility 1020 with older systems. Sending agents SHOULD also emit the optional 1021 Content-Disposition field [CONTDISP] with the "filename" parameter. 1022 If a sending agent emits the above parameters, the value of the 1023 parameters SHOULD be a file name with the appropriate extension: 1025 Media Type File Extension 1026 application/pkcs7-mime (SignedData, EnvelopedData) .p7m 1027 application/pkcs7-mime (degenerate SignedData .p7c 1028 certificate management message) 1029 application/pkcs7-mime (CompressedData) .p7z 1030 application/pkcs7-signature (SignedData) .p7s 1032 In addition, the file name SHOULD be limited to eight characters 1033 followed by a three letter extension. The eight character filename 1034 base can be any distinct name; the use of the filename base "smime" 1035 SHOULD be used to indicate that the MIME entity is associated with 1036 S/MIME. 1038 Including a file name serves two purposes. It facilitates easier use 1039 of S/MIME objects as files on disk. It also can convey type 1040 information across gateways. When a MIME entity of type 1041 application/pkcs7-mime (for example) arrives at a gateway that has no 1042 special knowledge of S/MIME, it will default the entity's media type 1043 to application/octet-stream and treat it as a generic attachment, 1044 thus losing the type information. However, the suggested filename 1045 for an attachment is often carried across a gateway. This often 1046 allows the receiving systems to determine the appropriate application 1047 to hand the attachment off to, in this case, a stand-alone S/MIME 1048 processing application. Note that this mechanism is provided as a 1049 convenience for implementations in certain environments. A proper 1050 S/MIME implementation MUST use the media types and MUST NOT rely on 1051 the file extensions. 1053 3.2.2. The smime-type parameter 1055 The application/pkcs7-mime content type defines the optional "smime- 1056 type" parameter. The intent of this parameter is to convey details 1057 about the security applied (signed or enveloped) along with 1058 information about the contained content. This specification defines 1059 the following smime-types. 1061 Name CMS type Inner Content 1062 enveloped-data EnvelopedData id-data 1063 signed-data SignedData id-data 1064 certs-only SignedData none 1065 compressed-data CompressedData id-data 1067 In order for consistency to be obtained with future specifications, 1068 the following guidelines SHOULD be followed when assigning a new 1069 smime-type parameter. 1071 1. If both signing and encryption can be applied to the content, 1072 then two values for smime-type SHOULD be assigned "signed-*" and 1073 "encrypted-*". If one operation can be assigned then this can be 1074 omitted. Thus since "certs-only" can only be signed, "signed-" 1075 is omitted. 1077 2. A common string for a content OID SHOULD be assigned. We use 1078 "data" for the id-data content OID when MIME is the inner 1079 content. 1081 3. If no common string is assigned, then the common string of 1082 "OID." is recommended (for example, 1083 "OID.2.16.840.1.101.3.4.1.2" would be AES-128 CBC). 1085 It is explicitly intended that this field be a suitable hint for mail 1086 client applications to indicate whether a message is "signed" or 1087 "encrypted" without having to tunnel into the CMS payload. 1089 3.3. Creating an Enveloped-only Message 1091 This section describes the format for enveloping a MIME entity 1092 without signing it. It is important to note that sending enveloped 1093 but not signed messages does not provide for data integrity. It is 1094 possible to replace ciphertext in such a way that the processed 1095 message will still be valid, but the meaning can be altered. 1097 Step 1. The MIME entity to be enveloped is prepared according to 1098 section 3.1. 1100 Step 2. The MIME entity and other required data is processed 1101 into a CMS object of type EnvelopedData. In addition to 1102 encrypting a copy of the content-encryption key for each 1103 recipient, a copy of the content-encryption key SHOULD be 1104 encrypted for the originator and included in the EnvelopedData 1105 (see [CMS] Section 6). 1107 Step 3. The EnvelopedData object is wrapped in a CMS ContentInfo 1108 object. 1110 Step 4. The ContentInfo object is inserted into an 1111 application/pkcs7-mime MIME entity. 1113 The smime-type parameter for enveloped-only messages is "enveloped- 1114 data". The file extension for this type of message is ".p7m". 1116 A sample message would be: 1118 Content-Type: application/pkcs7-mime; smime-type=enveloped-data; 1119 name=smime.p7m 1120 Content-Transfer-Encoding: base64 1121 Content-Disposition: attachment; filename=smime.p7m 1123 rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6 1124 7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H 1125 f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 1126 0GhIGfHfQbnj756YT64V 1128 3.4. Creating a Signed-only Message 1130 There are two formats for signed messages defined for S/MIME: 1132 - application/pkcs7-mime with SignedData; and, 1134 - multipart/signed. 1136 In general, the multipart/signed form is preferred for sending, and 1137 receiving agents MUST be able to handle both. 1139 3.4.1. Choosing a Format for Signed-only Messages 1141 There are no hard-and-fast rules when a particular signed-only format 1142 is chosen because it depends on the capabilities of all the receivers 1143 and the relative importance of receivers with S/MIME facilities being 1144 able to verify the signature versus the importance of receivers 1145 without S/MIME software being able to view the message. 1147 Messages signed using the multipart/signed format can always be 1148 viewed by the receiver whether they have S/MIME software or not. They 1149 can also be viewed whether they are using a MIME-native user agent or 1150 they have messages translated by a gateway. In this context, "be 1151 viewed" means the ability to process the message essentially as if it 1152 were not a signed message, including any other MIME structure the 1153 message might have. 1155 Messages signed using the SignedData format cannot be viewed by a 1156 recipient unless they have S/MIME facilities. However, the 1157 SignedData format protects the message content from being changed by 1158 benign intermediate agents. Such agents might do line wrapping or 1159 content-transfer encoding changes which would break the signature. 1161 3.4.2. Signing Using application/pkcs7-mime with SignedData 1163 This signing format uses the application/pkcs7-mime media type. The 1164 steps to create this format are: 1166 Step 1. The MIME entity is prepared according to section 3.1. 1168 Step 2. The MIME entity and other required data is processed 1169 into a CMS object of type SignedData. 1171 Step 3. The SignedData object is wrapped in a CMS ContentInfo 1172 object. 1174 Step 4. The ContentInfo object is inserted into an 1175 application/pkcs7-mime MIME entity. 1177 The smime-type parameter for messages using application/pkcs7-mime 1178 with SignedData is "signed-data". The file extension for this type 1179 of message is ".p7m". 1181 A sample message would be: 1183 Content-Type: application/pkcs7-mime; smime-type=signed-data; 1184 name=smime.p7m 1185 Content-Transfer-Encoding: base64 1186 Content-Disposition: attachment; filename=smime.p7m 1188 567GhIGfHfYT6ghyHhHUujpfyF4f8HHGTrfvhJhjH776tbB9HG4VQbnj7 1189 77n8HHGT9HG4VQpfyF467GhIGfHfYT6rfvbnj756tbBghyHhHUujhJhjH 1190 HUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H7n8HHGghyHh 1191 6YT64V0GhIGfHfQbnj75 1193 3.4.3. Signing Using the multipart/signed Format 1195 This format is a clear-signing format. Recipients without any S/MIME 1196 or CMS processing facilities are able to view the message. It makes 1197 use of the multipart/signed media type described in [MIME-SECURE]. 1198 The multipart/signed media type has two parts. The first part 1199 contains the MIME entity that is signed; the second part contains the 1200 "detached signature" CMS SignedData object in which the 1201 encapContentInfo eContent field is absent. 1203 3.4.3.1. The application/pkcs7-signature Media Type 1205 This media type always contains a CMS ContentInfo containing a single 1206 CMS object of type SignedData. The SignedData encapContentInfo 1207 eContent field MUST be absent. The signerInfos field contains the 1208 signatures for the MIME entity. 1210 The file extension for signed-only messages using application/pkcs7- 1211 signature is ".p7s". 1213 3.4.3.2. Creating a multipart/signed Message 1215 Step 1. The MIME entity to be signed is prepared according to 1216 section 3.1, taking special care for clear-signing. 1218 Step 2. The MIME entity is presented to CMS processing in order 1219 to obtain an object of type SignedData in which the 1220 encapContentInfo eContent field is absent. 1222 Step 3. The MIME entity is inserted into the first part of a 1223 multipart/signed message with no processing other than that 1224 described in section 3.1. 1226 Step 4. Transfer encoding is applied to the "detached signature" 1227 CMS SignedData object and it is inserted into a MIME entity of 1228 type application/pkcs7-signature. 1230 Step 5. The MIME entity of the application/pkcs7-signature is 1231 inserted into the second part of the multipart/signed entity. 1233 The multipart/signed Content-Type has two required parameters: the 1234 protocol parameter and the micalg parameter. 1236 The protocol parameter MUST be "application/pkcs7-signature". Note 1237 that quotation marks are required around the protocol parameter 1238 because MIME requires that the "/" character in the parameter value 1239 MUST be quoted. 1241 The micalg parameter allows for one-pass processing when the 1242 signature is being verified. The value of the micalg parameter is 1243 dependent on the message digest algorithm(s) used in the calculation 1244 of the Message Integrity Check. If multiple message digest 1245 algorithms are used they MUST be separated by commas per [MIME- 1246 SECURE]. The values to be placed in the micalg parameter SHOULD be 1247 from the following: 1249 Algorithm Value used 1251 MD5 md5 1252 SHA-1 sha1 1253 SHA-224 sha224 1254 SHA-256 sha256 1255 SHA-384 sha384 1256 SHA-512 sha512 1257 Any other (defined separately in algorithm profile or "unknown" 1258 if not defined) 1260 (Historical note: some early implementations of S/MIME emitted and 1261 expected "rsa-md5" and "rsa-sha1" for the micalg parameter.) 1262 Receiving agents SHOULD be able to recover gracefully from a micalg 1263 parameter value that they do not recognize. 1265 The SHA-224, SHA-384, and SHA-512 algorithms [FIPS180-3] are not 1266 currently recommended in S/MIME, and are included here for 1267 completeness. 1269 3.4.3.3. Sample multipart/signed Message 1271 Content-Type: multipart/signed; 1272 protocol="application/pkcs7-signature"; 1273 micalg=sha1; boundary=boundary42 1275 --boundary42 1276 Content-Type: text/plain 1278 This is a clear-signed message. 1280 --boundary42 1281 Content-Type: application/pkcs7-signature; name=smime.p7s 1282 Content-Transfer-Encoding: base64 1283 Content-Disposition: attachment; filename=smime.p7s 1285 ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6 1286 4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj 1287 n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 1288 7GhIGfHfYT64VQbnj756 1290 --boundary42-- 1292 The content that is digested (the first part of the multipart/signed) 1293 are the bytes: 1295 43 6f 6e 74 65 6e 74 2d 54 79 70 65 3a 20 74 65 78 74 2f 70 6c 61 69 1296 6e 0d 0a 0d 0a 54 68 69 73 20 69 73 20 61 20 63 6c 65 61 72 2d 73 69 1297 67 6e 65 64 20 6d 65 73 73 61 67 65 2e 0d 0a 1299 3.5. Creating an Compressed-only Message 1301 This section describes the format for compressing a MIME entity. 1302 Please note that versions of S/MIME prior to version 3.1 did not 1303 specify any use of CompressedData, and will not recognize it. The 1304 use of a capability to indicate the ability to receive CompressedData 1305 is described in [CMSCOMPR] and is the preferred method for 1306 compatibility. 1308 Step 1. The MIME entity to be compressed is prepared according 1309 to section 3.1. 1311 Step 2. The MIME entity and other required data is processed 1312 into a CMS object of type CompressedData. 1314 Step 3. The CompressedData object is wrapped in a CMS 1315 ContentInfo object. 1317 Step 4. The ContentInfo object is inserted into an 1318 application/pkcs7-mime MIME entity. 1320 The smime-type parameter for compressed-only messages is "compressed- 1321 data". The file extension for this type of message is ".p7z". 1323 A sample message would be: 1325 Content-Type: application/pkcs7-mime; smime-type=compressed-data; 1326 name=smime.p7z 1327 Content-Transfer-Encoding: base64 1328 Content-Disposition: attachment; filename=smime.p7z 1330 rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6 1331 7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H 1332 f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 1333 0GhIGfHfQbnj756YT64V 1335 3.6. Multiple Operations 1337 The signed-only, encrypted-only, and compressed-only MIME formats can 1338 be nested. This works because these formats are all MIME entities 1339 that encapsulate other MIME entities. 1341 An S/MIME implementation MUST be able to receive and process 1342 arbitrarily nested S/MIME within reasonable resource limits of the 1343 recipient computer. 1345 It is possible to apply any of the signing, encrypting, and 1346 compressing operations in any order. It is up to the implementer and 1347 the user to choose. When signing first, the signatories are then 1348 securely obscured by the enveloping. When enveloping first the 1349 signatories are exposed, but it is possible to verify signatures 1350 without removing the enveloping. This can be useful in an 1351 environment were automatic signature verification is desired, as no 1352 private key material is required to verify a signature. 1354 There are security ramifications to choosing whether to sign first or 1355 encrypt first. A recipient of a message that is encrypted and then 1356 signed can validate that the encrypted block was unaltered, but 1357 cannot determine any relationship between the signer and the 1358 unencrypted contents of the message. A recipient of a message that 1359 is signed-then-encrypted can assume that the signed message itself 1360 has not been altered, but that a careful attacker could have changed 1361 the unauthenticated portions of the encrypted message. 1363 When using compression, keep the following guidelines in mind: 1365 - Compression of binary encoded encrypted data is discouraged, since 1366 it will not yield significant compression. Base64 encrypted data 1367 could very well benefit, however. 1369 - If a lossy compression algorithm is used with signing, you will 1370 need to compress first, then sign. 1372 3.7. Creating a Certificate Management Message 1374 The certificate management message or MIME entity is used to 1375 transport certificates and/or certificate revocation lists, such as 1376 in response to a registration request. 1378 Step 1. The certificates and/or certificate revocation lists are 1379 made available to the CMS generating process which creates a CMS 1380 object of type SignedData. The SignedData encapContentInfo 1381 eContent field MUST be absent and signerInfos field MUST be 1382 empty. 1384 Step 2. The SignedData object is wrapped in a CMS ContentInfo 1385 object. 1387 Step 3. The ContentInfo object is enclosed in an 1388 application/pkcs7-mime MIME entity. 1390 The smime-type parameter for a certificate management message is 1391 "certs-only". The file extension for this type of message is ".p7c". 1393 3.8. Registration Requests 1395 A sending agent that signs messages MUST have a certificate for the 1396 signature so that a receiving agent can verify the signature. There 1397 are many ways of getting certificates, such as through an exchange 1398 with a certificate authority, through a hardware token or diskette, 1399 and so on. 1401 S/MIME v2 [SMIMEv2] specified a method for "registering" public keys 1402 with certificate authorities using an application/pkcs10 body part. 1403 Since that time, the IETF PKIX Working Group has developed other 1404 methods for requesting certificates. However, S/MIME v3.2 does not 1405 require a particular certificate request mechanism. 1407 3.9. Identifying an S/MIME Message 1409 Because S/MIME takes into account interoperation in non-MIME 1410 environments, several different mechanisms are employed to carry the 1411 type information, and it becomes a bit difficult to identify S/MIME 1412 messages. The following table lists criteria for determining whether 1413 or not a message is an S/MIME message. A message is considered an 1414 S/MIME message if it matches any of the criteria listed below. 1416 The file suffix in the table below comes from the "name" parameter in 1417 the Content-Type header field, or the "filename" parameter on the 1418 Content-Disposition header field. These parameters that give the 1419 file suffix are not listed below as part of the parameter section. 1421 Media type: application/pkcs7-mime 1422 parameters: any 1423 file suffix: any 1425 Media type: multipart/signed 1426 parameters: protocol="application/pkcs7-signature" 1427 file suffix: any 1428 Media type: application/octet-stream 1429 parameters: any 1430 file suffix: p7m, p7s, p7c, p7z 1432 4. Certificate Processing 1434 A receiving agent MUST provide some certificate retrieval mechanism 1435 in order to gain access to certificates for recipients of digital 1436 envelopes. This specification does not cover how S/MIME agents 1437 handle certificates, only what they do after a certificate has been 1438 validated or rejected. S/MIME certificate issues are covered in 1439 [CERT32]. 1441 At a minimum, for initial S/MIME deployment, a user agent could 1442 automatically generate a message to an intended recipient requesting 1443 that recipient's certificate in a signed return message. Receiving 1444 and sending agents SHOULD also provide a mechanism to allow a user to 1445 "store and protect" certificates for correspondents in such a way so 1446 as to guarantee their later retrieval. 1448 4.1. Key Pair Generation 1450 All generated key pairs MUST be generated from a good source of non- 1451 deterministic random input [RANDOM] and the private key MUST be 1452 protected in a secure fashion. 1454 An S/MIME user agent MUST NOT generate asymmetric keys less than 512 1455 bits for use with the RSA or DSA signature algorithms. 1457 4.2. Signature Generation 1459 The following are the requirements for an S/MIME agent generated RSA 1460 signatures: 1462 512 <= key size < 1024 : MAY (see Security Considerations) 1463 1024 <= key size <= 2048 : SHOULD (see Security Considerations) 1464 2048 < key size : MAY (see Security Considerations) 1466 The following are the requirements for an S/MIME agent generated DSA 1467 signatures: 1469 512 <= key size <= 1024 : SHOULD (see Security Considerations) 1471 4.3. Signature Verification 1473 The following are the requirements for S/MIME receiving agents during 1474 signature verification of RSA signatures: 1476 512 <= key size <= 2048 : MUST (see Security Considerations) 1477 2048 < key size : MAY (see Security Considerations) 1479 The following are the requirements for S/MIME receiving agents during 1480 signature verification of DSA signatures: 1482 512 <= key size <= 1024 : SHOULD (see Security Considerations) 1484 4.4. Encryption 1486 The following are the requirements for an S/MIME agent when 1487 establishing keys for content encryption using the RSA algorithms: 1489 512 <= key size < 1024 : MAY (see Security Considerations) 1490 1024 <= key size <= 2048 : SHOULD (see Security Considerations) 1491 2048 < key size : MAY (see Security Considerations) 1493 The following are the requirements for an S/MIME agent when 1494 establishing keys for content encryption using the DH algorithms: 1496 512 <= key size <= 1024 : SHOULD (see Security Considerations) 1498 4.5. Decryption 1500 The following are the requirements for an S/MIME agent when 1501 establishing keys for content decryption using the RSA algorithms: 1503 512 <= key size <= 2048 : MUST (see Security Considerations) 1504 2048 < key size : MAY (see Security Considerations) 1506 The following are the requirements for an S/MIME agent when 1507 establishing keys for content decryption using the DH algorithms: 1509 512 <= key size <= 1024 : SHOULD (see Security Considerations) 1511 5. IANA Considerations 1513 The following is intended to provide sufficient information to update 1514 the media type registration for application/pkcs7-mime and 1515 application/pkcs7-signature to refer to this document as opposed to 1516 RFC 2311. 1518 Note that other documents can define additional MIME media types for 1519 S/MIME. 1521 5.1. Media Type for application/pkcs7-mime 1523 Type name: application 1525 Subtype Name: pkcs7-mime 1527 Required Parameters: NONE 1529 Optional Parameters: smime-type/signed-data 1530 smime-type/enveloped-data 1531 smime-type/compressed-data 1532 smime-type/certs-only 1534 Encoding Considerations: See Section 3 of this document 1536 Security Considerations: See Section 6 of this document 1538 Interoperability Considerations: See Sections 1-6 of this document 1540 Published Specification: RFC 2311, RFC 2633, and this document 1542 Applications that use this media type: Security applications 1544 Additional information: NONE 1546 Person & email to contact for further information: S/MIME working 1547 group chairs smime-chairs@tools.ietf.org 1549 Intended usage: COMMON 1551 Restrictions on usage: NONE 1553 Author: Sean Turner 1555 Change Controller: S/MIME working group delegated from the IESG 1557 5.2. Media Type for application/pkcs7-signature 1559 Type name: application 1561 Subtype Name: pkcs7-signature 1563 Required Parameters: NONE 1565 Optional Parameters: NONE 1567 Encoding Considerations: See Section 3 of this document 1569 Security Considerations: See Section 6 of this document 1571 Interoperability Considerations: See Sections 1-6 of this document 1573 Published Specification: RFC 2311, RFC 2633, and this document 1575 Applications that use this media type: Security applications 1577 Additional information: NONE 1579 Person & email to contact for further information: S/MIME working 1580 group chairs smime-chairs@tools.ietf.org 1582 Intended usage: COMMON 1584 Restrictions on usage: NONE 1586 Author: Sean Turner 1588 Change Controller: S/MIME working group delegated from the IESG 1590 6. Security Considerations 1592 Cryptographic algorithms will be broken or weakened over time. 1593 Implementers and users need to check that the cryptographic 1594 algorithms listed in this document continue to provide the expected 1595 level of security. The IETF from time to time may issue documents 1596 dealing with the current state of the art. For example: 1598 - The Million Message Attack described in RFC 3218 [MMA]. 1600 - The Diffie-Hellman "small-subgroup" attacks described in 1601 RFC 2785 [DHSUB]. 1603 - The attacks against hash algorithms described in 1604 RFC 4270 [HASH-ATTACK] 1606 This specification uses Public-Key Cryptography technologies. It is 1607 assumed that the private is protected to ensure that it is not 1608 accessed or altered by unauthorized parties. 1610 It is impossible for most people or software to estimate the value of 1611 a message's content. Further, it is impossible for most people or 1612 software to estimate the actual cost of recovering an encrypted 1613 message content that is encrypted with a key of a particular size. 1614 Further, it is quite difficult to determine the cost of a failed 1615 decryption if a recipient cannot process a message's content. Thus, 1616 choosing between different key sizes (or choosing whether to just use 1617 plaintext) is also impossible for most people or software. However, 1618 decisions based on these criteria are made all the time, and 1619 therefore this specification gives a framework for using those 1620 estimates in choosing algorithms. 1622 The choice of 1024 bits as the RSA, DSA, and DH asymmetric key size 1623 in this specification is based on the desire to provide 80 bits of 1624 security. This key size seems prudent for the Internet based on 1625 Section 4.3 of [STRENGTH]. There are other environments (e.g., 1626 government, financial, and medical) that may consider this key size 1627 to be inadequate. Likewise, there are other environments that may 1628 consider this key size to be excessive. 1630 Receiving agents that validate signatures and sending agents that 1631 encrypt messages, need to be cautious of cryptographic processing 1632 usage when validating signatures and encrypting messages using keys 1633 larger than those mandated in this specification. An attacker could 1634 send certificates with keys which would result in excessive 1635 cryptographic processing, for example keys larger than those mandated 1636 in this specification, which could swamp the processing element. 1638 Agents which use such keys without first validating the certificate 1639 to a trust anchor are advised to have some sort of cryptographic 1640 resource management system to prevent such attacks. 1642 Today, 512-bit RSA, DSA, and DH keys are considered by many experts 1643 to be cryptographically insecure. 1645 Using weak cryptography in S/MIME offers little actual security over 1646 sending plaintext. However, other features of S/MIME, such as the 1647 specification of AES and the ability to announce stronger 1648 cryptographic capabilities to parties with whom you communicate, 1649 allow senders to create messages that use strong encryption. Using 1650 weak cryptography is never recommended unless the only alternative is 1651 no cryptography. When feasible, sending and receiving agents SHOULD 1652 inform senders and recipients of the relative cryptographic strength 1653 of messages. 1655 Implementers SHOULD be aware that multiple active key pairs can be 1656 associated with a single individual. For example, one key pair can 1657 be used to support confidentiality, while a different key pair can be 1658 used for digital signatures. 1660 If a sending agent is sending the same message using different 1661 strengths of cryptography, an attacker watching the communications 1662 channel might be able to determine the contents of the strongly- 1663 encrypted message by decrypting the weakly-encrypted version. In 1664 other words, a sender SHOULD NOT send a copy of a message using 1665 weaker cryptography than they would use for the original of the 1666 message. 1668 Modification of the ciphertext can go undetected if authentication is 1669 not also used, which is the case when sending EnvelopedData without 1670 wrapping it in SignedData or enclosing SignedData within it. 1672 7. References 1674 7.1. Normative References 1676 [CERT32] Ramsdell, B., and S. Turner, "S/MIME Version 3.2 1677 Certificate Handling", work in progress. 1679 [CHARSETS] Character sets assigned by IANA. See 1680 http://www.iana.org/assignments/character-sets 1682 [CMS] Housley, R., "Cryptographic Message Syntax (CMS)", RFC 1683 3852, July 2004. 1685 Housley, R., "Cryptographic Message Syntax (CMS) 1686 Multiple Signer Clarification", RFC 4852, April 2007. 1688 [CMSAES] Schaad, J., "Use of the Advanced Encryption Standard 1689 (AES) Encryption Algorithm in Cryptographic Message 1690 Syntax (CMS)", RFC 3565, July 2003. 1692 [CMSALG] Housley, R., "Cryptographic Message Syntax (CMS) 1693 Algorithms", RFC 3370, August 2002. 1695 [CMSCOMPR] Gutmann, P., "Compressed Data Content Type for 1696 Cryptographic Message Syntax (CMS)", RFC 3274, June 1697 2002. 1699 [CMS-SHA2] Turner. S., "Using SHA2 Algorithms with Cryptographic 1700 Message Syntax", work in progress. 1702 [CONTDISP] Troost, R., Dorner, S., and K. Moore, "Communicating 1703 Presentation Information in Internet Messages: The 1704 Content-Disposition Header Field", RFC 2183, August 1705 1997. 1707 [ESS] Hoffman, P., "Enhanced Security Services for S/MIME", 1708 RFC 2634, June 1999. 1710 [FIPS180-3] National Institute of Standards and Technology (NIST), 1711 "Secure Hash Standard (SHS)", FIPS Publication 180-3, 1712 June 2007. 1714 [MIME-SPEC] Freed, N. and N. Borenstein, "Multipurpose Internet 1715 Mail Extensions (MIME) Part One: Format of Internet 1716 Message Bodies", RFC 2045, November 1996. 1718 Freed, N. and N. Borenstein, "Multipurpose Internet 1719 Mail Extensions (MIME) Part Two: Media Types", RFC 1720 2046, November 1996. 1722 Moore, K., "MIME (Multipurpose Internet Mail 1723 Extensions) Part Three: Message Header Extensions for 1724 Non-ASCII Text", RFC 2047, November 1996. 1726 Freed, N., and J. Klensin, , "Multipurpose Internet 1727 Mail Extensions (MIME) Part Four: Registration 1728 Procedures", BCP 13, RFC 4289, December 2005. 1730 Freed, N., and J. Klensin, "Media Type Specifications 1731 and Registration Procedures ", BCP 13, RFC 4288, 1732 December 2005. 1734 Freed, N. and N. Borenstein, "Multipurpose Internet 1735 Mail Extensions (MIME) Part Five: Conformance Criteria 1736 and Examples", RFC 2049, November 1996. 1738 [MIME-SECURE] Galvin, J., Murphy, S., Crocker, S., and N. Freed, 1739 "Security Multiparts for MIME: Multipart/Signed and 1740 Multipart/Encrypted", RFC 1847, October 1995. 1742 [MUSTSHOULD] Bradner, S., "Key words for use in RFCs to Indicate 1743 Requirement Levels", BCP 14, RFC 2119, March 1997. 1745 [RANDOM] Eastlake 3rd, D., Crocker, S., and J. Schiller, 1746 "Randomness Requirements for Security", BCP 106, RFC 1747 4086, June 2005. 1749 [RSAPSS] Schaad, J., "Use of RSASA-PSS Signature Algorithm in 1750 Cryptographic Message Syntax (CMS)", RFC 4056, June 1751 2005. 1753 [RSAOAEP] Housley, R. "Use of the RSAES-OAEP Key Transport 1754 Algorithm in the Cryptographic Message Syntax (CMS)", 1755 RFC 3560, July 2003 1757 [X.680] ITU-T Recommendation X.680 (2002) | ISO/IEC 8824- 1758 1:2002. Information Technology - Abstract Syntax 1759 Notation One (ASN.1): Specification of basic 1760 notation. 1762 [X.690] ITU-T Recommendation X.690 (2002) | ISO/IEC 8825- 1763 1:2002. Information Technology - ASN.1 encoding 1764 rules: Specification of Basic Encoding Rules (BER), 1765 Canonical Encoding Rules (CER) and Distinguished 1766 Encoding Rules (DER). 1768 7.2. Informative References 1770 [DHSUB] Zuccherato, R., "Methods for Avoiding the "Small- 1771 Subgroup" Attacks on the Diffie-Hellman Key Agreement 1772 Method for S/MIME", RFC 2785, March 2000. 1774 [HASH-ATTACK] Hoffman, P., Schneier, B., "Attacks on Cryptographic 1775 Hashes in Internet Protocols", RFC 4270, November 1776 2005. 1778 [MMA] Rescorla, E., "Preventing the Million Message Attack 1779 on Cryptographic Message Syntax", RFC 3218, January 1780 2002. 1782 [PKCS-7] Kaliski, B., "PKCS #7: Cryptographic Message Syntax 1783 Version 1.5", RFC 2315, March 1998. 1785 [SMIMEv2] Dusse, S., Hoffman, P., Ramsdell, B., Lundblade, L., 1786 and L. Repka, "S/MIME Version 2 Message 1787 Specification", RFC 2311, March 1998. 1789 Dusse, S., Hoffman, P., Ramsdell, B., and J. 1790 Weinstein, "S/MIME Version 2 Certificate Handling", 1791 RFC 2312, March 1998. 1793 Kaliski, B., "PKCS #1: RSA Encryption Version 1.5", 1794 RFC 2313, March 1998. 1796 Kaliski, B., "PKCS #10: Certificate Request Syntax 1797 Version 1.5", RFC 2314, March 1998. 1799 Kaliski, B., "PKCS #7: Certificate Message Syntax 1800 Version 1.5", RFC 2314, March 1998. 1802 [SMIMEv3] Housley, R., "Cryptographic Message Syntax", RFC 2630, 1803 June 1999. 1805 Rescorla, E., "Diffie-Hellman Key Agreement Method", 1806 RFC 2631, June 1999. 1808 Ramsdell, B., "S/MIME Version 3 Certificate Handling", 1809 RFC 2632, June 1999. 1811 Ramsdell, B., "S/MIME Version 3 Message 1812 Specification", RFC 2633, June 1999. 1814 Hoffman, P., "Enhanced Security Services for S/MIME", 1815 RFC 2634, June 1999. 1817 [SMIMEv3.1] Housley, R., "Cryptographic Message Syntax", RFC 3852, 1818 July 2004. 1820 Ramsdell, B., "S/MIME Version 3.1 Certificate 1821 Handling", RFC 3850, July 2004. 1823 Ramsdell, B., "S/MIME Version 3.1 Message 1824 Specification", RFC 3851, July 2004. 1826 Hoffman, P., "Enhanced Security Services for S/MIME", 1827 RFC 2634, June 1999. 1829 [STRENGTH] Orman, H., and P. Hoffman, "Determining Strengths For 1830 Public Keys Used For Exchanging Symmetric Keys", BCP 1831 86, RFC 3766, April 2004. 1833 Appendix A. ASN.1 Module 1835 NOTE: The ASN.1 module contained herein is unchanged from RFC 3851 1836 [SMIMEv3.1] with the exception of a minor change to the 1837 prefersBinaryInside ASN.1 comment. This modules use the 1988 version 1838 of ASN.1. 1840 SecureMimeMessageV3dot1 1842 { iso(1) member-body(2) us(840) rsadsi(113549) 1843 pkcs(1) pkcs-9(9) smime(16) modules(0) msg-v3dot1(21) } 1845 DEFINITIONS IMPLICIT TAGS ::= 1847 BEGIN 1849 IMPORTS 1851 -- Cryptographic Message Syntax [CMS] 1852 SubjectKeyIdentifier, IssuerAndSerialNumber, 1853 RecipientKeyIdentifier 1854 FROM CryptographicMessageSyntax 1855 { iso(1) member-body(2) us(840) rsadsi(113549) 1856 pkcs(1) pkcs-9(9) smime(16) modules(0) cms-2001(14) }; 1858 -- id-aa is the arc with all new authenticated and unauthenticated 1859 -- attributes produced the by S/MIME Working Group 1861 id-aa OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840) 1862 rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) attributes(2)} 1864 -- S/MIME Capabilities provides a method of broadcasting the 1865 -- symmetric capabilities understood. Algorithms SHOULD be ordered 1866 -- by preference and grouped by type 1868 smimeCapabilities OBJECT IDENTIFIER ::= {iso(1) member-body(2) 1869 us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 15} 1871 SMIMECapability ::= SEQUENCE { 1872 capabilityID OBJECT IDENTIFIER, 1873 parameters ANY DEFINED BY capabilityID OPTIONAL } 1875 SMIMECapabilities ::= SEQUENCE OF SMIMECapability 1877 -- Encryption Key Preference provides a method of broadcasting the 1878 -- preferred encryption certificate. 1880 id-aa-encrypKeyPref OBJECT IDENTIFIER ::= {id-aa 11} 1882 SMIMEEncryptionKeyPreference ::= CHOICE { 1883 issuerAndSerialNumber [0] IssuerAndSerialNumber, 1884 receipentKeyId [1] RecipientKeyIdentifier, 1885 subjectAltKeyIdentifier [2] SubjectKeyIdentifier 1886 } 1888 id-smime OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) 1889 rsadsi(113549) pkcs(1) pkcs9(9) 16 } 1891 id-cap OBJECT IDENTIFIER ::= { id-smime 11 } 1893 -- The preferBinaryInside OID indicates an ability to receive 1894 -- messages with binary encoding inside the CMS wrapper 1896 id-cap-preferBinaryInside OBJECT IDENTIFIER ::= { id-cap 1 } 1898 -- The following list the OIDs to be used with S/MIME V3 1900 -- Signature Algorithms Not Found in [CMSALG] 1902 -- 1904 -- md2WithRSAEncryption OBJECT IDENTIFIER ::= 1905 -- {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1906 -- 2} 1908 -- 1910 -- Other Signed Attributes 1911 -- 1912 -- signingTime OBJECT IDENTIFIER ::= 1913 -- {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 1914 -- 5} 1915 -- See [CMS] for a description of how to encode the attribute 1916 -- value. 1918 SMIMECapabilitiesParametersForRC2CBC ::= INTEGER 1919 -- (RC2 Key Length (number of bits)) 1921 END 1923 Appendix B. Moving S/MIME v2 Message Specification to Historic Status 1925 The S/MIME v3 [SMIMEv3], v3.1 [SMIMEv3.1], and v3.2 (this document) 1926 Message Specifications are backwards S/MIME v2 Message Specification 1927 [SMIMEv2], with the exception of the algorithms (dropped RC2/40 1928 requirement and added DSA and RSA-PSS requirements). Therefore, it is 1929 recommended that RFC 2311 [SMIMEv2] be moved to Historic status. 1931 Appendix C. Acknowledgements 1933 Many thanks go out to the other authors of the S/MIME Version 2 1934 Message Specification RFC: Steve Dusse, Paul Hoffman, Laurence 1935 Lundblade and Lisa Repka. Without v2, there wouldn't be a v3, v3.1 or 1936 v3.2. 1938 A number of the members of the S/MIME Working Group have also worked 1939 very hard and contributed to this document. Any list of people is 1940 doomed to omission, and for that I apologize. In alphabetical order, 1941 the following people stand out in my mind due to the fact that they 1942 made direct contributions to this document. 1944 Tony Capel, Piers Chivers, Dave Crocker, Bill Flanigan, Peter 1945 Gutmann, Alfred Hoenes, Paul Hoffman, Russ Housley, William Ottaway, 1946 John Pawling, and Jim Schaad. 1948 Author's Addresses 1950 Blake Ramsdell 1951 SendMail 1953 Email: blake@sendmail.com 1955 Sean Turner 1957 IECA, Inc. 1958 3057 Nutley Street, Suite 106 1959 Fairfax, VA 22031 1960 USA 1962 Email: turners@ieca.com 1964 Full Copyright Statement 1966 Copyright (C) The IETF Trust (2008). 1968 This document is subject to the rights, licenses and restrictions 1969 contained in BCP 78, and except as set forth therein, the authors 1970 retain all their rights. 1972 This document and the information contained herein are provided on an 1973 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 1974 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 1975 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 1976 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 1977 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 1978 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 1980 Intellectual Property 1982 The IETF takes no position regarding the validity or scope of any 1983 Intellectual Property Rights or other rights that might be claimed to 1984 pertain to the implementation or use of the technology described in 1985 this document or the extent to which any license under such rights 1986 might or might not be available; nor does it represent that it has 1987 made any independent effort to identify any such rights. Information 1988 on the procedures with respect to rights in RFC documents can be 1989 found in BCP 78 and BCP 79. 1991 Copies of IPR disclosures made to the IETF Secretariat and any 1992 assurances of licenses to be made available, or the result of an 1993 attempt made to obtain a general license or permission for the use of 1994 such proprietary rights by implementers or users of this 1995 specification can be obtained from the IETF on-line IPR repository at 1996 http://www.ietf.org/ipr. 1998 The IETF invites any interested party to bring to its attention any 1999 copyrights, patents or patent applications, or other proprietary 2000 rights that may cover technology that may be required to implement 2001 this standard. Please address the information to the IETF at 2002 ietf-ipr@ietf.org. 2004 Acknowledgment 2006 Funding for the RFC Editor function is provided by the IETF 2007 Administrative Support Activity (IASA).