idnits 2.17.1 draft-ietf-smime-rfc2633bis-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** The document is more than 15 pages and seems to lack a Table of Contents. == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 1 longer page, the longest (page 1) being 1394 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an Abstract section. ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 171: '...Sending and receiving agents MUST support SHA-1 [CMSALG]. Receiving...' RFC 2119 keyword, line 172: '...agents SHOULD support MD5 [CMSALG] for the purpose of providing...' RFC 2119 keyword, line 177: '...Receiving agents MUST support id-dsa defined in [CMSALG]. The...' RFC 2119 keyword, line 178: '...rithm parameters MUST be absent (not e...' RFC 2119 keyword, line 179: '...agents MUST support rsaEncryption, defined in [CMSALG]....' (94 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 979 has weird spacing: '...y other unkn...' ** The document contains RFC2119-like boilerplate, but doesn't seem to mention RFC 2119. The boilerplate contains a reference [MUSTSHOULD], but that reference does not seem to mention RFC 2119 either. -- 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 (December 30, 2002) is 7788 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 section? 'MIME-SPEC' on line 1277 looks like a reference -- Missing reference section? 'CMS' on line 1265 looks like a reference -- Missing reference section? 'PKCS-7' on line 1289 looks like a reference -- Missing reference section? 'MIME-SECURE' on line 1283 looks like a reference -- Missing reference section? 'MUSTSHOULD' on line 1286 looks like a reference -- Missing reference section? 'TBD' on line 1190 looks like a reference -- Missing reference section? 'CMSALG' on line 1322 looks like a reference -- Missing reference section? 'ESS' on line 1274 looks like a reference -- Missing reference section? 'CHARSETS' on line 1262 looks like a reference -- Missing reference section? 'CONTDISP' on line 1271 looks like a reference -- Missing reference section? 'SMIMEV2' on line 1293 looks like a reference -- Missing reference section? 'CERT3' on line 1117 looks like a reference -- Missing reference section? 'RANDOM' on line 1291 looks like a reference -- Missing reference section? '0' on line 1234 looks like a reference -- Missing reference section? '1' on line 1235 looks like a reference -- Missing reference section? '2' on line 1236 looks like a reference -- Missing reference section? 'CERT31' on line 1259 looks like a reference Summary: 6 errors (**), 0 flaws (~~), 3 warnings (==), 19 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Internet Draft Editor: Blake Ramsdell, 2 draft-ietf-smime-rfc2633bis-01.txt Brute Squad Labs 3 June 30, 2002 4 Expires December 30, 2002 6 S/MIME Version 3.1 Message Specification 8 Status of this memo 10 This document is an Internet-Draft and is in full conformance with all 11 provisions of Section 10 of RFC2026. 13 Internet-Drafts are working documents of the Internet Engineering Task 14 Force (IETF), its areas, and its working groups. Note that other 15 groups may also distribute working documents as Internet-Drafts. 17 Internet-Drafts are draft documents valid for a maximum of six months 18 and may be updated, replaced, or obsoleted by other documents at any 19 time. It is inappropriate to use Internet-Drafts as reference material 20 or to cite them other than as "work in progress." 22 The list of current Internet-Drafts can be accessed at 23 http://www.ietf.org/ietf/1id-abstracts.txt 25 The list of Internet-Draft Shadow Directories can be accessed at 26 http://www.ietf.org/shadow.html. 28 1. Introduction 30 S/MIME (Secure/Multipurpose Internet Mail Extensions) provides a 31 consistent way to send and receive secure MIME data. Based on the 32 popular Internet MIME standard, S/MIME provides the following 33 cryptographic security services for electronic messaging applications: 34 authentication, message integrity and non-repudiation of origin (using 35 digital signatures) and data confidentiality (using encryption). 37 S/MIME can be used by traditional mail user agents (MUAs) to add 38 cryptographic security services to mail that is sent, and to interpret 39 cryptographic security services in mail that is received. However, 40 S/MIME is not restricted to mail; it can be used with any transport 41 mechanism that transports MIME data, such as HTTP. As such, S/MIME 42 takes advantage of the object-based features of MIME and allows secure 43 messages to be exchanged in mixed-transport systems. 45 Further, S/MIME can be used in automated message transfer agents that 46 use cryptographic security services that do not require any human 47 intervention, such as the signing of software-generated documents and 48 the encryption of FAX messages sent over the Internet. 50 1.1 Specification Overview 52 This document describes a protocol for adding cryptographic signature 53 and encryption services to MIME data. The MIME standard [MIME-SPEC] 54 provides a general structure for the content type of Internet messages 55 and allows extensions for new content type applications. 57 This specification defines how to create a MIME body part that has 58 been cryptographically enhanced according to CMS [CMS], which is 59 derived from PKCS #7 [PKCS-7]. This specification also defines the 60 application/pkcs7- mime MIME type that can be used to transport those 61 body parts. 63 This specification also discusses how to use the multipart/signed MIME 64 type defined in [MIME-SECURE] to transport S/MIME signed messages. 65 multipart/signed is used in conjunction with the 66 application/pkcs7-signature MIME type, which is used to transport 67 a detached S/MIME signature. 69 In order to create S/MIME messages, an S/MIME agent has to follow the 70 specifications in this document, as well as the specifications 71 listed in the Cryptographic Message Syntax [CMS]. 73 Throughout this specification, there are requirements and 74 recommendations made for how receiving agents handle incoming 75 messages. There are separate requirements and recommendations for how 76 sending agents create outgoing messages. In general, the best strategy 77 is to "be liberal in what you receive and conservative in what you 78 send". Most of the requirements are placed on the handling of incoming 79 messages while the recommendations are mostly on the creation of 80 outgoing messages. 82 The separation for requirements on receiving agents and sending agents 83 also derives from the likelihood that there will be S/MIME systems 84 that involve software other than traditional Internet mail clients. 85 S/MIME can be used with any system that transports MIME data. An 86 automated process that sends an encrypted message might not be able to 87 receive an encrypted message at all, for example. Thus, the 88 requirements and recommendations for the two types of agents are 89 listed separately when appropriate. 91 1.2 Terminology 93 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 94 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 95 document are to be interpreted as described in [MUSTSHOULD]. 97 1.3 Definitions 99 For the purposes of this specification, the following definitions 100 apply. 102 ASN.1: Abstract Syntax Notation One, as defined in CCITT X.208. 104 BER: Basic Encoding Rules for ASN.1, as defined in CCITT X.209. 106 Certificate: A type that binds an entity's distinguished name to a 107 public key with a digital signature. 109 DER: Distinguished Encoding Rules for ASN.1, as defined in CCITT 110 X.509. 112 7-bit data: Text data with lines less than 998 characters long, where 113 none of the characters have the 8th bit set, and there are no NULL 114 characters. and occur only as part of a end of line 115 delimiter. 117 8-bit data: Text data with lines less than 998 characters, and where 118 none of the characters are NULL characters. and occur only 119 as part of a end of line delimiter. 121 Binary data: Arbitrary data. 123 Transfer Encoding: A reversible transformation made on data so 8-bit 124 or binary data may be sent via a channel that only transmits 7-bit 125 data. 127 Receiving agent: software that interprets and processes S/MIME CMS 128 objects, MIME body parts that contain CMS objects, or both. 130 Sending agent: software that creates S/MIME CMS objects, MIME body 131 parts that contain CMS objects, or both. 133 S/MIME agent: user software that is a receiving agent, a sending 134 agent, or both. 136 1.4 Compatibility with Prior Practice of S/MIME 138 S/MIME version 3 agents should attempt to have the greatest 139 interoperability possible with S/MIME version 2 agents. S/MIME version 140 2 is described in RFC 2311 through RFC 2315, inclusive. RFC 2311 also 141 has historical information about the development of S/MIME. 143 1.5 Changes Since S/MIME v3.0 145 [TBD] 147 1.6 Discussion of This Specification 149 This specification is being discussed on the "ietf-smime" mailing 150 list. To subscribe, send a message to: 152 ietf-smime-request@imc.org 154 with the single word 156 subscribe 158 in the body of the message. There is a Web site for the mailing list 159 at . 161 2. CMS Options 163 CMS allows for a wide variety of options in content and algorithm 164 support. This section puts forth a number of support requirements and 165 recommendations in order to achieve a base level of interoperability 166 among all S/MIME implementations. [CMS] provides additional details 167 regarding the use of the cryptographic algorithms. 169 2.1 DigestAlgorithmIdentifier 171 Sending and receiving agents MUST support SHA-1 [CMSALG]. Receiving 172 agents SHOULD support MD5 [CMSALG] for the purpose of providing 173 backward compatibility with MD5-digested S/MIME v2 SignedData objects. 175 2.2 SignatureAlgorithmIdentifier 177 Receiving agents MUST support id-dsa defined in [CMSALG]. The 178 algorithm parameters MUST be absent (not encoded as NULL). Receiving 179 agents MUST support rsaEncryption, defined in [CMSALG]. 181 Sending agents MUST support either id-dsa or rsaEncryption. 183 Note that S/MIME v3 clients might only implement signing or signature 184 verification using id-dsa. Also note that S/MIME v2 clients are only 185 capable of verifying digital signatures using the rsaEncryption 186 algorithm. 188 2.3 KeyEncryptionAlgorithmIdentifier 190 Sending and receiving agents MUST support rsaEncryption, defined in 191 [CMSALG]. 193 Sending and receiving agents SHOULD support Diffie-Hellman defined in 194 [CMSALG]. 196 Note that S/MIME v3 clients might only implement key encryption and 197 decryption using the Diffie-Hellman algorithm. Also note that S/MIME 198 v2 clients are only capable of decrypting content-encryption keys 199 using the rsaEncryption algorithm. 201 2.4 General Syntax 203 CMS defines multiple content types. Of these, only the Data, 204 SignedData, and EnvelopedData content types are currently used for 205 S/MIME. 207 2.4.1 Data Content Type 209 Sending agents MUST use the id-data content type identifier to 210 identify the "inner" MIME message content. For example, when applying 211 a digital signature to MIME data, the CMS signedData encapContentInfo 212 eContentType MUST include the id-data object identifier and the MIME 213 content MUST be stored in the SignedData encapContentInfo eContent 214 OCTET STRING (unless the sending agent is using multipart/signed, in 215 which case the eContent is absent, per section 3.4.3 of this 216 document). As another example, when applying encryption to MIME data, 217 the CMS EnvelopedData encryptedContentInfo ContentType MUST include 218 the id-data object identifier and the encrypted MIME content MUST be 219 stored in the envelopedData encryptedContentInfo encryptedContent 220 OCTET STRING. 222 2.4.2 SignedData Content Type 224 Sending agents MUST use the signedData content type to apply a digital 225 signature to a message or, in a degenerate case where there is no 226 signature information, to convey certificates. 228 2.4.3 EnvelopedData Content Type 230 This content type is used to apply data confidentiality to a message. 231 A sender needs to have access to a public key for each intended 232 message recipient to use this service. This content type does not 233 provide authentication. 235 2.5 Attribute SignerInfo Type 237 The SignerInfo type allows the inclusion of unsigned and signed 238 attributes to be included along with a signature. 240 Receiving agents MUST be able to handle zero or one instance of each 241 of the signed attributes listed here. Sending agents SHOULD generate 242 one instance of each of the following signed attributes in each S/MIME 243 message: 245 - signingTime (section 2.5.1 in this document) 246 - sMIMECapabilities (section 2.5.2 in this document) 247 - sMIMEEncryptionKeyPreference (section 2.5.3 in this document) 249 Further, receiving agents SHOULD be able to handle zero or one 250 instance in the signed attributes of the signingCertificate attribute 251 (section 5 in [ESS]). 253 Sending agents SHOULD generate one instance of the signingCertificate 254 signed attribute in each S/MIME message. 256 Additional attributes and values for these attributes may be defined 257 in the future. Receiving agents SHOULD handle attributes or values 258 that it does not recognize in a graceful manner. 260 Sending agents that include signed attributes that are not listed here 261 SHOULD display those attributes to the user, so that the user is aware 262 of all of the data being signed. 264 2.5.1 Signing-Time Attribute 266 The signing-time attribute is used to convey the time that a message 267 was signed. The time of signing will most likely be created by a 268 message originator and therefore is only as trustworthy as the 269 originator. 271 Sending agents MUST encode signing time through the year 2049 as 272 UTCTime; signing times in 2050 or later MUST be encoded as 273 GeneralizedTime. When the UTCTime CHOICE is used, S/MIME agents MUST 274 interpret the year field (YY) as follows: 276 if YY is greater than or equal to 50, the year is interpreted as 19YY; 277 if YY is less than 50, the year is interpreted as 20YY. 279 2.5.2 SMIMECapabilities Attribute 281 The SMIMECapabilities attribute includes signature algorithms (such as 282 "sha1WithRSAEncryption"), symmetric algorithms (such as "DES-EDE3- 283 CBC"), and key encipherment algorithms (such as "rsaEncryption"). It 284 also includes a non-algorithm capability which is the preference for 285 signedData. The SMIMECapabilities were designed to be flexible and 286 extensible so that, in the future, a means of identifying other 287 capabilities and preferences such as certificates can be added in a 288 way that will not cause current clients to break. 290 If present, the SMIMECapabilities attribute MUST be a SignedAttribute; 291 it MUST NOT be an UnsignedAttribute. CMS defines SignedAttributes as a 292 SET OF Attribute. The SignedAttributes in a signerInfo MUST NOT 293 include multiple instances of the SMIMECapabilities attribute. CMS 294 defines the ASN.1 syntax for Attribute to include attrValues SET OF 295 AttributeValue. A SMIMECapabilities attribute MUST only include a 296 single instance of AttributeValue. There MUST NOT be zero or multiple 297 instances of AttributeValue present in the attrValues SET OF 298 AttributeValue. 300 The semantics of the SMIMECapabilites attribute specify a partial list 301 as to what the client announcing the SMIMECapabilites can support. A 302 client does not have to list every capability it supports, and 303 probably should not list all its capabilities so that the capabilities 304 list doesn't get too long. In an SMIMECapabilities attribute, the OIDs 305 are listed in order of their preference, but SHOULD be logically 306 separated along the lines of their categories (signature algorithms, 307 symmetric algorithms, key encipherment algorithms, etc.) 309 The structure of the SMIMECapabilities attribute is to facilitate 310 simple table lookups and binary comparisons in order to determine 311 matches. For instance, the DER-encoding for the SMIMECapability for 312 DES EDE3 CBC MUST be identically encoded regardless of the 313 implementation. 315 In the case of symmetric algorithms, the associated parameters for the 316 OID MUST specify all of the parameters necessary to differentiate 317 between two instances of the same algorithm. For instance, the number 318 of rounds and block size for RC5 must be specified in addition to the 319 key length. 321 There is a list of OIDs (OIDs Used with S/MIME) that is centrally 322 maintained and is separate from this specification. The list of OIDs 323 is maintained by the Internet Mail Consortium at 324 . Note that all OIDs 325 associated with the MUST and SHOULD implement algorithms are included 326 in section A of this document. 328 The OIDs that correspond to algorithms SHOULD use the same OID as the 329 actual algorithm, except in the case where the algorithm usage is 330 ambiguous from the OID. For instance, in an earlier specification, 331 rsaEncryption was ambiguous because it could refer to either a 332 signature algorithm or a key encipherment algorithm. In the event that 333 an OID is ambiguous, it needs to be arbitrated by the maintainer of 334 the registered SMIMECapabilities list as to which type of algorithm 335 will use the OID, and a new OID MUST be allocated under the 336 smimeCapabilities OID to satisfy the other use of the OID. 338 The registered SMIMECapabilities list specifies the parameters for 339 OIDs that need them, most notably key lengths in the case of variable- 340 length symmetric ciphers. In the event that there are no 341 differentiating parameters for a particular OID, the parameters MUST 342 be omitted, and MUST NOT be encoded as NULL. 344 Additional values for the SMIMECapabilities attribute may be defined 345 in the future. Receiving agents MUST handle a SMIMECapabilities object 346 that has values that it does not recognize in a graceful manner. 348 2.5.3 Encryption Key Preference Attribute 350 The encryption key preference attribute allows the signer to 351 unambiguously describe which of the signer's certificates has the 352 signer's preferred encryption key. This attribute is designed to 353 enhance behavior for interoperating with those clients which use 354 separate keys for encryption and signing. This attribute is used to 355 convey to anyone viewing the attribute which of the listed 356 certificates should be used for encrypting a session key for future 357 encrypted messages. 359 If present, the SMIMEEncryptionKeyPreference attribute MUST be a 360 SignedAttribute; it MUST NOT be an UnsignedAttribute. CMS defines 361 SignedAttributes as a SET OF Attribute. The SignedAttributes in a 362 signerInfo MUST NOT include multiple instances of the 363 SMIMEEncryptionKeyPreference attribute. CMS defines the ASN.1 syntax 364 for Attribute to include attrValues SET OF AttributeValue. A 365 SMIMEEncryptionKeyPreference attribute MUST only include a single 366 instance of AttributeValue. There MUST NOT be zero or multiple 367 instances of AttributeValue present in the attrValues SET OF 368 AttributeValue. 370 The sending agent SHOULD include the referenced certificate in the set 371 of certificates included in the signed message if this attribute is 372 used. The certificate may be omitted if it has been previously made 373 available to the receiving agent. Sending agents SHOULD use this 374 attribute if the commonly used or preferred encryption certificate is 375 not the same as the certificate used to sign the message. 377 Receiving agents SHOULD store the preference data if the signature on 378 the message is valid and the signing time is greater than the 379 currently stored value. (As with the SMIMECapabilities, the clock skew 380 should be checked and the data not used if the skew is too great.) 381 Receiving agents SHOULD respect the sender's encryption key preference 382 attribute if possible. This however represents only a preference and 383 the receiving agent may use any certificate in replying to the sender 384 that is valid. 386 2.5.3.1 Selection of Recipient Key Management Certificate 388 In order to determine the key management certificate to be used when 389 sending a future CMS envelopedData message for a particular recipient, 390 the following steps SHOULD be followed: 392 - If an SMIMEEncryptionKeyPreference attribute is found in a 393 signedData object received from the desired recipient, this 394 identifies the X.509 certificate that should be used as the X.509 395 key management certificate for the recipient. 397 - If an SMIMEEncryptionKeyPreference attribute is not found in a 398 signedData object received from the desired recipient, the set of 399 X.509 certificates should be searched for a X.509 certificate with 400 the same subject name as the signing X.509 certificate which can be 401 used for key management. 403 - Or use some other method of determining the user's key management 404 key. If a X.509 key management certificate is not found, then 405 encryption cannot be done with the signer of the message. If 406 multiple X.509 key management certificates are found, the S/MIME 407 agent can make an arbitrary choice between them. 409 2.6 SignerIdentifier SignerInfo Type 411 S/MIME v3 requires the use of SignerInfo version 1, that is the 412 issuerAndSerialNumber CHOICE MUST be used for SignerIdentifier. 414 2.7 ContentEncryptionAlgorithmIdentifier 416 Sending and receiving agents MUST support encryption and decryption 417 with DES EDE3 CBC, hereinafter called "tripleDES" [CMSALG]. Receiving 418 agents SHOULD support encryption and decryption using the RC2 [CMSALG] 419 or a compatible algorithm at a key size of 40 bits, hereinafter called 420 "RC2/40". 422 2.7.1 Deciding Which Encryption Method To Use 424 When a sending agent creates an encrypted message, it has to decide 425 which type of encryption to use. The decision process involves using 426 information garnered from the capabilities lists included in messages 427 received from the recipient, as well as out-of-band information such 428 as private agreements, user preferences, legal restrictions, and so 429 on. 431 Section 2.5 defines a method by which a sending agent can optionally 432 announce, among other things, its decrypting capabilities in its order 433 of preference. The following method for processing and remembering the 434 encryption capabilities attribute in incoming signed messages SHOULD 435 be used. 437 - If the receiving agent has not yet created a list of capabilities 438 for the sender's public key, then, after verifying the signature on 439 the incoming message and checking the timestamp, the receiving agent 440 SHOULD create a new list containing at least the signing time and 441 the symmetric capabilities. 443 - If such a list already exists, the receiving agent SHOULD verify 444 that the signing time in the incoming message is greater than the 445 signing time stored in the list and that the signature is valid. If 446 so, the receiving agent SHOULD update both the signing time and 447 capabilities in the list. Values of the signing time that lie far in 448 the future (that is, a greater discrepancy than any reasonable clock 449 skew), or a capabilities list in messages whose signature could not 450 be verified, MUST NOT be accepted. 452 The list of capabilities SHOULD be stored for future use in creating 453 messages. 455 Before sending a message, the sending agent MUST decide whether it is 456 willing to use weak encryption for the particular data in the message. 457 If the sending agent decides that weak encryption is unacceptable for 458 this data, then the sending agent MUST NOT use a weak algorithm such 459 as RC2/40. The decision to use or not use weak encryption overrides 460 any other decision in this section about which encryption algorithm to 461 use. 463 Sections 2.7.2.1 through 2.7.2.4 describe the decisions a sending 464 agent SHOULD use in deciding which type of encryption should be 465 applied to a message. These rules are ordered, so the sending agent 466 SHOULD make its decision in the order given. 468 2.7.1.1 Rule 1: Known Capabilities 470 If the sending agent has received a set of capabilities from the 471 recipient for the message the agent is about to encrypt, then the 472 sending agent SHOULD use that information by selecting the first 473 capability in the list (that is, the capability most preferred by the 474 intended recipient) for which the sending agent knows how to encrypt. 475 The sending agent SHOULD use one of the capabilities in the list if 476 the agent reasonably expects the recipient to be able to decrypt the 477 message. 479 2.7.1.2 Rule 2: Unknown Capabilities, Known Use of Encryption 481 If: 482 - the sending agent has no knowledge of the encryption capabilities 483 of the recipient, 484 - and the sending agent has received at least one message from the 485 recipient, 486 - and the last encrypted message received from the recipient had a 487 trusted signature on it, 488 then the outgoing message SHOULD use the same encryption algorithm as 489 was used on the last signed and encrypted message received from the 490 recipient. 492 2.7.1.3 Rule 3: Unknown Capabilities, Unknown Version of S/MIME 494 If: 495 - the sending agent has no knowledge of the encryption capabilities 496 of the recipient, 497 - and the sending agent has no knowledge of the version of S/MIME 498 of the recipient, 499 then the sending agent SHOULD use tripleDES because it is a stronger 500 algorithm and is required by S/MIME v3. If the sending agent chooses 501 not to use tripleDES in this step, it SHOULD use RC2/40. 503 2.7.2 Choosing Weak Encryption 505 Like all algorithms that use 40 bit keys, RC2/40 is considered by many 506 to be weak encryption. A sending agent that is controlled by a human 507 SHOULD allow a human sender to determine the risks of sending data 508 using RC2/40 or a similarly weak encryption algorithm before sending 509 the data, and possibly allow the human to use a stronger encryption 510 method such as tripleDES. 512 2.7.3 Multiple Recipients 514 If a sending agent is composing an encrypted message to a group of 515 recipients where the encryption capabilities of some of the recipients 516 do not overlap, the sending agent is forced to send more than one 517 message. It should be noted that if the sending agent chooses to send 518 a message encrypted with a strong algorithm, and then send the same 519 message encrypted with a weak algorithm, someone watching the 520 communications channel may be able to learn the contents of the 521 strongly-encrypted message simply by decrypting the weakly-encrypted 522 message. 524 3. Creating S/MIME Messages 526 This section describes the S/MIME message formats and how they are 527 created. S/MIME messages are a combination of MIME bodies and CMS 528 objects. Several MIME types as well as several CMS objects are used. 529 The data to be secured is always a canonical MIME entity. The MIME 530 entity and other data, such as certificates and algorithm identifiers, 531 are given to CMS processing facilities which produces a CMS object. 532 The CMS object is then finally wrapped in MIME. The Enhanced Security 533 Services for S/MIME [ESS] document provides examples of how nested, 534 secured S/MIME messages are formatted. ESS provides an example of how 535 a triple-wrapped S/MIME message is formatted using multipart/signed 536 and application/pkcs7-mime for the signatures. 538 S/MIME provides one format for enveloped-only data, several formats 539 for signed-only data, and several formats for signed and enveloped 540 data. Several formats are required to accommodate several 541 environments, in particular for signed messages. The criteria for 542 choosing among these formats are also described. 544 The reader of this section is expected to understand MIME as described 545 in [MIME-SPEC] and [MIME-SECURE]. 547 3.1 Preparing the MIME Entity for Signing or Enveloping 549 S/MIME is used to secure MIME entities. A MIME entity may be a sub- 550 part, sub-parts of a message, or the whole message with all its sub- 551 parts. A MIME entity that is the whole message includes only the MIME 552 headers and MIME body, and does not include the RFC-822 headers. Note 553 that S/MIME can also be used to secure MIME entities used in 554 applications other than Internet mail. 556 The MIME entity that is secured and described in this section can be 557 thought of as the "inside" MIME entity. That is, it is the "innermost" 558 object in what is possibly a larger MIME message. Processing "outside" 559 MIME entities into CMS objects is described in Section 3.2, 3.4 and 560 elsewhere. 562 The procedure for preparing a MIME entity is given in [MIME-SPEC]. The 563 same procedure is used here with some additional restrictions when 564 signing. Description of the procedures from [MIME-SPEC] are repeated 565 here, but the reader should refer to that document for the exact 566 procedure. This section also describes additional requirements. 568 A single procedure is used for creating MIME entities that are to be 569 signed, enveloped, or both signed and enveloped. Some additional steps 570 are recommended to defend against known corruptions that can occur 571 during mail transport that are of particular importance for clear- 572 signing using the multipart/signed format. It is recommended that 573 these additional steps be performed on enveloped messages, or signed 574 and enveloped messages in order that the message can be forwarded to 575 any environment without modification. 577 These steps are descriptive rather than prescriptive. The implementor 578 is free to use any procedure as long as the result is the same. 580 Step 1. The MIME entity is prepared according to the local conventions 582 Step 2. The leaf parts of the MIME entity are converted to canonical 583 form 585 Step 3. Appropriate transfer encoding is applied to the leaves of the 586 MIME entity 588 When an S/MIME message is received, the security services on the 589 message are processed, and the result is the MIME entity. That MIME 590 entity is typically passed to a MIME-capable user agent where, it is 591 further decoded and presented to the user or receiving application. 593 [TBD] 2822 header protection 595 3.1.1 Canonicalization 597 Each MIME entity MUST be converted to a canonical form that is 598 uniquely and unambiguously representable in the environment where the 599 signature is created and the environment where the signature will be 600 verified. MIME entities MUST be canonicalized for enveloping as well 601 as signing. 603 The exact details of canonicalization depend on the actual MIME type 604 and subtype of an entity, and are not described here. Instead, the 605 standard for the particular MIME type should be consulted. For 606 example, canonicalization of type text/plain is different from 607 canonicalization of audio/basic. Other than text types, most types 608 have only one representation regardless of computing platform or 609 environment which can be considered their canonical representation. In 610 general, canonicalization will be performed by the non-security part 611 of the sending agent rather than the S/MIME implementation. 613 The most common and important canonicalization is for text, which is 614 often represented differently in different environments. MIME entities 615 of major type "text" must have both their line endings and character 616 set canonicalized. The line ending must be the pair of characters 617 , and the charset should be a registered charset [CHARSETS]. 618 The details of the canonicalization are specified in [MIME-SPEC]. The 619 chosen charset SHOULD be named in the charset parameter so that the 620 receiving agent can unambiguously determine the charset used. 622 Note that some charsets such as ISO-2022 have multiple representations 623 for the same characters. When preparing such text for signing, the 624 canonical representation specified for the charset MUST be used. 626 3.1.2 Transfer Encoding 628 When generating any of the secured MIME entities below, except the 629 signing using the multipart/signed format, no transfer encoding at all 630 is required. S/MIME implementations MUST be able to deal with binary 631 MIME objects. If no Content-Transfer-Encoding header is present, the 632 transfer encoding should be considered 7BIT. 634 S/MIME implementations SHOULD however use transfer encoding described 635 in section 3.1.3 for all MIME entities they secure. The reason for 636 securing only 7-bit MIME entities, even for enveloped data that are 637 not exposed to the transport, is that it allows the MIME entity to be 638 handled in any environment without changing it. For example, a trusted 639 gateway might remove the envelope, but not the signature, of a 640 message, and then forward the signed message on to the end recipient 641 so that they can verify the signatures directly. If the transport 642 internal to the site is not 8-bit clean, such as on a wide-area 643 network with a single mail gateway, verifying the signature will not 644 be possible unless the original MIME entity was only 7-bit data. 646 3.1.3 Transfer Encoding for Signing Using multipart/signed 648 If a multipart/signed entity is EVER to be transmitted over the 649 standard Internet SMTP infrastructure or other transport that is 650 constrained to 7-bit text, it MUST have transfer encoding applied so 651 that it is represented as 7-bit text. MIME entities that are 7-bit 652 data already need no transfer encoding. Entities such as 8-bit text 653 and binary data can be encoded with quoted-printable or base-64 654 transfer encoding. 656 The primary reason for the 7-bit requirement is that the Internet mail 657 transport infrastructure cannot guarantee transport of 8-bit or binary 658 data. Even though many segments of the transport infrastructure now 659 handle 8-bit and even binary data, it is sometimes not possible to 660 know whether the transport path is 8-bit clear. If a mail message with 661 8-bit data were to encounter a message transfer agent that can not 662 transmit 8-bit or binary data, the agent has three options, none of 663 which are acceptable for a clear-signed message: 665 - The agent could change the transfer encoding; this would invalidate 666 the signature. 667 - The agent could transmit the data anyway, which would most likely 668 result in the 8th bit being corrupted; this too would invalidate the 669 signature. 670 - The agent could return the message to the sender. 672 [MIME-SECURE] prohibits an agent from changing the transfer encoding 673 of the first part of a multipart/signed message. If a compliant agent 674 that can not transmit 8-bit or binary data encounters a 675 multipart/signed message with 8-bit or binary data in the first part, 676 it would have to return the message to the sender as undeliverable. 678 3.1.4 Sample Canonical MIME Entity 680 This example shows a multipart/mixed message with full transfer 681 encoding. This message contains a text part and an attachment. The 682 sample message text includes characters that are not US-ASCII and thus 683 must be transfer encoded. Though not shown here, the end of each line 684 is . The line ending of the MIME headers, the text, and 685 transfer encoded parts, all must be . 687 Note that this example is not of an S/MIME message. 689 Content-Type: multipart/mixed; boundary=bar 691 --bar 692 Content-Type: text/plain; charset=iso-8859-1 693 Content-Transfer-Encoding: quoted-printable 695 =A1Hola Michael! 697 How do you like the new S/MIME specification? 699 It's generally a good idea to encode lines that begin with 700 From=20because some mail transport agents will insert a greater- 701 than (>) sign, thus invalidating the signature. 703 Also, in some cases it might be desirable to encode any =20 704 trailing whitespace that occurs on lines in order to ensure =20 705 that the message signature is not invalidated when passing =20 706 a gateway that modifies such whitespace (like BITNET). =20 708 --bar 709 Content-Type: image/jpeg 710 Content-Transfer-Encoding: base64 712 iQCVAwUBMJrRF2N9oWBghPDJAQE9UQQAtl7LuRVndBjrk4EqYBIb3h5QXIX/LC// 713 jJV5bNvkZIGPIcEmI5iFd9boEgvpirHtIREEqLQRkYNoBActFBZmh9GC3C041WGq 714 uMbrbxc+nIs1TIKlA08rVi9ig/2Yh7LFrK5Ein57U/W72vgSxLhe/zhdfolT9Brn 715 HOxEa44b+EI= 717 --bar-- 719 3.2 The application/pkcs7-mime Type 721 The application/pkcs7-mime type is used to carry CMS objects of 722 several types including envelopedData and signedData. The details of 723 constructing these entities is described in subsequent sections. This 724 section describes the general characteristics of the 725 application/pkcs7- mime type. 727 The carried CMS object always contains a MIME entity that is prepared 728 as described in section 3.1 if the eContentType is id-data. Other 729 contents may be carried when the eContentType contains different 730 values. See [ESS] for an example of this with signed receipts. 732 Since CMS objects are binary data, in most cases base-64 transfer 733 encoding is appropriate, in particular when used with SMTP transport. 734 The transfer encoding used depends on the transport through which the 735 object is to be sent, and is not a characteristic of the MIME type. 737 Note that this discussion refers to the transfer encoding of the CMS 738 object or "outside" MIME entity. It is completely distinct from, and 739 unrelated to, the transfer encoding of the MIME entity secured by the 740 CMS object, the "inside" object, which is described in section 3.1. 742 Because there are several types of application/pkcs7-mime objects, a 743 sending agent SHOULD do as much as possible to help a receiving agent 744 know about the contents of the object without forcing the receiving 745 agent to decode the ASN.1 for the object. The MIME headers of all 746 application/pkcs7-mime objects SHOULD include the optional "smime- 747 type" parameter, as described in the following sections. 749 3.2.1 The name and filename Parameters 751 For the application/pkcs7-mime, sending agents SHOULD emit the 752 optional "name" parameter to the Content-Type field for compatibility 753 with older systems. Sending agents SHOULD also emit the optional 754 Content-Disposition field [CONTDISP] with the "filename" parameter. If 755 a sending agent emits the above parameters, the value of the 756 parameters SHOULD be a file name with the appropriate extension: 758 MIME Type File Extension 760 Application/pkcs7-mime (signedData, envelopedData) .p7m 762 Application/pkcs7-mime (degenerate signedData .p7c 763 certificate management message) 765 Application/pkcs7-signature .p7s 767 In addition, the file name SHOULD be limited to eight characters 768 followed by a three letter extension. The eight character filename 769 base can be any distinct name; the use of the filename base "smime" 770 SHOULD be used to indicate that the MIME entity is associated with 771 S/MIME. 773 Including a file name serves two purposes. It facilitates easier use 774 of S/MIME objects as files on disk. It also can convey type 775 information across gateways. When a MIME entity of type 776 application/pkcs7-mime (for example) arrives at a gateway that has no 777 special knowledge of S/MIME, it will default the entity's MIME type to 778 application/octet-stream and treat it as a generic attachment, thus 779 losing the type information. However, the suggested filename for an 780 attachment is often carried across a gateway. This often allows the 781 receiving systems to determine the appropriate application to hand the 782 attachment off to, in this case a stand-alone S/MIME processing 783 application. Note that this mechanism is provided as a convenience for 784 implementations in certain environments. A proper S/MIME 785 implementation MUST use the MIME types and MUST NOT rely on the file 786 extensions. 788 3.2.2 The smime-type parameter 790 The application/pkcs7-mime content type defines the optional "smime- 791 type" parameter. The intent of this parameter is to convey details 792 about the security applied (signed or enveloped) along with infomation 793 about the contained content. This specification defines the following 794 smime- types. 796 Name Security Inner Content 798 enveloped-data EnvelopedData id-data 800 signed-data SignedData id-data 802 cert-management SignedData none 804 In order that consistency can be obtained with future, the following 805 guidelines should be followed when assigning a new smime-type 806 parameter. 808 1. If both signing and encryption can be applied to the content, then 809 two values for smime-type SHOULD be assigned "signed-*" and 810 "encrypted- *". If one operation can be assigned then this may be 811 omitted. Thus since "cert-management" can only be signed, "signed-" is 812 omitted. 814 2. A common string for a content oid should be assigned. We use "data" 815 for the id-data content OID when MIME is the inner content. 817 3. If no common string is assigned. Then the common string of 818 "OID." is recommended (for example, "OID.1.3.6.1.5.5.7.6.1" would 819 be DES40). 821 3.3 Creating an Enveloped-only Message 823 This section describes the format for enveloping a MIME entity without 824 signing it. It is important to note that sending enveloped but not 825 signed messages does not provide for data integrity. It is possible to 826 replace ciphertext in such a way that the processed message will still 827 be valid, but the meaning may be altered. 829 Step 1. The MIME entity to be enveloped is prepared according to 830 section 3.1. 832 Step 2. The MIME entity and other required data is processed into a 833 CMS object of type envelopedData. In addition to encrypting a copy of 834 the content-encryption key for each recipient, a copy of the content- 835 encryption key SHOULD be encrypted for the originator and included in 836 the envelopedData (see CMS Section 6). 838 Step 3. The envelopedData object is wrapped in a CMS ContentInfo 839 object. 841 Step 4. The ContentInfo object is inserted into an 842 application/pkcs7-mime MIME entity. 844 The smime-type parameter for enveloped-only messages is "enveloped- 845 data". The file extension for this type of message is ".p7m". 847 A sample message would be: 849 Content-Type: application/pkcs7-mime; smime-type=enveloped-data; 850 name=smime.p7m 851 Content-Transfer-Encoding: base64 852 Content-Disposition: attachment; filename=smime.p7m 854 rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6 855 7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H 856 f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 857 0GhIGfHfQbnj756YT64V 859 3.4 Creating a Signed-only Message 861 There are two formats for signed messages defined for S/MIME: 862 application/pkcs7-mime with SignedData, and multipart/signed. In 863 general, the multipart/signed form is preferred for sending, and 864 receiving agents SHOULD be able to handle both. 866 3.4.1 Choosing a Format for Signed-only Messages 868 There are no hard-and-fast rules when a particular signed-only format 869 should be chosen because it depends on the capabilities of all the 870 receivers and the relative importance of receivers with S/MIME 871 facilities being able to verify the signature versus the importance of 872 receivers without S/MIME software being able to view the message. 874 Messages signed using the multipart/signed format can always be viewed 875 by the receiver whether they have S/MIME software or not. They can 876 also be viewed whether they are using a MIME-native user agent or they 877 have messages translated by a gateway. In this context, "be viewed" 878 means the ability to process the message essentially as if it were not 879 a signed message, including any other MIME structure the message might 880 have. 882 Messages signed using the signedData format cannot be viewed by a 883 recipient unless they have S/MIME facilities. However, if they have 884 S/MIME facilities, these messages can always be verified if they were 885 not changed in transit. 887 3.4.2 Signing Using application/pkcs7-mime with SignedData 889 This signing format uses the application/pkcs7-mime MIME type. The 890 steps to create this format are: 892 Step 1. The MIME entity is prepared according to section 3.1 894 Step 2. The MIME entity and other required data is processed into a 895 CMS object of type signedData 897 Step 3. The signedData object is wrapped in a CMS ContentInfo 898 object. 900 Step 4. The ContentInfo object is inserted into an 901 application/pkcs7-mime MIME entity. 903 The smime-type parameter for messages using application/pkcs7-mime 904 with SignedData is "signed-data". The file extension for this type of 905 message is ".p7m". 907 A sample message would be: 909 Content-Type: application/pkcs7-mime; smime-type=signed-data; 910 name=smime.p7m 911 Content-Transfer-Encoding: base64 912 Content-Disposition: attachment; filename=smime.p7m 914 567GhIGfHfYT6ghyHhHUujpfyF4f8HHGTrfvhJhjH776tbB9HG4VQbnj7 915 77n8HHGT9HG4VQpfyF467GhIGfHfYT6rfvbnj756tbBghyHhHUujhJhjH 916 HUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H7n8HHGghyHh 917 6YT64V0GhIGfHfQbnj75 919 3.4.3 Signing Using the multipart/signed Format 921 This format is a clear-signing format. Recipients without any S/MIME 922 or CMS processing facilities are able to view the message. It makes 923 use of the multipart/signed MIME type described in [MIME-SECURE]. The 924 multipart/signed MIME type has two parts. The first part contains the 925 MIME entity that is signed; the second part contains the "detached 926 signature" CMS SignedData object in which the encapContentInfo 927 eContent field is absent. 929 3.4.3.1 The application/pkcs7-signature MIME Type 931 This MIME type always contains a CMS ContentInfo containing a single 932 CMS object of type signedData. The signedData encapContentInfo 933 eContent field MUST be absent. The signerInfos field contains the 934 signatures for the MIME entity. 936 The file extension for signed-only messages using application/pkcs7- 937 signature is ".p7s". 939 3.4.3.2 Creating a multipart/signed Message 941 Step 1. The MIME entity to be signed is prepared according to section 942 3.1, taking special care for clear-signing. 944 Step 2. The MIME entity is presented to CMS processing in order to 945 obtain an object of type signedData in which the encapContentInfo 946 eContent field is absent. 948 Step 3. The MIME entity is inserted into the first part of a 949 multipart/signed message with no processing other than that described 950 in section 3.1. 952 Step 4. Transfer encoding is applied to the "detached signature" CMS 953 SignedData object and it is inserted into a MIME entity of type 954 application/pkcs7-signature. 956 Step 5. The MIME entity of the application/pkcs7-signature is inserted 957 into the second part of the multipart/signed entity. 959 The multipart/signed Content type has two required parameters: the 960 protocol parameter and the micalg parameter. 962 The protocol parameter MUST be "application/pkcs7-signature". Note 963 that quotation marks are required around the protocol parameter 964 because MIME requires that the "/" character in the parameter value 965 MUST be quoted. 967 The micalg parameter allows for one-pass processing when the signature 968 is being verified. The value of the micalg parameter is dependent on 969 the message digest algorithm(s) used in the calculation of the Message 970 Integrity Check. If multiple message digest algorithms are used they 971 MUST be separated by commas per [MIME-SECURE]. The values to be placed 972 in the micalg parameter SHOULD be from the following: 974 Algorithm Value 975 used 977 MD5 md5 978 SHA-1 sha1 979 Any other unknown 981 (Historical note: some early implementations of S/MIME emitted and 982 expected "rsa-md5" and "rsa-sha1" for the micalg parameter.) Receiving 983 agents SHOULD be able to recover gracefully from a micalg parameter 984 value that they do not recognize. 986 3.4.3.3 Sample multipart/signed Message 988 Content-Type: multipart/signed; 989 protocol="application/pkcs7-signature"; 990 micalg=sha1; boundary=boundary42 992 --boundary42 993 Content-Type: text/plain 995 This is a clear-signed message. 997 --boundary42 998 Content-Type: application/pkcs7-signature; name=smime.p7s 999 Content-Transfer-Encoding: base64 1000 Content-Disposition: attachment; filename=smime.p7s 1002 ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6 1003 4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj 1004 n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 1005 7GhIGfHfYT64VQbnj756 1007 --boundary42-- 1009 3.5 Signing and Encrypting 1011 To achieve signing and enveloping, any of the signed-only and 1012 encrypted-only MIME formats listed above may be nested. This is 1013 allowed because the above formats are all MIME entities, and because 1014 they all secure MIME entities. 1016 An S/MIME implementation MUST be able to receive and process 1017 arbitrarily nested S/MIME within reasonable resource limits of the 1018 recipient computer. 1020 It is possible to either sign a message first, or to envelope the 1021 message first. It is up to the implementor and the user to choose. 1022 When signing first, the signatories are then securely obscured by the 1023 enveloping. When enveloping first the signatories are exposed, but it 1024 is possible to verify signatures without removing the enveloping. This 1025 may be useful in an environment were automatic signature verification 1026 is desired, as no private key material is required to verify a 1027 signature. 1029 There are security ramifications to choosing whether to sign first or 1030 encrypt first. A recipient of a message that is encrypted and then 1031 signed can validate that the encrypted block was unaltered, but cannot 1032 determine any relationship between the signer and the unencrypted 1033 contents of the message. A recipient of a message that is signed-then- 1034 encrypted can assume that the signed message itself has not been 1035 altered, but that a careful attacker may have changed the 1036 unauthenticated portions of the encrypted message. 1038 3.6 Creating a Certificate Management Message 1040 The certificate management message or MIME entity is used to transport 1041 certificates and/or certificate revocation lists, such as in response 1042 to a registration request. 1044 Step 1. The certificates and/or certificate revocation lists are made 1045 available to the CMS generating process which creates a CMS object of 1046 type signedData. The signedData encapContentInfo eContent field MUST 1047 be absent and signerInfos field MUST be empty. 1049 Step 2. The signedData object is wrapped in a CMS ContentInfo 1050 object. 1052 Step 3. The ContentInfo object is enclosed in an application/pkcs7- 1053 mime MIME entity 1055 The smime-type parameter for a certificate management message is 1056 "cert-management". The file extension for this type of message is 1057 ".p7c". 1059 Please note that in prior versions of S/MIME, the smime-type parameter 1060 was set to "certs-only" for messages that contained only certificates 1061 and/or certificate revocation lists. The new use of "cert-management" 1062 is meant to clarify the semantic that both certificates and 1063 certificate revocation lists might be found in these messages. 1064 Receiving implementations SHOULD accept "certs-only" and 1065 "cert-management" and treat them equivalently (that is, both could 1066 contain certificates and/or certificate revocation lists). 1068 3.7 Registration Requests 1070 A sending agent that signs messages MUST have a certificate for the 1071 signature so that a receiving agent can verify the signature. There 1072 are many ways of getting certificates, such as through an exchange 1073 with a certificate authority, through a hardware token or diskette, 1074 and so on. 1076 S/MIME v2 [SMIMEV2] specified a method for "registering" public keys 1077 with certificate authorities using an application/pkcs10 body part. 1078 The IETF's PKIX Working Group is preparing another method for 1079 requesting certificates; however, that work was not finished at the 1080 time of this specification. S/MIME v3 does not specify how to request 1081 a certificate, but instead mandates that every sending agent already 1082 has a certificate. Standardization of certificate management is being 1083 pursued separately in the IETF. 1085 3.8 Identifying an S/MIME Message 1087 Because S/MIME takes into account interoperation in non-MIME 1088 environments, several different mechanisms are employed to carry the 1089 type information, and it becomes a bit difficult to identify S/MIME 1090 messages. The following table lists criteria for determining whether 1091 or not a message is an S/MIME message. A message is considered an 1092 S/MIME message if it matches any below. 1094 The file suffix in the table below comes from the "name" parameter in 1095 the content-type header, or the "filename" parameter on the content- 1096 disposition header. These parameters that give the file suffix are not 1097 listed below as part of the parameter section. 1099 MIME type: application/pkcs7-mime 1100 parameters: any 1101 file suffix: any 1103 MIME type: multipart/signed 1104 parameters: protocol="application/pkcs7-signature" 1105 file suffix: any 1107 MIME type: application/octet-stream 1108 parameters: any 1109 file suffix: p7m, p7s, p7c 1111 4. Certificate Processing 1113 A receiving agent MUST provide some certificate retrieval mechanism in 1114 order to gain access to certificates for recipients of digital 1115 envelopes. This specification does not cover how S/MIME agents handle 1116 certificates, only what they do after a certificate has been validated 1117 or rejected. S/MIME certification issues are covered in [CERT3]. 1119 At a minimum, for initial S/MIME deployment, a user agent could 1120 automatically generate a message to an intended recipient requesting 1121 that recipient's certificate in a signed return message. Receiving and 1122 sending agents SHOULD also provide a mechanism to allow a user to 1123 "store and protect" certificates for correspondents in such a way so 1124 as to guarantee their later retrieval. 1126 4.1 Key Pair Generation 1128 If an S/MIME agent needs to generate a key pair, then the S/MIME agent 1129 or some related administrative utility or function MUST be capable of 1130 generating separate DH and DSS public/private key pairs on behalf of 1131 the user. Each key pair MUST be generated from a good source of non- 1132 deterministic random input [RANDOM] and the private key MUST be 1133 protected in a secure fashion. 1135 If an S/MIME agent needs to generate a key pair, then the S/MIME agent 1136 or some related administrative utility or function SHOULD generate RSA 1137 key pairs. 1139 A user agent SHOULD generate RSA key pairs at a minimum key size of 1140 768 bits. A user agent MUST NOT generate RSA key pairs less than 512 1141 bits long. Creating keys longer than 1024 bits may cause some older 1142 S/MIME receiving agents to not be able to verify signatures, but gives 1143 better security and is therefore valuable. A receiving agent SHOULD be 1144 able to verify signatures with keys of any size over 512 bits. Some 1145 agents created in the United States have chosen to create 512 bit keys 1146 in order to get more advantageous export licenses. However, 512 bit 1147 keys are considered by many to be cryptographically insecure. 1148 Implementors should be aware that multiple (active) key pairs may be 1149 associated with a single individual. For example, one key pair may be 1150 used to support confidentiality, while a different key pair may be 1151 used for authentication. 1153 5. Security 1155 40-bit encryption is considered weak by most cryptographers. Using 1156 weak cryptography in S/MIME offers little actual security over sending 1157 plaintext. However, other features of S/MIME, such as the 1158 specification of tripleDES and the ability to announce stronger 1159 cryptographic capabilities to parties with whom you communicate, allow 1160 senders to create messages that use strong encryption. Using weak 1161 cryptography is never recommended unless the only alternative is no 1162 cryptography. When feasible, sending and receiving agents should 1163 inform senders and recipients the relative cryptographic strength of 1164 messages. 1166 It is impossible for most software or people to estimate the value of 1167 a message. Further, it is impossible for most software or people to 1168 estimate the actual cost of decrypting a message that is encrypted 1169 with a key of a particular size. Further, it is quite difficult to 1170 determine the cost of a failed decryption if a recipient cannot decode 1171 a message. Thus, choosing between different key sizes (or choosing 1172 whether to just use plaintext) is also impossible. However, decisions 1173 based on these criteria are made all the time, and therefore this 1174 specification gives a framework for using those estimates in choosing 1175 algorithms. 1177 If a sending agent is sending the same message using different 1178 strengths of cryptography, an attacker watching the communications 1179 channel may be able to determine the contents of the strongly- 1180 encrypted message by decrypting the weakly-encrypted version. In other 1181 words, a sender should not send a copy of a message using weaker 1182 cryptography than they would use for the original of the message. 1184 Modification of the ciphertext can go undetected if authentication is 1185 not also used, which is the case when sending EnvelopedData without 1186 wrapping it in SignedData or enclosing SignedData within it. 1188 [TBD] -- PKCS #1 v1.5 warnings (RFC 3218) 1190 [TBD] -- Small subgroup Diffie-Hellman (RFC 2785) 1192 A. ASN.1 Module 1194 SecureMimeMessageV3 1195 { iso(1) member-body(2) us(840) rsadsi(113549) 1196 pkcs(1) pkcs-9(9) smime(16) modules(0) smime(4) } 1198 DEFINITIONS IMPLICIT TAGS ::= 1199 BEGIN 1201 IMPORTS 1202 -- Cryptographic Message Syntax 1203 SubjectKeyIdentifier, IssuerAndSerialNumber, 1204 RecipientKeyIdentifier 1205 FROM CryptographicMessageSyntax 1206 { iso(1) member-body(2) us(840) rsadsi(113549) 1207 pkcs(1) pkcs-9(9) smime(16) modules(0) cms(1) }; 1209 -- id-aa is the arc with all new authenticated and unauthenticated 1210 -- attributes produced the by S/MIME Working Group 1212 id-aa OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840) 1213 rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) attributes(2)} 1215 -- S/MIME Capabilities provides a method of broadcasting the symetric 1216 -- capabilities understood. Algorithms should be ordered by 1217 -- preference and grouped by type 1219 smimeCapabilities OBJECT IDENTIFIER ::= 1220 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 15} 1222 SMIMECapability ::= SEQUENCE { 1223 capabilityID OBJECT IDENTIFIER, 1224 parameters ANY DEFINED BY capabilityID OPTIONAL } 1226 SMIMECapabilities ::= SEQUENCE OF SMIMECapability 1228 -- Encryption Key Preference provides a method of broadcasting the 1229 -- prefered encryption certificate. 1231 id-aa-encrypKeyPref OBJECT IDENTIFIER ::= {id-aa 11} 1233 SMIMEEncryptionKeyPreference ::= CHOICE { 1234 issuerAndSerialNumber [0] IssuerAndSerialNumber, 1235 receipentKeyId [1] RecipientKeyIdentifier, 1236 subjectAltKeyIdentifier [2] SubjectKeyIdentifier 1237 } 1239 -- The following list the OIDs to be used with S/MIME V3 1241 -- Signature Algorithms Not Found in [CMSALG] 1242 -- 1243 -- md2WithRSAEncryption OBJECT IDENTIFIER ::= 1244 -- {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1245 -- 2} 1246 -- 1247 -- Other Signed Attributes 1248 -- 1249 -- signingTime OBJECT IDENTIFIER ::= 1250 -- {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 1251 -- 5} 1252 -- See [CMS] for a description of how to encode the attribute 1253 -- value. 1255 END 1257 B. References 1259 [CERT31] "S/MIME Version 3.1 Certificate Handling", Internet Draft 1260 draft-ietf-smime-rfc2632bis 1262 [CHARSETS] Character sets assigned by IANA. See . 1265 [CMS] "Cryptographic Message Syntax", Internet Draft draft-ietf-smime- 1266 rfc2630bis 1268 [CMSALG] "Cryptographic Message Syntax (CMS) Algorithms", Internet- 1269 Draft draft-ietf-smime-cmsalg 1271 [CONTDISP] "Communicating Presentation Information in Internet 1272 Messages: The Content-Disposition Header Field", RFC 2183 1274 [ESS] "Enhanced Security Services for S/MIME", Internet draft, draft- 1275 ietf-smime-ess-*.txt. 1277 [MIME-SPEC] The primary definition of MIME. "MIME Part 1: Format of 1278 Internet Message Bodies", RFC 2045; "MIME Part 2: Media Types", RFC 1279 2046; "MIME Part 3: Message Header Extensions for Non-ASCII Text", RFC 1280 2047; "MIME Part 4: Registration Procedures", RFC 2048; "MIME Part 5: 1281 Conformance Criteria and Examples", RFC 2049 1283 [MIME-SECURE] "Security Multiparts for MIME: Multipart/Signed and 1284 Multipart/Encrypted", RFC 1847 1286 [MUSTSHOULD] "Key words for use in RFCs to Indicate Requirement 1287 Levels", RFC 2119 1289 [PKCS-7] "PKCS #7: Cryptographic Message Syntax Version 1.5", RFC 2315 1291 [RANDOM] "Randomness Recommendations for Security", RFC 1750 1293 [SMIMEV2] "S/MIME Version 2 Message Specification", RFC 2311 1295 C. Acknowledgements 1297 [tbd] 1299 D. Editor's address 1301 Blake Ramsdell 1302 Brute Squad Labs 1303 Suite 217-C 1304 16451 Redmond Way 1305 Redmond, WA 98052-4482 1307 blake@brutesquadlabs.com 1309 E. Changes from last draft 1311 Changed draft to specification in lots of places (Russ Housley) 1313 Privacy changed to data confidentiality (Russ Housley) 1315 Added section 1.5 for changes since S/MIME v3.0 (Russ Housley) 1317 Blown bulleted list in section 2.5 (Russ Housley, Jim Schaad) 1319 Yanked reference to timestamping service in section 2.5.1 (Russ 1320 Housley) 1322 Yanked OIDs found in [CMSALG] (Russ Housley) 1324 Attempt at better English for first sentence of section 2.4.1 (Jim 1325 Schaad) 1327 Crazy English in section 1.1 3rd paragraph is probably worse (Piers 1328 Chivers) 1330 Various other language clarifications (Piers Chivers) 1332 Hammered on section 3.6 for "certificate management" vs. "certs-only" 1333 (William Ottaway)