idnits 2.17.1 draft-dusse-smime-msg-06.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Cannot find the required boilerplate sections (Copyright, IPR, etc.) in this document. Expected boilerplate is as follows today (2024-03-28) according to https://trustee.ietf.org/license-info : IETF Trust Legal Provisions of 28-dec-2009, Section 6.a: This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 2: Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 3: This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. ** 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 1455 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.) ** There are 257 instances of too long lines in the document, the longest one being 4 characters in excess of 72. ** 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 99: '...draft, the terms MUST, MUST NOT, SHOUL...' RFC 2119 keyword, line 156: '...Receiving agents MUST support SHA-1 [SHA1] and MD5 [MD5]....' RFC 2119 keyword, line 158: '...Sending agents SHOULD use SHA-1....' RFC 2119 keyword, line 162: '...Receiving agents MUST support rsaEncryption, defined in [PKCS-1]. Receiving...' RFC 2119 keyword, line 163: '...agents MUST support verification of si...' (69 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 761 has weird spacing: '...gnature is "....' -- 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.) -- Couldn't find a document date in the document -- date freshness check skipped. -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. 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 1111 looks like a reference -- Missing reference section? 'PKCS-7' on line 1276 looks like a reference -- Missing reference section? 'PKCS-10' on line 1311 looks like a reference -- Missing reference section? 'MIME-SECURE' on line 1117 looks like a reference -- Missing reference section? 'PKCS-1' on line 1123 looks like a reference -- Missing reference section? 'MUSTSHOULD' on line 1120 looks like a reference -- Missing reference section? 'SHA1' on line 1135 looks like a reference -- Missing reference section? 'MD5' on line 1109 looks like a reference -- Missing reference section? 'RC2' on line 1132 looks like a reference -- Missing reference section? '3DES' on line 1097 looks like a reference -- Missing reference section? 'DES' on line 1106 looks like a reference -- Missing reference section? 'CHARSETS' on line 1100 looks like a reference -- Missing reference section? 'CONTDISP' on line 1103 looks like a reference Summary: 10 errors (**), 0 flaws (~~), 3 warnings (==), 16 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Internet Draft Steve Dusse, 2 draft-dusse-smime-msg-06.txt RSA Data Security 3 November 08, 1997 Paul Hoffman, 4 Expires in six months Internet Mail Consortium 5 Blake Ramsdell, 6 Worldtalk 7 Laurence Lundblade, 8 Qualcomm 9 Lisa Repka, 10 Netscape 12 S/MIME Message Specification 14 Status of this memo 16 This document is an Internet-Draft. Internet-Drafts are working documents 17 of the Internet Engineering Task Force (IETF), its areas, and its working 18 groups. Note that other groups may also distribute working documents as 19 Internet-Drafts. 21 Internet-Drafts are draft documents valid for a maximum of six months and 22 may be updated, replaced, or obsoleted by other documents at any time. It 23 is inappropriate to use Internet-Drafts as reference material or to cite 24 them other than as "work in progress." 26 To learn the current status of any Internet-Draft, please check the 27 "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow 28 Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), munnari.oz.au 29 (Pacific Rim), ds.internic.net (US East Coast), or ftp.isi.edu (US West 30 Coast). 32 1. Introduction 34 S/MIME (Secure/Multipurpose Internet Mail Extensions) provides a consistent 35 way to send and receive secure MIME data. Based on the popular Internet 36 MIME standard, S/MIME provides the following cryptographic security 37 services for electronic messaging applications: authentication, message 38 integrity and non-repudiation of origin (using digital signatures) and 39 privacy and data security (using encryption). 41 S/MIME can be used by traditional mail user agents (MUAs) to add 42 cryptographic security services to mail that is sent, and to interpret 43 cryptographic security services in mail that is received. However, S/MIME 44 is not restricted to mail; it can be used with any transport mechanism that 45 transports MIME data, such as HTTP. As such, S/MIME takes advantage of the 46 object-based features of MIME and allows secure messages to be exchanged in 47 mixed-transport systems. 49 Further, S/MIME can be used in automated message transfer agents that use 50 cryptographic security services that do not require any human intervention, 51 such as the signing of software-generated documents and the encryption of 52 FAX messages sent over the Internet. 54 1.1 Specification Overview 56 This document describes a protocol for adding cryptographic signature and 57 encryption services to MIME data. The MIME standard [MIME-SPEC] provides a 58 general structure for the content type of Internet messages and allows 59 extensions for new content type applications. 61 This draft defines how to create a MIME body part that has been 62 cryptographically enhanced according to PKCS #7 [PKCS-7]. This draft also 63 defines the application/pkcs7-mime MIME type that can be used to transport 64 those body parts. This draft also defines how to create certification 65 requests that conform to PKCS #10 [PKCS-10], and the application/pkcs10 66 MIME type for transporting those requests. 68 This draft also discusses how to use the multipart/signed MIME type defined 69 in [MIME-SECURE] to transport S/MIME signed messages. This draft also 70 defines the application/pkcs7-signature MIME type, which is also used to 71 transport S/MIME signed messages. This specification is compatible with 72 PKCS #7 in that it uses the data types defined by PKCS #7. 74 In order to create S/MIME messages, an agent has to follow specifications 75 in this draft, as well as some of the specifications listed in the 76 following documents: 77 - "PKCS #1: RSA Encryption", [PKCS-1] 78 - "PKCS #7: Cryptographic Message Syntax", [PKCS-7] 79 - "PKCS #10: Certification Request Syntax", [PKCS-10] 81 Throughout this draft, there are requirements and recommendations made for 82 how receiving agents handle incoming messages. There are separate 83 requirements and recommendations for how sending agents create outgoing 84 messages. In general, the best strategy is to "be liberal in what you 85 receive and conservative in what you send". Most of the requirements are 86 placed on the handling of incoming messages while the recommendations are 87 mostly on the creation of outgoing messages. 89 The separation for requirements on receiving agents and sending agents also 90 derives from the likelihood that there will be S/MIME systems that involve 91 software other than traditional Internet mail clients. S/MIME can be used 92 with any system that transports MIME data. An automated process that sends 93 an encrypted message might not be able to receive an encrypted message at 94 all, for example. Thus, the requirements and recommendations for the two 95 types of agents are listed separately when appropriate. 97 1.2 Terminology 99 Throughout this draft, the terms MUST, MUST NOT, SHOULD, and SHOULD NOT are 100 used in capital letters. This conforms to the definitions in [MUSTSHOULD]. 101 [MUSTSHOULD] defines the use of these key words to help make the intent of 102 standards track documents as clear as possible. The same key words are used 103 in this document to help implementors achieve interoperability. 105 1.3 Definitions 107 For the purposes of this draft, the following definitions apply. 109 ASN.1: Abstract Syntax Notation One, as defined in CCITT X.208. 111 BER: Basic Encoding Rules for ASN.1, as defined in CCITT X.209. 113 Certificate: A type that binds an entity's distinguished name to a public 114 key with a digital signature. 116 DER: Distinguished Encoding Rules for ASN.1, as defined in CCITT X.509. 118 7-bit data: Text data with lines less than 998 characters long, where none 119 of the characters have the 8th bit set, and there are no NULL characters. 120 and occur only as part of a end of line delimiter. 122 8-bit data: Text data with lines less than 998 characters, and where none 123 of the characters are NULL characters. and occur only as part of 124 a end of line delimiter. 126 Binary data: Arbitrary data. 128 Transfer Encoding: A reversible transformation made on data so 8-bit or 129 binary data may be sent via a channel that only transmits 7-bit data. 131 1.4 Compatibility with Prior Practice of S/MIME 133 Appendix C contains important information about how S/MIME agents following 134 this specification should act in order to have the greatest 135 interoperability with earlier implementations of S/MIME. 137 1.5 Discussion of This Draft 139 This draft is being discussed on the "ietf-smime" mailing list. 140 To subscribe, send a message to: 141 ietf-smime-request@imc.org 142 with the single word 143 subscribe 144 in the body of the message. There is a Web site for the mailing list 145 at . 147 2. PKCS #7 Options 149 The PKCS #7 message format allows for a wide variety of options in content 150 and algorithm support. This section puts forth a number of support 151 requirements and recommendations in order to achieve a base level of 152 interoperability among all S/MIME implementations. 154 2.1 DigestAlgorithmIdentifier 156 Receiving agents MUST support SHA-1 [SHA1] and MD5 [MD5]. 158 Sending agents SHOULD use SHA-1. 160 2.2 DigestEncryptionAlgorithmIdentifier 162 Receiving agents MUST support rsaEncryption, defined in [PKCS-1]. Receiving 163 agents MUST support verification of signatures using RSA public key sizes 164 from 512 bits to 1024 bits. 166 Sending agents MUST support rsaEncryption. Outgoing messages are signed 167 with a user's private key. The size of the private key is determined during 168 key generation. 170 2.3 KeyEncryptionAlgorithmIdentifier 172 Receiving agents MUST support rsaEncryption. Incoming encrypted messages 173 contain symmetric keys which are to be decrypted with a user's private key. 174 The size of the private key is determined during key generation. 176 Sending agents MUST support rsaEncryption. Sending agents MUST support 177 encryption of symmetric keys with RSA public keys at key sizes from 512 178 bits to 1024 bits. 180 2.4 General Syntax 182 The PKCS #7 defines six distinct content types: "data", "signedData", 183 "envelopedData", "signedAndEnvelopedData", "digestedData", and 184 "encryptedData". Receiving agents MUST support the "data", "signedData" and 185 "envelopedData" content types. Sending agents may or may not send out any 186 of the content types, depending on the services that the agent supports. 188 2.4.1 Data Content Type 190 Sending agents MUST use the "data" content type as the content within other 191 content types to indicate the message content which has had security 192 services applied to it. 194 2.4.2 SignedData Content Type 196 Sending agents MUST use the signedData content type to apply a digital 197 signature to a message or, in a degenerate case where there is no signature 198 information, to convey certificates. 200 2.4.3 EnvelopedData Content Type 202 This content type is used to apply privacy protection to a message. A 203 sender needs to have access to a public key for each intended message 204 recipient to use this service. This content type does not provide 205 authentication. 207 2.5 Attribute SignerInfo Type 209 The SignerInfo type allows the inclusion of unauthenticated and 210 authenticated attributes to be included along with a signature. 212 Receiving agents MUST be able to handle zero or one instance of each of the 213 signed attributes described in this section. 215 Sending agents SHOULD be able to generate one instance of each of the 216 signed attributes described in this section, and SHOULD include these 217 attributes in each signed message sent. 219 Additional attributes and values for these attributes may be defined in the 220 future. Receiving agents SHOULD handle attributes or values that it does 221 not recognize in a graceful manner. 223 2.5.1 Signing-Time Attribute 225 The signing-time attribute is used to convey the time that a message was 226 signed. Until there are trusted timestamping services, the time of signing 227 will most likely be created by a message originator and therefore is only 228 as trustworthy as the originator. 230 Sending agents MUST encode signing time through the year 2049 as UTCTime; 231 signing times in 2050 or later MUST be encoded as GeneralizedTime. Agents 232 MUST interpret the year field (YY) as follows: if YY is greater than or 233 equal to 50, the year is interpreted as 19YY; if YY is less than 50, the 234 year is interpreted as 20YY. 236 2.5.2 sMIMECapabilities Attribute 238 The sMIMECapabilities attribute includes signature algorithms (such as 239 "md5WithRSAEncryption"), symmetric algorithms (such as "DES-CBC"), and key 240 encipherment algorithms (such as "rsaEncryption"). It also includes a 241 non-algorithm capability which is the preference for signedData. The 242 sMIMECapabilities were designed to be flexible and extensible so that, in 243 the future, a means of identifying other capabilities and preferences such 244 as certificates can be added in a way that will not cause current clients 245 to break. 247 The semantics of the SMIMECapabilites attribute specify a partial list as 248 to what the client announcing the SMIMECapabilites can support. A client 249 does not have to list every capability it supports, and probably should not 250 list all its capabilities so that the capabilities list doesn't get too 251 long. In an sMIMECapabilities attribute, the OIDs are listed in order of 252 their preference, but SHOULD be logically separated along the lines of 253 their categories (signature algorithms, symmetric algorithms, key 254 encipherment algorithms, etc.) 256 The structure of the sMIMECapabilities attribute is to facilitate simple 257 table lookups and binary comparisons in order to determine matches. For 258 instance, the DER-encoding for the SMIMECapability for DES EDE3 CBC MUST be 259 identically encoded regardless of the implementation. 261 In the case of symmetric algorithms, the associated parameters for the OID 262 MUST specify all of the parameters necessary to differentiate between two 263 instances of the same algorithm. For instance, the number of rounds and 264 block size for RC5 must be specified in addition to the key length. 266 There is a list of OIDs (the registered sMIMECapabilities list) that is 267 centrally maintained and is separate from this draft. The list of OIDs is 268 maintained by the Internet Mail Consortium at 269 . 271 The OIDs that correspond to algorithms SHOULD use the same OID as the 272 actual algorithm, except in the case where the algorithm usage is ambiguous 273 from the OID. For instance, in an earlier draft, rsaEncryption was 274 ambiguous because it could refer to either a signature algorithm or a key 275 encipherment algorithm. In the event that an OID is ambiguous, it needs to 276 be arbitrated by the maintainer of the registered sMIMECapabilities list as 277 to which type of algorithm will use the OID, and a new OID MUST be 278 allocated under the sMIMECapabilities OID to satisfy the other use of the 279 OID. 281 The registered sMIMECapabilities list specifies the parameters for OIDs 282 that need them, most notably key lengths in the case of variable-length 283 symmetric ciphers. In the event that there are no differentiating 284 parameters for a particular OID, the parameters MUST be omitted, and MUST 285 NOT be encoded as NULL. 287 Additional values for the sMIMECapabilities attribute may be defined in the 288 future. Receiving agents MUST handle a sMIMECapabilities object that has 289 values that it does not recognize in a graceful manner. 291 2.6 ContentEncryptionAlgorithmIdentifier 293 Receiving agents MUST support decryption using the RC2 [RC2] or a 294 compatible algorithm at a key size of 40 bits, hereinafter called "RC2/40". 295 Receiving agents SHOULD support decryption using DES EDE3 CBC, hereinafter 296 called "tripleDES" [3DES] [DES]. 298 Sending agents SHOULD support encryption with RC2/40 and tripleDES. 300 2.6.1 Deciding Which Encryption Method To Use 302 When a sending agent creates an encrypted message, it has to decide which 303 type of encryption to use. The decision process involves using information 304 garnered from the capabilities lists included in messages received from the 305 recipient, as well as out-of-band information such as private agreements, 306 user preferences, legal restrictions, and so on. 308 Section 2.5 defines a method by which a sending agent can optionally 309 announce, among other things, its decrypting capabilities in its order of 310 preference. The following method for processing and remembering the 311 encryption capabilities attribute in incoming signed messages SHOULD be 312 used. 314 - If the receiving agent has not yet created a list of capabilities 315 for the sender's public key, then, after verifying the signature 316 on the incoming message and checking the timestamp, the receiving 317 agent SHOULD create a new list containing at least the signing 318 time and the symmetric capabilities. 320 - If such a list already exists, the receiving agent SHOULD verify 321 that the signing time in the incoming message is greater than 322 the signing time stored in the list and that the signature is 323 valid. If so, the receiving agent SHOULD update both the signing 324 time and capabilities in the list. Values of the signing time that 325 lie far in the future (that is, a greater discrepancy than any 326 reasonable clock skew), or a capabilitie lists in messages whose 327 signature could not be verified, MUST NOT be accepted. 329 The list of capabilities SHOULD be stored for future use in creating 330 messages. 332 Before sending a message, the sending agent MUST decide whether it is 333 willing to use weak encryption for the particular data in the message. If 334 the sending agent decides that weak encryption is unacceptable for this 335 data, then the sending agent MUST NOT use a weak algorithm such as RC2/40. 336 The decision to use or not use weak encryption overrides any other decision 337 in this section about which encryption algorithm to use. 339 Sections 2.6.2.1 through 2.6.2.4 describe the decisions a sending agent 340 SHOULD use in deciding which type of encryption should be applied to a 341 message. These rules are ordered, so the sending agent SHOULD make its 342 decision in the order given. 344 2.6.2.1 Rule 1: Known Capabilities 346 If the sending agent has received a set of capabilities from the recipient 347 for the message the agent is about to encrypt, then the sending agent 348 SHOULD use that information by selecting the first capability in the list 349 (that is, the capability most preferred by the intended recipient) for 350 which the sending agent knows how to encrypt. The sending agent SHOULD use 351 one of the capabilities in the list if the agent reasonably expects the 352 recipient to be able to decrypt the message. 354 2.6.2.2 Rule 2: Unknown Capabilities, Known Use of Encryption 356 If: 357 - the sending agent has no knowledge of the encryption capabilities 358 of the recipient, 359 - and the sending agent has received at least one message from the 360 recipient, 361 - and the last encrypted message received from the recipient had a 362 trusted signature on it, 363 then the outgoing message SHOULD use the same encryption algorithm as was 364 used on the last signed and encrypted message received from the recipient. 366 2.6.2.3 Rule 3: Unknown Capabilities, Risk of Failed Decryption 368 If: 369 - the sending agent has no knowledge of the encryption capabilities 370 of the recipient, 371 - and the sending agent is willing to risk that the recipient may 372 not be able to decrypt the message, 373 then the sending agent SHOULD use tripleDES. 375 2.6.2.4 Rule 4: Unknown Capabilities, No Risk of Failed Decryption 377 If: 378 - the sending agent has no knowledge of the encryption capabilities 379 of the recipient, 380 - and the sending agent is not willing to risk that the recipient 381 may not be able to decrypt the message, 382 then the sending agent MUST use RC2/40. 384 2.6.3 Choosing Weak Encryption 386 Like all algorithms that use 40 bit keys, RC2/40 is considered by many to 387 be weak encryption. A sending agent that is controlled by a human SHOULD 388 allow a human sender to determine the risks of sending data using RC2/40 or 389 a similarly weak encryption algorithm before sending the data, and possibly 390 allow the human to use a stronger encryption method such as tripleDES. 392 2.6.4 Multiple Recipients 394 If a sending agent is composing an encrypted message to a group of 395 recipients where the encryption capabilities of some of the recipients do 396 not overlap, the sending agent is forced to send more than one message. It 397 should be noted that if the sending agent chooses to send a message 398 encrypted with a strong algorithm, and then send the same message encrypted 399 with a weak algorithm, someone watching the communications channel can 400 decipher the contents of the strongly-encrypted message simply by 401 decrypting the weakly-encrypted message. 403 3. Creating S/MIME Messages 405 This section describes the S/MIME message formats and how they are created. 406 S/MIME messages are a combination of MIME bodies and PKCS objects. Several 407 MIME types as well as several PKCS objects are used. The data to be secured 408 is always a canonical MIME entity. The MIME entity and other data, such as 409 certificates and algorithm identifiers, are given to PKCS processing 410 facilities which produces a PKCS object. The PKCS object is then finally 411 wrapped in MIME. 413 S/MIME provides one format for enveloped-only data, several formats for 414 signed-only data, and several formats for signed and enveloped data. 415 Several formats are required to accommodate several environments, in 416 particular for signed messages. The criteria for choosing among these 417 formats are also described. 419 The reader of this section is expected to understand MIME as described in 420 [MIME-SPEC] and [MIME-SECURE]. 422 3.1 Preparing the MIME Entity for Signing or Enveloping 424 S/MIME is used to secure MIME entities. A MIME entity may be a sub-part, 425 sub-parts of a message, or the whole message with all its sub-parts. A MIME 426 entity that is the whole message includes only the MIME headers and MIME 427 body, and does not include the RFC-822 headers. Note that S/MIME can also 428 be used to secure MIME entities used in applications other than Internet 429 mail. 431 The MIME entity that is secured and described in this section can be 432 thought of as the "inside" MIME entity. That is, it is the "innermost" 433 object in what is possibly a larger MIME message. Processing "outside" MIME 434 entities into PKCS #7 objects is described in Section 3.2, 3.4 and 435 elsewhere. 437 The procedure for preparing a MIME entity is given in [MIME-SPEC]. The same 438 procedure is used here with some additional restrictions when signing. 439 Description of the procedures from [MIME-SPEC] are repeated here, but the 440 reader should refer to that document for the exact procedure. This section 441 also describes additional requirements. 443 A single procedure is used for creating MIME entities that are to be 444 signed, enveloped, or both signed and enveloped. Some additional steps are 445 recommended to defend against known corruptions that can occur during mail 446 transport that are of particular importance for clear-signing using the 447 multipart/signed format. It is recommended that these additional steps be 448 performed on enveloped messages, or signed and enveloped messages in order 449 that the message can be forwarded to any environment without modification. 451 These steps are descriptive rather than prescriptive. The implementor is 452 free to use any procedure as long as the result is the same. 454 Step 1. The MIME entity is prepared according to the local 455 conventions 457 Step 2. The leaf parts of the MIME entity are converted to canonical 458 form 460 Step 3. Appropriate transfer encoding is applied to the leaves of 461 the MIME entity 463 When an S/MIME message is received, the security services on the message 464 are removed, and the result is the MIME entity. That MIME entity is 465 typically passed to a MIME-capable user agent where, it is further decoded 466 and presented to the user or receiving application. 468 3.1.1 Canonicalization 470 Each MIME entity MUST be converted to a canonical form that is uniquely and 471 unambiguously representable in the environment where the signature is 472 created and the environment where the signature will be verified. MIME 473 entities MUST be canonicalized for enveloping as well as signing. 475 The exact details of canonicalization depend on the actual MIME type and 476 subtype of an entity, and are not described here. Instead, the standard for 477 the particular MIME type should be consulted. For example, canonicalization 478 of type text/plain is different from canonicalization of audio/basic. Other 479 than text types, most types have only one representation regardless of 480 computing platform or environment which can be considered their canonical 481 representation. In general, canonicalization will be performed by the 482 sending agent rather than the S/MIME implementation. 484 The most common and important canonicalization is for text, which is often 485 represented differently in different environments. MIME entities of major 486 type "text" must have both their line endings and character set 487 canonicalized. The line ending must be the pair of characters , and 488 the charset should be a registered charset [CHARSETS]. The details of the 489 canonicalization are specified in [MIME-SPEC]. The chosen charset SHOULD be 490 named in the charset parameter so that the receiving agent can 491 unambiguously determine the charset used. 493 Note that some charsets such as ISO-2022 have multiple representations for 494 the same characters. When preparing such text for signing, the canonical 495 representation specified for the charset MUST be used. 497 3.1.2 Transfer Encoding 499 When generating any of the secured MIME entities below, except the signing 500 using the multipart/signed format, no transfer encoding at all is required. 501 S/MIME implementations MUST be able to deal with binary MIME objects. If no 502 Content-Transfer-Encoding header is present, the transfer encoding should 503 be considered 7BIT. 505 S/MIME implementations SHOULD however use transfer encoding described in 506 section 3.1.3 for all MIME entities they secure. The reason for securing 507 only 7-bit MIME entities, even for enveloped data that are not exposed to 508 the transport, is that it allows the MIME entity to be handled in any 509 environment without changing it. For example, a trusted gateway might 510 remove the envelope, but not the signature, of a message, and then forward 511 the signed message on to the end recipient so that they can verify the 512 signatures directly. If the transport internal to the site is not 8-bit 513 clean, such as on a wide-area network with a single mail gateway, verifying 514 the signature will not be possible unless the original MIME entity was only 515 7-bit data. 517 3.1.3 Transfer Encoding for Signing Using multipart/signed 519 If a multipart/signed entity is EVER to be transmitted over the standard 520 Internet SMTP infrastructure or other transport that is constrained to 521 7-bit text, it MUST have transfer encoding applied so that it is 522 represented as 7-bit text. MIME entities that are 7-bit data already need 523 no transfer encoding. Entities such as 8-bit text and binary data can be 524 encoded with quoted-printable or base-64 transfer encoding. 526 The primary reason for the 7-bit requirement is that the Internet mail 527 transport infrastructure cannot guarantee transport of 8-bit or binary 528 data. Even though many segments of the transport infrastructure now handle 529 8-bit and even binary data, it is sometimes not possible to know whether 530 the transport path is 8-bit clear. If a mail message with 8-bit data were 531 to encounter a message transfer agent that can not transmit 8-bit or binary 532 data, the agent has three options, none of which are acceptable for a 533 clear-signed message: 534 - The agent could change the transfer encoding; this would 535 invalidate the signature. 536 - The agent could transmit the data anyway, which would most likely 537 result in the 8th bit being corrupted; this too would invalidate 538 the signature. 539 - The agent could return the message to the sender. 541 [MIME-SECURE] prohibits an agent from changing the transfer encoding of the 542 first part of a multipart/signed message. If a compliant agent that can not 543 transmit 8-bit or binary data encounters a multipart/signed message with 544 8-bit or binary data in the first part, it would have to return the message 545 to the sender as undeliverable. 547 3.1.4 Sample Canonical MIME Entity 549 This example shows a multipart/mixed message with full transfer encoding. 550 This message contains a text part and an attachment. The sample message 551 text includes characters that are not US-ASCII and thus must be transfer 552 encoded. Though not shown here, the end of each line is . The line 553 ending of the MIME headers, the text, and transfer encoded parts, all must 554 be . 556 Note that this example is not of an S/MIME message. 558 Content-Type: multipart/mixed; boundary=bar 560 --bar 561 Content-Type: text/plain; charset=iso-8859-1 562 Content-Transfer-Encoding: quoted-printable 564 =A1Hola Michael! 566 How do you like the new S/MIME specification? 568 I agree. It's generally a good idea to encode lines that begin with 569 From=20because some mail transport agents will insert a greater- 570 than (>) sign, thus invalidating the signature. 572 Also, in some cases it might be desirable to encode any =20 573 trailing whitespace that occurs on lines in order to ensure =20 574 that the message signature is not invalidated when passing =20 575 a gateway that modifies such whitespace (like BITNET). =20 577 --bar 578 Content-Type: image/jpeg 579 Content-Transfer-Encoding: base64 581 iQCVAwUBMJrRF2N9oWBghPDJAQE9UQQAtl7LuRVndBjrk4EqYBIb3h5QXIX/LC// 582 jJV5bNvkZIGPIcEmI5iFd9boEgvpirHtIREEqLQRkYNoBActFBZmh9GC3C041WGq 583 uMbrbxc+nIs1TIKlA08rVi9ig/2Yh7LFrK5Ein57U/W72vgSxLhe/zhdfolT9Brn 584 HOxEa44b+EI= 586 --bar-- 588 3.2 The application/pkcs7-mime Type 590 The application/pkcs7-mime type is used to carry PKCS #7 objects of several 591 types including envelopedData and signedData. The details of constructing 592 these entities is described in subsequent sections. This section describes 593 the general characteristics of the application/pkcs7-mime type. 595 This MIME type always carries a single PKCS #7 object. The PKCS #7 object 596 must always be BER encoding of the ASN.1 syntax describing the object. The 597 contentInfo field of the carried PKCS #7 object always contains a MIME 598 entity that is prepared as described in section 3.1. The contentInfo field 599 must never be empty. 601 Since PKCS #7 objects are binary data, in most cases base-64 transfer 602 encoding is appropriate, in particular when used with SMTP transport. The 603 transfer encoding used depends on the transport through which the object is 604 to be sent, and is not a characteristic of the MIME type. 606 Note that this discussion refers to the transfer encoding of the PKCS #7 607 object or "outside" MIME entity. It is completely distinct from, and 608 unrelated to, the transfer encoding of the MIME entity secured by the PKCS 609 #7 object, the "inside" object, which is described in section 3.1. 611 Because there are several types of application/pkcs7-mime objects, a 612 sending agent SHOULD do as much as possible to help a receiving agent know 613 about the contents of the object without forcing the receiving agent to 614 decode the ASN.1 for the object. The MIME headers of all 615 application/pkcs7-mime objects SHOULD include the optional "smime-type" 616 parameter, as described in the following sections. 618 3.2.1 The name and filename Parameters 620 For the application/pkcs7-mime, sending agents SHOULD emit the optional 621 "name" parameter to the Content-Type field for compatibility with older 622 systems. Sending agents SHOULD also emit the optional Content-Disposition 623 field [CONTDISP] with the "filename" parameter. If a sending agent emits 624 the above parameters, the value of the parameters SHOULD be a file name 625 with the appropriate extension: 627 MIME Type File Extension 629 application/pkcs7-mime .p7m 630 (signedData, envelopedData) 632 application/pkcs7-mime .p7c 633 (degenerate signedData 634 "certs-only" message) 636 application/pkcs7-signature .p7s 638 application/pkcs10 .p10 640 In addition, the file name SHOULD be limited to eight characters followed 641 by a three letter extension. The eight character filename base can be any 642 distinct name; the use of the filename base "smime" SHOULD be used to 643 indicate that the MIME entity is associated with S/MIME. 645 Including a file name serves two purposes. It facilitates easier use of 646 S/MIME objects as files on disk. It also can convey type information across 647 gateways. When a MIME entity of type application/pkcs7-mime (for example) 648 arrives at a gateway that has no special knowledge of S/MIME, it will 649 default the entity's MIME type to application/octet-stream and treat it as 650 a generic attachment, thus losing the type information. However, the 651 suggested filename for an attachment is often carried across a gateway. 652 This often allows the receiving systems to determine the appropriate 653 application to hand the attachment off to, in this case a stand-alone 654 S/MIME processing application. Note that this mechanism is provided as a 655 convenience for implementations in certain environments. A proper S/MIME 656 implementation MUST use the MIME types and MUST NOT rely on the file 657 extensions. 659 3.3 Creating an Enveloped-only Message 661 This section describes the format for enveloping a MIME entity without 662 signing it. 664 Step 1. The MIME entity to be enveloped is prepared according to 665 section 3.1. 667 Step 2. The MIME entity and other required data is processed into a 668 PKCS #7 object of type envelopedData. 670 Step 3. The PKCS #7 object is inserted into an application/pkcs7-mime 671 MIME entity. 673 The smime-type parameter for enveloped-only messages is "enveloped-data". 674 The file extension for this type of message is ".p7m". 676 A sample message would be: 678 Content-Type: application/pkcs7-mime; smime-type=enveloped-data; 679 name=smime.p7m 680 Content-Transfer-Encoding: base64 681 Content-Disposition: attachment; filename=smime.p7m 683 rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6 684 7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H 685 f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 686 0GhIGfHfQbnj756YT64V 688 3.4 Creating a Signed-only Message 690 There are two formats for signed messages defined for S/MIME: 691 application/pkcs7-mime and SignedData, and multipart/signed. In general, 692 the multipart/signed form is preferred for sending, and receiving agents 693 SHOULD be able to handle both. 695 3.4.1 Choosing a Format for Signed-only Messages 697 There are no hard-and-fast rules when a particular signed-only format 698 should be chosen because it depends on the capabilities of all the 699 receivers and the relative importance of receivers with S/MIME facilities 700 being able to verify the signature versus the importance of receivers 701 without S/MIME software being able to view the message. 703 Messages signed using the multipart/signed format can always be viewed by 704 the receiver whether they have S/MIME software or not. They can also be 705 viewed whether they are using a MIME-native user agent or they have 706 messages translated by a gateway. In this context, "be viewed" means the 707 ability to process the message essentially as if it were not a signed 708 message, including any other MIME structure the message might have. 710 Messages signed using the signedData format cannot be viewed by a recipient 711 unless they have S/MIME facilities. However, if they have S/MIME 712 facilities, these messages can always be verified if they were not changed 713 in transit. 715 3.4.2 Signing Using application/pkcs7-mime and SignedData 717 This signing format uses the application/pkcs7-mime MIME type. The steps to 718 create this format are: 720 Step 1. The MIME entity is prepared according to section 3.1 722 Step 2. The MIME entity and other required data is processed into a 723 PKCS #7 object of type signedData 725 Step 3. The PKCS #7 object is inserted into an 726 application/pkcs7-mime MIME entity 728 The smime-type parameter for messages using application/pkcs7-mime and 729 SignedData is "signed-data". The file extension for this type of message is 730 ".p7m". 732 A sample message would be: 734 Content-Type: application/pkcs7-mime; smime-type=signed-data; 735 name=smime.p7m 736 Content-Transfer-Encoding: base64 737 Content-Disposition: attachment; filename=smime.p7m 739 567GhIGfHfYT6ghyHhHUujpfyF4f8HHGTrfvhJhjH776tbB9HG4VQbnj7 740 77n8HHGT9HG4VQpfyF467GhIGfHfYT6rfvbnj756tbBghyHhHUujhJhjH 741 HUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H7n8HHGghyHh 742 6YT64V0GhIGfHfQbnj75 744 3.4.3 Signing Using the multipart/signed Format 746 This format is a clear-signing format. Recipients without any S/MIME or 747 PKCS processing facilities are able to view the message. It makes use of 748 the multipart/signed MIME type described in [MIME-SECURE]. The 749 multipart/signed MIME type has two parts. The first part contains the MIME 750 entity that is to be signed; the second part contains the signature, which 751 is a PKCS #7 detached signature. 753 3.4.3.1 The application/pkcs7-signature MIME Type 755 This MIME type always contains a single PKCS #7 object of type signedData. 756 The contentInfo field of the PKCS #7 object must be empty. The signerInfos 757 field contains the signatures for the MIME entity. The details of the 758 registered type are given in Appendix E. 760 The file extension for signed-only messages using 761 application/pkcs7-signature is ".p7s". 763 3.4.3.2 Creating a multipart/signed Message 765 Step 1. The MIME entity to be signed is prepared according to 766 section 3.1, taking special care for clear-signing. 768 Step 2. The MIME entity is presented to PKCS #7 processing in order 769 to obtain an object of type signedData with an empty 770 contentInfo field. 772 Step 3. The MIME entity is inserted into the first part of a 773 multipart/signed message with no processing other than 774 that described in section 3.1. 776 Step 4. Transfer encoding is applied to the detached signature and 777 it is inserted into a MIME entity of type 778 application/pkcs7-signature 780 Step 5. The MIME entity of the application/pkcs7-signature is 781 inserted into the second part of the multipart/signed entity 783 The multipart/signed Content type has two required parameters: the protocol 784 parameter and the micalg parameter. 786 The protocol parameter MUST be "application/pkcs7-signature". Note that 787 quotation marks are required around the protocol parameter because MIME 788 requires that the "/" character in the parameter value MUST be quoted. 790 The micalg parameter allows for one-pass processing when the signature is 791 being verified. The value of the micalg parameter is dependent on the 792 message digest algorithm used in the calculation of the Message Integrity 793 Check. The value of the micalg parameter SHOULD be one of the following: 795 Algorithm used Value 796 -------------- --------- 797 MD5 md5 798 SHA-1 sha1 799 any other unknown 801 (Historical note: some early implementations of S/MIME emitted and expected 802 "rsa-md5" and "rsa-sha1" for the micalg parameter.) Receiving agents SHOULD 803 be able to recover gracefully from a micalg parameter value that they do 804 not recognize. 806 3.4.3.3 Sample multipart/signed Message 808 Content-Type: multipart/signed; 809 protocol="application/pkcs7-signature"; 810 micalg=sha1; boundary=boundary42 812 --boundary42 813 Content-Type: text/plain 815 This is a clear-signed message. 817 --boundary42 818 Content-Type: application/pkcs7-signature; name=smime.p7s 819 Content-Transfer-Encoding: base64 820 Content-Disposition: attachment; filename=smime.p7s 822 ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6 823 4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj 824 n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 825 7GhIGfHfYT64VQbnj756 827 --boundary42-- 829 3.5 Signing and Encrypting 831 To achieve signing and enveloping, any of the signed-only and 832 encrypted-only formats may be nested. This is allowed because the above 833 formats are all MIME entities, and because they all secure MIME entities. 835 An S/MIME implementation MUST be able to receive and process arbitrarily 836 nested S/MIME within reasonable resource limits of the recipient computer. 838 It is possible to either sign a message first, or to envelope the message 839 first. It is up to the implementor and the user to choose. When signing 840 first, the signatories are then securely obscured by the enveloping. When 841 enveloping first the signatories are exposed, but it is possible to verify 842 signatures without removing the enveloping. This may be useful in an 843 environment were automatic signature verification is desired, as no private 844 key material is required to verify a signature. 846 3.6 Creating a Certificates-only Message 848 The certificates only message or MIME entity is used to transport 849 certificates, such as in response to a registration request. This format 850 can also be used to convey CRLs. 852 Step 1. The certificates are made available to the PKCS #7 generating 853 process which creates a PKCS #7 object of type signedData. 854 The contentInfo and signerInfos fields must be empty. 856 Step 2. The PKCS #7 signedData object is enclosed in an 857 application/pkcs7-mime MIME entity 859 The smime-type parameter for a certs-only message is "certs-only". The file 860 extension for this type of message is ".p7c". 862 3.7 Creating a Registration Request 864 A typical application which allows a user to generate cryptographic 865 information has to submit that information to a certification authority, 866 who transforms it into a certificate. PKCS #10 describes a syntax for 867 certification requests. The application/pkcs10 body type MUST be used to 868 transfer a PKCS #10 certification request. 870 The details of certification requests and the process of obtaining a 871 certificate are beyond the scope of this draft. Instead, only the format of 872 data used in application/pkcs10 is defined. 874 3.7.1 Format of the application/pkcs10 Body 876 PKCS #10 defines the ASN.1 type CertificationRequest for use in submitting 877 a certification request. Therefore, when the MIME content type 878 application/pkcs10 is used, the body MUST be a CertificationRequest, 879 encoded using the Basic Encoding Rules (BER). 881 Although BER is specified, instead of the more restrictive DER, a typical 882 application will use DER since the CertificationRequest's 883 CertificationRequestInfo has to be DER-encoded in order to be signed. A 884 robust application SHOULD output DER, but allow BER or DER on input. 886 Data produced by BER or DER is 8-bit, but many transports are limited to 887 7-bit data. Therefore, a suitable 7-bit Content-Transfer-Encoding SHOULD be 888 applied. The base64 Content-Transfer-Encoding SHOULD be used with 889 application/pkcs10, although any 7-bit transfer encoding may work. 891 3.7.2 Sending and Receiving an application/pkcs10 Body Part 893 For sending a certificate-signing request, the application/pkcs10 message 894 format MUST be used to convey a PKCS #10 certificate-signing request. Note 895 that for sending certificates and CRLs messages without any signed content, 896 the application/pkcs7-mime message format MUST be used to convey a 897 degenerate PKCS #7 signedData "certs-only" message. 899 To send an application/pkcs10 body, the application generates the 900 cryptographic information for the user. The details of the cryptographic 901 information are beyond the scope of this draft. 903 Step 1. The cryptographic information is placed within a PKCS #10 904 CertificationRequest. 906 Step 2. The CertificationRequest is encoded according to BER or DER 907 (typically, DER). 909 Step 3. As a typical step, the DER-encoded CertificationRequest is 910 also base64 encoded so that it is 7-bit data suitable for 911 transfer in SMTP. This then becomes the body of an 912 application/pkcs10 body part. 914 The result might look like this: 916 Content-Type: application/pkcs10; name=smime.p10 917 Content-Transfer-Encoding: base64 918 Content-Disposition: attachment; filename=smime.p10 920 rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6 921 7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H 922 f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 923 0GhIGfHfQbnj756YT64V 925 A typical application only needs to send a certification request. It is a 926 certification authority that has to receive and process the request. The 927 steps for recovering the CertificationRequest from the message are 928 straightforward but are not presented here. The procedures for processing 929 the certification request are beyond the scope of this document. 931 3.8 Identifying an S/MIME Message 933 Because S/MIME takes into account interoperation in non-MIME environments, 934 several different mechanisms are employed to carry the type information, 935 and it becomes a bit difficult to identify S/MIME messages. The following 936 table lists criteria for determining whether or not a message is an S/MIME 937 message. A message is considered an S/MIME message if it matches any below. 939 The file suffix in the table below comes from the "name" parameter in the 940 content-type header, or the "filename" parameter on the content-disposition 941 header. These parameters that give the file suffix are not listed below as 942 part of the parameter section. 944 MIME type: application/pkcs7-mime 945 parameters: any 946 file suffix: any 948 MIME type: application/pkcs10 949 parameters: any 950 file suffix: any 952 MIME type: multipart/signed 953 parameters: protocol="application/pkcs7-signature" 954 file suffix: any 956 MIME type: application/octet-stream 957 parameters: any 958 file suffix: p7m, p7s, aps, p7c, p10 960 4. Certificate Processing 962 A receiving agent MUST provide some certificate retrieval mechanism in 963 order to gain access to certificates for recipients of digital envelopes. 964 This draft does not cover how S/MIME agents handle certificates, only what 965 they do after a certificate has been validated or rejected. S/MIME 966 certification issues are covered in a different document. 968 At a minimum, for initial S/MIME deployment, a user agent could 969 automatically generate a message to an intended recipient requesting that 970 recipient's certificate in a signed return message. Receiving and sending 971 agents SHOULD also provide a mechanism to allow a user to "store and 972 protect" certificates for correspondents in such a way so as to guarantee 973 their later retrieval. 975 4.1 Key Pair Generation 977 An S/MIME agent or some related administrative utility or function MUST be 978 capable of generating RSA key pairs on behalf of the user. Each key pair 979 MUST be generated from a good source of non-deterministic random input and 980 protected in a secure fashion. 982 A user agent SHOULD generate RSA key pairs at a minimum key size of 768 983 bits and a maximum key size of 1024 bits. A user agent MUST NOT generate 984 RSA key pairs less than 512 bits long. Some agents created in the United 985 States have chosen to create 512 bit keys in order to get more advantageous 986 export licenses. However, 512 bit keys are considered by many to be 987 cryptographically insecure. 989 Implementors should be aware that multiple (active) key pairs may be 990 associated with a single individual. For example, one key pair may be used 991 to support confidentiality, while a different key pair may be used for 992 authentication. 994 5. Security Considerations 996 This entire draft discusses security. Security issues not covered in other 997 parts of the draft include: 999 40-bit encryption is considered weak by most cryptographers. Using weak 1000 cryptography in S/MIME offers little actual security over sending 1001 plaintext. However, other features of S/MIME, such as the specification of 1002 tripleDES and the ability to announce stronger cryptographic capabilities 1003 to parties with whom you communicate, allow senders to create messages that 1004 use strong encryption. Using weak cryptography is never recommended unless 1005 the only alternative is no cryptography. When feasible, sending and 1006 receiving agents should inform senders and recipients the relative 1007 cryptographic strength of messages. 1009 It is impossible for most software or people to estimate the value of a 1010 message. Further, it is impossible for most software or people to estimate 1011 the actual cost of decrypting a message that is encrypted with a key of a 1012 particular size. Further, it is quite difficult to determine the cost of a 1013 failed decryption if a recipient cannot decode a message. Thus, choosing 1014 between different key sizes (or choosing whether to just use plaintext) is 1015 also impossible. However, decisions based on these criteria are made all 1016 the time, and therefore this draft gives a framework for using those 1017 estimates in choosing algorithms. 1019 If a sending agent is sending the same message using different strengths of 1020 cryptography, an attacker watching the communications channel can determine 1021 the contents of the strongly-encrypted message by decrypting the 1022 weakly-encrypted version. In other words, a sender should not send a copy 1023 of a message using weaker cryptography than they would use for the original 1024 of the message. 1026 A. Object Identifiers and Syntax 1028 The syntax for SMIMECapability is: 1030 SMIMECapability ::= SEQUENCE { 1031 capabilityID OBJECT IDENTIFIER, 1032 parameters OPTIONAL ANY DEFINED BY capabilityID } 1034 sMIMECapabilities ::= SEQUENCE OF SMIMECapability 1036 A.1 Content Encryption Algorithms 1038 RC2-CBC OBJECT IDENTIFIER ::= 1039 {iso(1) member-body(2) us(840) rsadsi(113549) encryptionAlgorithm(3) 2} 1041 For the effective-key-bits (key size) greater than 32 and less than 1042 256, the RC2-CBC algorithm parameters are encoded as: 1044 RC2-CBC parameter ::= SEQUENCE { 1045 rc2ParameterVersion INTEGER, 1046 iv OCTET STRING (8)} 1048 For the effective-key-bits of 40, 64, and 128, the 1049 rc2ParameterVersion values are 160, 120, 58 respectively. 1051 DES-EDE3-CBC OBJECT IDENTIFIER ::= 1052 {iso(1) member-body(2) us(840) rsadsi(113549) encryptionAlgorithm(3) 7} 1054 For DES-CBC and DES-EDE3-CBC, the parameter should be encoded as: 1056 CBCParameter :: IV 1058 where IV ::= OCTET STRING -- 8 octets. 1060 A.2 Digest Algorithms 1062 md5 OBJECT IDENTIFIER ::= 1063 {iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 5} 1065 sha-1 OBJECT IDENTIFIER ::= 1066 {iso(1) identified-organization(3) oiw(14) secsig(3) algorithm(2) 26} 1068 A.3 Asymmetric Encryption Algorithms 1070 rsaEncryption OBJECT IDENTIFIER ::= 1071 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1} 1073 rsa OBJECT IDENTIFIER ::= 1074 {joint-iso-ccitt(2) ds(5) algorithm(8) encryptionAlgorithm(1) 1} 1076 A.4 Signature Algorithms 1078 md2WithRSAEncryption OBJECT IDENTIFIER ::= 1079 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 2} 1081 md5WithRSAEncryption OBJECT IDENTIFIER ::= 1082 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 4} 1084 sha-1WithRSAEncryption OBJECT IDENTIFIER ::= 1085 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 5} 1087 A.5 Signed Attributes 1089 signingTime OBJECT IDENTIFIER ::= 1090 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 5} 1092 sMIMECapabilities OBJECT IDENTIFIER ::= 1093 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 15} 1095 B. References 1097 [3DES] W. Tuchman, "Hellman Presents No Shortcut Solutions To DES," IEEE 1098 Spectrum, v. 16, n. 7, July 1979, pp40-41. 1100 [CHARSETS] Character sets assigned by IANA. See 1101 . 1103 [CONTDISP] "Communicating Presentation Information in Internet Messages: 1104 The Content-Disposition Header Field", RFC 2183 1106 [DES] ANSI X3.106, "American National Standard for Information Systems-Data 1107 Link Encryption," American National Standards Institute, 1983. 1109 [MD5] "The MD5 Message Digest Algorithm", RFC 1321 1111 [MIME-SPEC] The primary definition of MIME. "MIME Part 1: Format of 1112 Internet Message Bodies", RFC 2045; "MIME Part 2: Media Types", RFC 2046; 1113 "MIME Part 3: Message Header Extensions for Non-ASCII Text", RFC 2047; 1114 "MIME Part 4: Registration Procedures", RFC 2048; "MIME Part 5: Conformance 1115 Criteria and Examples", RFC 2049 1117 [MIME-SECURE] "Security Multiparts for MIME: Multipart/Signed and 1118 Multipart/Encrypted", RFC 1847 1120 [MUSTSHOULD] "Key words for use in RFCs to Indicate Requirement Levels", 1121 RFC 2119 1123 [PKCS-1] "PKCS #1: RSA Encryption", Internet Draft 1124 draft-hoffman-pkcs-rsa-encrypt 1126 [PKCS-7] "PKCS #7: Cryptographic Message Syntax", Internet Draft 1127 draft-hoffman-pkcs-crypt-msg 1129 [PKCS-10] "PKCS #10: Certification Request Syntax", Internet Draft 1130 draft-hoffman-pkcs-certif-req 1132 [RC2] "Description of the RC2 Encryption Algorithm", Internet Draft 1133 draft-rivest-rc2desc 1135 [SHA1] NIST FIPS PUB 180-1, "Secure Hash Standard," National Institute of 1136 Standards and Technology, U.S. Department of Commerce, DRAFT, 31 May 1994. 1138 C. Compatibility with Prior Practice in S/MIME 1140 S/MIME was originally developed by RSA Data Security, Inc. Many developers 1141 implemented S/MIME agents before this document was published. All S/MIME 1142 receiving agents SHOULD make every attempt to interoperate with these 1143 earlier implementations of S/MIME. 1145 C.1 Early MIME Types 1147 Some early implementations of S/MIME agents used the following MIME types: 1149 application/x-pkcs7-mime 1150 application/x-pkcs7-signature 1151 application/x-pkcs10 1153 In each case, the "x-" subtypes correspond to the subtypes described in 1154 this document without the "x-". 1156 C.2 Profiles 1158 Early S/MIME documentation had two profiles for encryption: "restricted" 1159 and "unrestricted". The difference between these profiles historically came 1160 about due to US Government export regulations, as described at the end of 1161 this section. It is expected that in the future, there will be few agents 1162 that only use the restricted profile. 1164 Briefly, the restricted profile required the ability to encrypt and decrypt 1165 using RSA's trade-secret RC2 algorithm in CBC mode with 40-bit keys. The 1166 unrestricted profile required the ability to encrypt and decrypt using 1167 RSA's trade-secret RC2 algorithm in CBC mode with 40-bit keys, and to 1168 encrypt and decrypt using tripleDES. The restricted profile also had 1169 non-mandatory suggestions for other algorithms, but these were not widely 1170 implemented. 1172 It is important to note that many current implementations of S/MIME use the 1173 restricted profile. 1175 C.2.1 Historical Reasons for the Existence of Two Encryption Profiles 1177 Due to US Government export regulations, an S/MIME agent which supports a 1178 strong content encryption algorithm such as DES would not be freely 1179 exportable outside of North America. US software manufacturers have been 1180 compelled to incorporate an exportable or "restricted" content encryption 1181 algorithm in order to create a widely exportable version of their product. 1182 S/MIME agents created in the US and intended for US domestic use (or use 1183 under special State Department export licenses) can utilize stronger, 1184 "unrestricted" content encryption. However, in order to achieve 1185 interoperability, such agents need to support whatever exportable algorithm 1186 is incorporated in restricted S/MIME agents. 1188 The RC2 symmetric encryption algorithm has been approved by the US 1189 Government for "expedited" export licensing at certain key sizes. 1190 Consequently, support for the RC2 algorithm in CBC mode is required for 1191 baseline interoperability in all S/MIME implementations. Support for other 1192 strong symmetric encryption algorithms such as RC5 CBC, DES CBC and DES 1193 EDE3-CBC for content encryption is strongly encouraged where possible. 1195 D. Revision History 1197 The following changes were made between the -05 and -06 revisions of this 1198 draft: 1200 Removed discussion of "application/mime" wrapping because no one has 1201 implemented it and because the specification for application/mime is in 1202 flux. This entailed removing section 3.4.3.4, a bit of the table near the 1203 end of section 3.8, and text throughout appendix F. 1205 Changed the case of SMIMECapabilities to sMIMECapabilities everywhere. 1207 Changed the references for ASN.1, BER, and DER back to their 1988 1208 documents. 1210 Fixed error in the MIME examples in 3.1.4 (left off the C-T-E). 1212 Removed antique text from first paragraph 3.5. 1214 Fixed section numbering in Appendix A. 1216 In A.1, changed "other than 32" to "greater than 32". 1218 Removed "smime-type" from E.2 and E.3, where they appeared by mistake. 1220 E. Request for New MIME Subtypes 1222 E.1 application/pkcs7-mime 1224 To: ietf-types@iana.org 1225 Subject: Registration of MIME media type application/pkcs7-mime 1227 MIME media type name: application 1229 MIME subtype name: pkcs7-mime 1231 Required parameters: none 1233 Optional parameters: name, filename, smime-type 1235 Encoding considerations: Will be binary data, therefore should use 1236 base64 encoding 1238 Security considerations: Described in [PKCS-7] 1240 Interoperability considerations: Designed to carry data formatted 1241 with PKCS-7, as described in [PKCS-7] 1243 Published specification: draft-dusse-smime-msg-xx 1245 Applications which use this media type: Secure Internet mail and 1246 other secure data transports. 1248 Additional information: 1249 File extension(s): .p7m and .p7c 1250 Macintosh File Type Code(s): 1252 Person & email address to contact for further information: 1253 Steve Dusse, spock@rsa.com 1255 Intended usage: COMMON 1257 E.2 application/pkcs7-signature 1259 To: ietf-types@iana.org 1260 Subject: Registration of MIME media type application/pkcs7-signature 1262 MIME media type name: application 1264 MIME subtype name: pkcs7-signature 1266 Required parameters: none 1268 Optional parameters: name, filename 1270 Encoding considerations: Will be binary data, therefore should use 1271 base64 encoding 1273 Security considerations: Described in [PKCS-7] 1275 Interoperability considerations: Designed to carry digital 1276 signatures with PKCS-7, as described in [PKCS-7] 1278 Published specification: draft-dusse-smime-msg-xx 1280 Applications which use this media type: Secure Internet mail and 1281 other secure data transports. 1283 Additional information: 1284 File extension(s): .p7s 1285 Macintosh File Type Code(s): 1287 Person & email address to contact for further information: 1288 Steve Dusse, spock@rsa.com 1290 Intended usage: COMMON 1292 E.3 application/pkcs10 1294 To: ietf-types@iana.org 1295 Subject: Registration of MIME media type application/pkcs10 1297 MIME media type name: application 1299 MIME subtype name: pkcs10 1301 Required parameters: none 1303 Optional parameters: name, filename 1305 Encoding considerations: Will be binary data, therefore should use 1306 base64 encoding 1308 Security considerations: Described in [PKCS-10] 1310 Interoperability considerations: Designed to carry digital 1311 certificates formatted with PKCS-10, as described in [PKCS-10] 1313 Published specification: draft-dusse-smime-msg-xx 1315 Applications which use this media type: Secure Internet mail and 1316 other transports where certificates are required. 1318 Additional information: 1319 File extension(s): .p10 1320 Macintosh File Type Code(s): 1322 Person & email address to contact for further information: 1323 Steve Dusse, spock@rsa.com 1325 Intended usage: COMMON 1327 F. Encapsulating Signed Messages for Internet Transport 1329 The rationale behind the multiple formats for signing has to do with the 1330 MIME subtype defaulting rules of the application and multipart top-level 1331 types, and the behavior of currently deployed gateways and mail user 1332 agents. 1334 Ideally, the multipart/signed format would be the only format used because 1335 it provides a truly backwards compatible way to sign MIME entities. In a 1336 pure MIME environment with very capable user agents, this would be 1337 possible. The world, however, is more complex than this. 1339 One problem with the multipart/signed format occurs with gateways to 1340 non-MIME environments. In these environments, the gateway will generally 1341 not be S/MIME aware, will not recognize the multipart/signed type, and will 1342 default its treatment to multipart/mixed as is prescribed by the MIME 1343 standard. The real problem occurs when the gateway also applies conversions 1344 to the MIME structure of the original message that is being signed and is 1345 contained in the first part of the multipart/signed structure, such as the 1346 gateway converting text and attachments to the local format. Because the 1347 signature is over the MIME structure of the original message, but the 1348 original message is now decomposed and transformed, the signature cannot be 1349 verified. Because MIME encoding of a particular set of body parts can be 1350 done in many different ways, there is no way to reconstruct the original 1351 MIME entity over which the signature was computed. 1353 A similar problem occurs when an attempt is made to combine an existing 1354 user agent with a stand-alone S/MIME facility. Typical user agents do not 1355 have the ability to make a multipart sub-entity available to a stand-alone 1356 application in the same way they make leaf MIME entities available to 1357 "viewer" applications. This user agent behavior is not required by the MIME 1358 standard and thus not widely implemented. The result is that it is 1359 impossible for most user agents to hand off the entire multipart/signed 1360 entity to a stand-alone application. 1362 F.1 Solutions to the Problem 1364 To work around these two problems, the application/pkcs7-mime type can be 1365 used. When going through a gateway, it will be defaulted to the MIME type 1366 of application/octet-stream and treated as a single opaque entity. That is, 1367 the message will be treated as an attachment of unknown type, converted 1368 into the local representation for an attachment and thus can be made 1369 available to an S/MIME facility completely intact. A similar result is 1370 achieved when a user agent similarly treats the application/pkcs7-mime MIME 1371 entity as a simple leaf node of the MIME structure and makes it available 1372 to viewer applications. 1374 Another way to work around these problems is to encapsulate the 1375 multipart/signed MIME entity in a MIME entity that will not be damaged by 1376 the gateway. At the time that this draft is being written, there is a 1377 proposal for a MIME entity "application/mime" for this purpose. However, no 1378 implementations of S/MIME use this type of wrapping. 1380 F.2 Encapsulation in an Non-MIME Environment 1382 While this document primarily addresses the Internet, it is useful to 1383 compose and receive S/MIME secured messages in non-MIME environments. This 1384 is particularly the case when it is desired that security be implemented 1385 end-to-end. Other discussion here addresses the receipt of S/MIME messages 1386 in non-MIME environments. Here the composition of multipart/signed entities 1387 is addressed. 1389 When a message is to be sent in such an environment, the multipart/signed 1390 entity is created as described above. That entity is then treated as an 1391 opaque stream of bits and added to the message as an attachment. It must 1392 have a file name that ends with ".aps", as this is the sole mechanism for 1393 recognizing it as an S/MIME message by the receiving agent. 1395 When this message arrives in a MIME environment, it is likely to have a 1396 MIME type of application/octet-stream, with MIME parameters giving the 1397 filename for the attachment. If the intervening gateway has carried the 1398 file type, it will end in ".aps" and be recognized as an S/MIME message. 1400 G. Acknowledgements 1402 Significant contributions to the content of this draft were made by many 1403 people, including Jeff Thompson and Jeff Weinstein. 1405 H. Authors' addresses 1407 Steve Dusse 1408 RSA Data Security, Inc. 1409 100 Marine Parkway, #500 1410 Redwood City, CA 94065 USA 1411 (415) 595-8782 1412 spock@rsa.com 1414 Paul Hoffman 1415 Internet Mail Consortium 1416 127 Segre Place 1417 Santa Cruz, CA 95060 1418 (408) 426-9827 1419 phoffman@imc.org 1421 Blake Ramsdell 1422 Worldtalk 1423 13122 NE 20th St., Suite C 1424 Bellevue, WA 98005 1425 (425) 882-8861 1426 blaker@deming.com 1428 Laurence Lundblade 1429 QUALCOMM Incorporated 1430 Eudora Division 1431 6455 Lusk Boulevard 1432 San Diego, California 92121-2779 1433 (800) 238-3672 1434 lgl@qualcomm.com 1436 Lisa Repka 1437 Netscape Communications Corporation 1438 501 East Middlefield Road 1439 Mountain View, CA 94043 1440 (415) 254-1900 1441 repka@netscape.com