idnits 2.17.1 draft-ietf-smime-rfc2630bis-03.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 seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. == 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 63 lines Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** 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 separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. ** There are 80 instances of too long lines in the document, the longest one being 4 characters in excess of 72. ** The abstract seems to contain references ([CMSALG]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. ** 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 155: '...t, the key words MUST, MUST NOT, REQUI...' RFC 2119 keyword, line 156: '... SHOULD NOT, RECOMMENDED, MAY, and O...' RFC 2119 keyword, line 169: '...s to this specification MUST implement...' RFC 2119 keyword, line 170: '...ContentInfo, and MUST implement the da...' RFC 2119 keyword, line 172: '... types MAY be implemented....' (169 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == The "Author's Address" (or "Authors' Addresses") section title is misspelled. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (August 2001) is 8289 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? 'CMSALG' on line 53 looks like a reference -- Missing reference section? 'PROFILE' on line 1599 looks like a reference -- Missing reference section? 'STDWORDS' on line 158 looks like a reference -- Missing reference section? '0' on line 2110 looks like a reference -- Missing reference section? '1' on line 2059 looks like a reference -- Missing reference section? '2' on line 2060 looks like a reference -- Missing reference section? '3' on line 2026 looks like a reference -- Missing reference section? '4' on line 1920 looks like a reference -- Missing reference section? 'PWRI' on line 1472 looks like a reference -- Missing reference section? 'ACPROFILE' on line 1518 looks like a reference -- Missing reference section? 'OLDCMS' on line 1601 looks like a reference -- Missing reference section? 'MSG' on line 1605 looks like a reference -- Missing reference section? 'ESS' on line 1606 looks like a reference -- Missing reference section? 'RANDOM' on line 2292 looks like a reference -- Missing reference section? 'DSS' on line 2293 looks like a reference Summary: 7 errors (**), 0 flaws (~~), 3 warnings (==), 17 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 S/MIME Working Group R. Housley 3 Internet Draft RSA Laboratories 4 expires in six months August 2001 6 Cryptographic Message Syntax 8 10 Status of this Memo 12 This document is an Internet-Draft and is in full conformance with 13 all provisions of Section 10 of RFC2026. Internet-Drafts are working 14 documents of the Internet Engineering Task Force (IETF), its areas, 15 and its working groups. Note that other groups may also distribute 16 working documents as Internet-Drafts. 18 Internet-Drafts are draft documents valid for a maximum of six months 19 and may be updated, replaced, or obsoleted by other documents at any 20 time. It is inappropriate to use Internet-Drafts as reference 21 material or to cite them other than as "work in progress." 23 The list of current Internet-Drafts can be accessed at 24 http://www.ietf.org/1id-abstracts.html 26 The list of Internet-Draft Shadow Directories can be accessed at 27 http://www.ietf.org/shadow.html. 29 To view the entire list of current Internet-Drafts, please check the 30 "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow 31 Directories on ftp.is.co.za (Africa), ftp.nordu.net (Northern 32 Europe), ftp.nis.garr.it (Southern Europe), munnari.oz.au (Pacific 33 Rim), ftp.ietf.org (US East Coast), or ftp.isi.edu (US West Coast). 35 Abstract 37 This document describes the Cryptographic Message Syntax (CMS). This 38 syntax is used to digitally sign, digest, authenticate, or encrypt 39 arbitrary messages. 41 The CMS is derived from PKCS #7 version 1.5 as specified in RFC 2315 42 [PKCS#7]. Wherever possible, backward compatibility is preserved; 43 however, changes were necessary to accommodate attribute certificate 44 transfer and key agreement techniques for key management. 46 [*** NEW ***] Once approved, this draft will obsolete RFC 2630. The 47 discussion of specific cryptographic algorithms has been moved to a 48 separate document [CMSALG]. Separation of the protocol and algorithm 49 specifications allows the IETF to update each document independently. 50 No mandatory to implement algorithms are specified. Rather, 51 protocols that reply on the CMS are expected to choose appropriate 52 algorithms for their environment. The algorithms may be selected 53 from [CMSALG] or elsewhere. 55 Look for [*** NEW ***]. This string is used to identify text that is 56 significantly different than RFC 2630. However, editorial changes 57 were made that are not flagged with this string. 59 This draft is being discussed on the "ietf-smime" mailing list. To 60 join the list, send a message to with 61 the single word "subscribe" in the body of the message. Also, there 62 is a Web site for the mailing list at . 65 Table of Contents 67 Status of this Memo ................................................ 1 68 Abstract ........................................................... 1 69 Table of Contents .................................................. 3 70 1 Introduction ................................................... 5 71 2 General Overview ............................................... 5 72 3 General Syntax ................................................. 6 73 4 Data Content Type .............................................. 6 74 5 Signed-data Content Type ....................................... 7 75 5.1 SignedData Type ........................................... 8 76 5.2 EncapsulatedContentInfo Type .............................. 9 77 5.2.1 Compatibility with PKCS #7 ......................... 10 78 5.3 SignerInfo Type ........................................... 10 79 5.4 Message Digest Calculation Process ........................ 12 80 5.5 Message Signature Generation Process ...................... 13 81 5.6 Message Signature Verification Process .................... 13 82 6 Enveloped-data Content Type .................................... 14 83 6.1 EnvelopedData Type ........................................ 15 84 6.2 RecipientInfo Type ........................................ 17 85 6.2.1 KeyTransRecipientInfo Type ......................... 18 86 6.2.2 KeyAgreeRecipientInfo Type ......................... 19 87 6.2.3 KEKRecipientInfo Type .............................. 21 88 6.2.4 PasswordRecipientInfo Type ......................... 22 89 6.2.5 OtherRecipientInfo Type ............................ 22 90 6.3 Content-encryption Process ................................ 23 91 6.4 Key-encryption Process .................................... 23 92 7 Digested-data Content Type ..................................... 24 93 8 Encrypted-data Content Type .................................... 25 94 9 Authenticated-data Content Type ................................ 26 95 9.1 AuthenticatedData Type .................................... 26 96 9.2 MAC Generation ............................................ 28 97 9.3 MAC Verification .......................................... 29 98 10 Useful Types ................................................... 30 99 10.1 Algorithm Identifier Types ............................... 30 100 10.1.1 DigestAlgorithmIdentifier ........................ 30 101 10.1.2 SignatureAlgorithmIdentifier ..................... 30 102 10.1.3 KeyEncryptionAlgorithmIdentifier ................. 30 103 10.1.4 ContentEncryptionAlgorithmIdentifier ............. 31 104 10.1.5 MessageAuthenticationCodeAlgorithm ............... 31 105 10.1.6 KeyDerivationAlgorithmIdentifier ................. 31 107 10.2 Other Useful Types ....................................... 31 108 10.2.1 CertificateRevocationLists ....................... 31 109 10.2.2 CertificateChoices ............................... 32 110 10.2.3 CertificateSet ................................... 32 111 10.2.4 IssuerAndSerialNumber ............................ 33 112 10.2.5 CMSVersion ....................................... 33 113 10.2.6 UserKeyingMaterial ............................... 33 114 10.2.7 OtherKeyAttribute ................................ 34 115 11 Useful Attributes .............................................. 34 116 11.1 Content Type ............................................. 34 117 11.2 Message Digest ........................................... 35 118 11.3 Signing Time ............................................. 36 119 11.4 Countersignature ......................................... 37 120 Appendix A: CMS ASN.1 Module ...................................... 39 121 Appendix B: Version 1 Attribute Certificate ASN.1 Module .......... 46 122 References ......................................................... 47 123 Security Considerations ............................................ 49 124 Acknowledgments .................................................... 51 125 Author Address ..................................................... 52 126 Full Copyright Statement ........................................... 52 128 1 Introduction 130 This document describes the Cryptographic Message Syntax (CMS). This 131 syntax is used to digitally sign, digest, authenticate, or encrypt 132 arbitrary messages. 134 The CMS describes an encapsulation syntax for data protection. It 135 supports digital signatures and encryption. The syntax allows 136 multiple encapsulations; one encapsulation envelope can be nested 137 inside another. Likewise, one party can digitally sign some 138 previously encapsulated data. It also allows arbitrary attributes, 139 such as signing time, to be signed along with the message content, 140 and provides for other attributes such as countersignatures to be 141 associated with a signature. 143 The CMS can support a variety of architectures for certificate-based 144 key management, such as the one defined by the PKIX working group 145 [PROFILE]. 147 The CMS values are generated using ASN.1 [X.208-88], using BER- 148 encoding [X.209-88]. Values are typically represented as octet 149 strings. While many systems are capable of transmitting arbitrary 150 octet strings reliably, it is well known that many electronic mail 151 systems are not. This document does not address mechanisms for 152 encoding octet strings for reliable transmission in such 153 environments. 155 In this document, the key words MUST, MUST NOT, REQUIRED, SHOULD, 156 SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL are to be interpreted as 157 described by Scott Bradner in [STDWORDS]. 159 2 General Overview 161 The CMS is general enough to support many different content types. 162 This document defines one protection content, ContentInfo. 163 ContentInfo encapsulates a single identified content type, and the 164 identified type may provide further encapsulation. This document 165 defines six content types: data, signed-data, enveloped-data, 166 digested-data, encrypted-data, and authenticated-data. Additional 167 content types can be defined outside this document. 169 An implementation that conforms to this specification MUST implement 170 the protection content, ContentInfo, and MUST implement the data, 171 signed-data, and enveloped-data content types. The other content 172 types MAY be implemented. 174 As a general design philosophy, each content type permits single pass 175 processing using indefinite-length Basic Encoding Rules (BER) 176 encoding. Single-pass operation is especially helpful if content is 177 large, stored on tapes, or is "piped" from another process. Single- 178 pass operation has one significant drawback: it is difficult to 179 perform encode operations using the Distinguished Encoding Rules 180 (DER) [X.509-88] encoding in a single pass since the lengths of the 181 various components may not be known in advance. However, signed 182 attributes within the signed-data content type and authenticated 183 attributes within the authenticated-data content type need to be 184 transmitted in DER form to ensure that recipients can verify a 185 content that contains one or more unrecognized attributes. Signed 186 attributes and authenticated attributes are the only data types used 187 in the CMS that require DER encoding. 189 3 General Syntax 191 The following object identifier identifies the content information 192 type: 194 id-ct-contentInfo OBJECT IDENTIFIER ::= { iso(1) member-body(2) 195 us(840) rsadsi(113549) pkcs(1) pkcs9(9) smime(16) ct(1) 6 } 197 The CMS associates a content type identifier with a content. The 198 syntax MUST have ASN.1 type ContentInfo: 200 ContentInfo ::= SEQUENCE { 201 contentType ContentType, 202 content [0] EXPLICIT ANY DEFINED BY contentType } 204 ContentType ::= OBJECT IDENTIFIER 206 The fields of ContentInfo have the following meanings: 208 contentType indicates the type of the associated content. It is 209 an object identifier; it is a unique string of integers assigned 210 by an authority that defines the content type. 212 content is the associated content. The type of content can be 213 determined uniquely by contentType. Content types for data, 214 signed-data, enveloped-data, digested-data, encrypted-data, and 215 authenticated-data are defined in this document. If additional 216 content types are defined in other documents, the ASN.1 type 217 defined SHOULD NOT be a CHOICE type. 219 4 Data Content Type 221 The following object identifier identifies the data content type: 223 id-data OBJECT IDENTIFIER ::= { iso(1) member-body(2) 224 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 1 } 226 The data content type is intended to refer to arbitrary octet 227 strings, such as ASCII text files; the interpretation is left to the 228 application. Such strings need not have any internal structure 229 (although they could have their own ASN.1 definition or other 230 structure). 232 The data content type is generally encapsulated in the signed-data, 233 enveloped-data, digested-data, encrypted-data, or authenticated-data 234 content type. 236 5 Signed-data Content Type 238 The signed-data content type consists of a content of any type and 239 zero or more signature values. Any number of signers in parallel can 240 sign any type of content. 242 The typical application of the signed-data content type represents 243 one signer's digital signature on content of the data content type. 244 Another typical application disseminates certificates and certificate 245 revocation lists (CRLs). 247 The process by which signed-data is constructed involves the 248 following steps: 250 1. For each signer, a message digest, or hash value, is computed 251 on the content with a signer-specific message-digest algorithm. 252 If the signer is signing any information other than the content, 253 the message digest of the content and the other information are 254 digested with the signer's message digest algorithm (see Section 255 5.4), and the result becomes the "message digest." 257 2. For each signer, the message digest is digitally signed using 258 the signer's private key. 260 3. For each signer, the signature value and other signer-specific 261 information are collected into a SignerInfo value, as defined in 262 Section 5.3. Certificates and CRLs for each signer, and those not 263 corresponding to any signer, are collected in this step. 265 4. The message digest algorithms for all the signers and the 266 SignerInfo values for all the signers are collected together with 267 the content into a SignedData value, as defined in Section 5.1. 269 A recipient independently computes the message digest. This message 270 digest and the signer's public key are used to verify the signature 271 value. The signer's public key is referenced either by an issuer 272 distinguished name along with an issuer-specific serial number or by 273 a subject key identifier that uniquely identifies the certificate 274 containing the public key. The signer's certificate can be included 275 in the SignedData certificates field. 277 This section is divided into six parts. The first part describes the 278 top-level type SignedData, the second part describes 279 EncapsulatedContentInfo, the third part describes the per-signer 280 information type SignerInfo, and the fourth, fifth, and sixth parts 281 describe the message digest calculation, signature generation, and 282 signature verification processes, respectively. 284 5.1 SignedData Type 286 The following object identifier identifies the signed-data content 287 type: 289 id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 290 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 } 292 The signed-data content type shall have ASN.1 type SignedData: 294 SignedData ::= SEQUENCE { 295 version CMSVersion, 296 digestAlgorithms DigestAlgorithmIdentifiers, 297 encapContentInfo EncapsulatedContentInfo, 298 certificates [0] IMPLICIT CertificateSet OPTIONAL, 299 crls [1] IMPLICIT CertificateRevocationLists OPTIONAL, 300 signerInfos SignerInfos } 302 DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier 304 SignerInfos ::= SET OF SignerInfo 306 The fields of type SignedData have the following meanings: 308 [*** NEW ***] version is the syntax version number. The 309 appropriate value depends on certificates, eContentType, and 310 SignerInfo. The version MUST be assigned as follows: 312 IF (certificates is present) AND 313 (any version 2 attribute certificates are present) 314 THEN version MUST be 4 315 ELSE 316 IF ((certificates is present) AND 317 (any version 1 attribute certificates are present)) OR 318 (encapContentInfo eContentType is other than id-data) OR 319 (any SignerInfo structures are version 3) 321 THEN version MUST be 3 322 ELSE version MUST be 1 324 digestAlgorithms is a collection of message digest algorithm 325 identifiers. There MAY be any number of elements in the 326 collection, including zero. Each element identifies the message 327 digest algorithm, along with any associated parameters, used by 328 one or more signer. The collection is intended to list the 329 message digest algorithms employed by all of the signers, in any 330 order, to facilitate one-pass signature verification. 331 Implementations MAY fail to validate signatures that use a digest 332 algorithm that is not included in this set. The message digesting 333 process is described in Section 5.4. 335 encapContentInfo is the signed content, consisting of a content 336 type identifier and the content itself. Details of the 337 EncapsulatedContentInfo type are discussed in section 5.2. 339 certificates is a collection of certificates. It is intended that 340 the set of certificates be sufficient to contain chains from a 341 recognized "root" or "top-level certification authority" to all of 342 the signers in the signerInfos field. There may be more 343 certificates than necessary, and there may be certificates 344 sufficient to contain chains from two or more independent top- 345 level certification authorities. There may also be fewer 346 certificates than necessary, if it is expected that recipients 347 have an alternate means of obtaining necessary certificates (e.g., 348 from a previous set of certificates). The signer's certificate 349 MAY be included. The use of version 1 attribute certificates is 350 strongly discouraged. 352 crls is a collection of certificate revocation lists (CRLs). It 353 is intended that the set contain information sufficient to 354 determine whether or not the certificates in the certificates 355 field are valid, but such correspondence is not necessary. There 356 MAY be more CRLs than necessary, and there MAY also be fewer CRLs 357 than necessary. 359 signerInfos is a collection of per-signer information. There MAY 360 be any number of elements in the collection, including zero. The 361 details of the SignerInfo type are discussed in section 5.3. 362 Since each signer can employ a digital signature technique and 363 future specifications could update the syntax, all implementations 364 MUST gracefully handle unimplemented versions of SignerInfo. 365 Further, since all implementations will not support every possible 366 signature algorithm, all implementations MUST gracefully handle 367 unimplemented signature algorithms when they are encountered. 369 5.2 EncapsulatedContentInfo Type 371 The content is represented in the type EncapsulatedContentInfo: 373 EncapsulatedContentInfo ::= SEQUENCE { 374 eContentType ContentType, 375 eContent [0] EXPLICIT OCTET STRING OPTIONAL } 377 ContentType ::= OBJECT IDENTIFIER 379 The fields of type EncapsulatedContentInfo have the following 380 meanings: 382 eContentType is an object identifier. The object identifier 383 uniquely specifies the content type. 385 eContent is the content itself, carried as an octet string. The 386 eContent need not be DER encoded. 388 The optional omission of the eContent within the 389 EncapsulatedContentInfo field makes it possible to construct 390 "external signatures." In the case of external signatures, the 391 content being signed is absent from the EncapsulatedContentInfo value 392 included in the signed-data content type. If the eContent value 393 within EncapsulatedContentInfo is absent, then the signatureValue is 394 calculated and the eContentType is assigned as though the eContent 395 value was present. 397 In the degenerate case where there are no signers, the 398 EncapsulatedContentInfo value being "signed" is irrelevant. In this 399 case, the content type within the EncapsulatedContentInfo value being 400 "signed" MUST be id-data (as defined in section 4), and the content 401 field of the EncapsulatedContentInfo value MUST be omitted. 403 5.2.1 [*** NEW ***] Compatibility with PKCS #7 405 This section contains a word of warning to implementers that wish to 406 support both the CMS and PKCS #7 [PKCS#7]. Both the CMS and PKCS #7 407 identify the type of the encapsulated content with an object 408 identifier, but the ASN.1 type of the content itself was variable in 409 PKCS #7. The definition for eContent, in PKCS #7 this was: 411 content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL 413 In the CMS, the definition for eContent is: 415 eContent [0] EXPLICIT OCTET STRING OPTIONAL 417 The newer definition is much easier to use in most applications, and 418 it is compatible with both S/MIME v2 and S/MIME v3. However, there 419 are some deployed applications that use the older PKCS #7 definition. 420 For example, Microsoft AuthentiCode does not sign an OCTET STRING. 422 To achive backward compatibility with PKCS #7, CMS implementations 423 MAY examine the value of the eContentType, and then adjust the 424 expected encoding of eContent based on the object identifier value. 425 For example, to support Microsoft AuthentiCode, the following 426 information might be included: 428 eContentType Object Identifier = { 1 3 6 1 4 1 311 2 1 4 } 429 eContent Type = SpcIndirectDataContext -- Microsoft code signing 431 5.3 SignerInfo Type 433 Per-signer information is represented in the type SignerInfo: 435 SignerInfo ::= SEQUENCE { 436 version CMSVersion, 437 sid SignerIdentifier, 438 digestAlgorithm DigestAlgorithmIdentifier, 439 signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL, 440 signatureAlgorithm SignatureAlgorithmIdentifier, 441 signature SignatureValue, 442 unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL } 444 SignerIdentifier ::= CHOICE { 445 issuerAndSerialNumber IssuerAndSerialNumber, 446 subjectKeyIdentifier [0] SubjectKeyIdentifier } 448 SignedAttributes ::= SET SIZE (1..MAX) OF Attribute 450 UnsignedAttributes ::= SET SIZE (1..MAX) OF Attribute 452 Attribute ::= SEQUENCE { 453 attrType OBJECT IDENTIFIER, 454 attrValues SET OF AttributeValue } 456 AttributeValue ::= ANY 458 SignatureValue ::= OCTET STRING 460 The fields of type SignerInfo have the following meanings: 462 version is the syntax version number. If the SignerIdentifier is 463 the CHOICE issuerAndSerialNumber, then the version MUST be 1. If 464 the SignerIdentifier is subjectKeyIdentifier, then the version 465 MUST be 3. 467 sid specifies the signer's certificate (and thereby the signer's 468 public key). The signer's public key is needed by the recipient 469 to verify the signature. SignerIdentifier provides two 470 alternatives for specifying the signer's public key. The 471 issuerAndSerialNumber alternative identifies the signer's 472 certificate by the issuer's distinguished name and the certificate 473 serial number; the subjectKeyIdentifier identifies the signer's 474 certificate by the X.509 subjectKeyIdentifier extension value. 475 Implementations MUST support the reception of the 476 issuerAndSerialNumber and subjectKeyIdentifier forms of 477 SignerIdentifier. When generating a SignerIdentifier, 478 implementations MAY support one of the forms (either 479 issuerAndSerialNumber or subjectKeyIdentifier) and always use it, 480 or implementations MAY arbitrarily mix the two forms. 482 digestAlgorithm identifies the message digest algorithm, and any 483 associated parameters, used by the signer. The message digest is 484 computed on either the content being signed or the content 485 together with the signed attributes using the process described in 486 section 5.4. The message digest algorithm SHOULD be among those 487 listed in the digestAlgorithms field of the associated SignerData. 488 Implementations MAY fail to validate signatures that use a digest 489 algorithm that is not included in the SignedData digestAlgorithms 490 set. 492 signedAttrs is a collection of attributes that are signed. The 493 field is optional, but it MUST be present if the content type of 494 the EncapsulatedContentInfo value being signed is not id-data. 495 Each SignedAttribute in the SET MUST be DER encoded. Useful 496 attribute types, such as signing time, are defined in Section 11. 497 If the field is present, it MUST contain, at a minimum, the 498 following two attributes: 500 A content-type attribute having as its value the content type 501 of the EncapsulatedContentInfo value being signed. Section 502 11.1 defines the content-type attribute. [*** NEW ***] 503 However, the content-type attribute MUST NOT be used as part of 504 a countersignature unsigned attribute as defined in section 505 11.4. 507 A message-digest attribute, having as its value the message 508 digest of the content. Section 11.2 defines the message-digest 509 attribute. 511 signatureAlgorithm identifies the signature algorithm, and any 512 associated parameters, used by the signer to generate the digital 513 signature. 515 signature is the result of digital signature generation, using the 516 message digest and the signer's private key. [*** NEW ***] The 517 details of the signature depend on the signature algorithm 518 employed. 520 unsignedAttrs is a collection of attributes that are not signed. 521 The field is optional. Useful attribute types, such as 522 countersignatures, are defined in Section 11. 524 The fields of type SignedAttribute and UnsignedAttribute have the 525 following meanings: 527 attrType indicates the type of attribute. It is an object 528 identifier. 530 attrValues is a set of values that comprise the attribute. The 531 type of each value in the set can be determined uniquely by 532 attrType. The attrType can impose restrictions on the number of 533 items in the set. 535 5.4 Message Digest Calculation Process 537 The message digest calculation process computes a message digest on 538 either the content being signed or the content together with the 539 signed attributes. In either case, the initial input to the message 540 digest calculation process is the "value" of the encapsulated content 541 being signed. Specifically, the initial input is the 542 encapContentInfo eContent OCTET STRING to which the signing process 543 is applied. Only the octets comprising the value of the eContent 544 OCTET STRING are input to the message digest algorithm, not the tag 545 or the length octets. 547 The result of the message digest calculation process depends on 548 whether the signedAttrs field is present. When the field is absent, 549 the result is just the message digest of the content as described 550 above. When the field is present, however, the result is the message 551 digest of the complete DER encoding of the SignedAttrs value 552 contained in the signedAttrs field. Since the SignedAttrs value, 553 when present, must contain the content-type and the message-digest 554 attributes, those values are indirectly included in the result. The 555 content-type attribute MUST NOT be included in a countersignature 556 unsigned attribute as defined in section 11.4. A separate encoding 557 of the signedAttrs field is performed for message digest calculation. 558 The IMPLICIT [0] tag in the signedAttrs is not used for the DER 559 encoding, rather an EXPLICIT SET OF tag is used. That is, the DER 560 encoding of the EXPLICIT SET OF tag, rather than of the IMPLICIT [0] 561 tag, MUST be included in the message digest calculation along with 562 the length and content octets of the SignedAttributes value. 564 When the signedAttrs field is absent, only the octets comprising the 565 value of the signedData encapContentInfo eContent OCTET STRING (e.g., 566 the contents of a file) are input to the message digest calculation. 567 This has the advantage that the length of the content being signed 568 need not be known in advance of the signature generation process. 570 Although the encapContentInfo eContent OCTET STRING tag and length 571 octets are not included in the message digest calculation, they are 572 protected by other means. The length octets are protected by the 573 nature of the message digest algorithm since it is computationally 574 infeasible to find any two distinct messages of any length that have 575 the same message digest. 577 5.5 Message Signature Generation Process 579 The input to the signature generation process includes the result of 580 the message digest calculation process and the signer's private key. 581 The details of the signature generation depend on the signature 582 algorithm employed. The object identifier, along with any 583 parameters, that specifies the signature algorithm employed by the 584 signer is carried in the signatureAlgorithm field. The signature 585 value generated by the signer MUST be encoded as an OCTET STRING and 586 carried in the signature field. 588 5.6 Message Signature Verification Process 590 The input to the signature verification process includes the result 591 of the message digest calculation process and the signer's public 592 key. The recipient MAY obtain the correct public key for the signer 593 by any means, but the preferred method is from a certificate obtained 594 from the SignedData certificates field. The selection and validation 595 of the signer's public key MAY be based on certification path 596 validation (see [PROFILE]) as well as other external context, but is 597 beyond the scope of this document. The details of the signature 598 verification depend on the signature algorithm employed. 600 The recipient MUST NOT rely on any message digest values computed by 601 the originator. If the SignedData signerInfo includes 602 signedAttributes, then the content message digest MUST be calculated 603 as described in section 5.4. For the signature to be valid, the 604 message digest value calculated by the recipient MUST be the same as 605 the value of the messageDigest attribute included in the 606 signedAttributes of the SignedData signerInfo. 608 If the SignedData signerInfo includes signedAttributes, then the 609 content-type attribute value MUST match the SignedData 610 encapContentInfo eContentType value. 612 6 Enveloped-data Content Type 614 The enveloped-data content type consists of an encrypted content of 615 any type and encrypted content-encryption keys for one or more 616 recipients. The combination of the encrypted content and one 617 encrypted content-encryption key for a recipient is a "digital 618 envelope" for that recipient. Any type of content can be enveloped 619 for an arbitrary number of recipients using any of the three key 620 management techniques for each recipient. 622 The typical application of the enveloped-data content type will 623 represent one or more recipients' digital envelopes on content of the 624 data or signed-data content types. 626 Enveloped-data is constructed by the following steps: 628 1. A content-encryption key for a particular content-encryption 629 algorithm is generated at random. 631 2. The content-encryption key is encrypted for each recipient. 632 The details of this encryption depend on the key management 633 algorithm used, but four general techniques are supported: 635 key transport: the content-encryption key is encrypted in the 636 recipient's public key; 638 key agreement: the recipient's public key and the sender's 639 private key are used to generate a pairwise symmetric key, then 640 the content-encryption key is encrypted in the pairwise 641 symmetric key; 643 symmetric key-encryption keys: the content-encryption key is 644 encrypted in a previously distributed symmetric key-encryption 645 key; and 647 passwords: the content-encryption key is encrypted in a key- 648 encryption key that is derived from a password or other shared 649 secret value. 651 3. For each recipient, the encrypted content-encryption key and 652 other recipient-specific information are collected into a 653 RecipientInfo value, defined in Section 6.2. 655 4. The content is encrypted with the content-encryption key. 656 Content encryption may require that the content be padded to a 657 multiple of some block size; see Section 6.3. 659 5. The RecipientInfo values for all the recipients are collected 660 together with the encrypted content to form an EnvelopedData value 661 as defined in Section 6.1. 663 A recipient opens the digital envelope by decrypting one of the 664 encrypted content-encryption keys and then decrypting the encrypted 665 content with the recovered content-encryption key. 667 This section is divided into four parts. The first part describes 668 the top-level type EnvelopedData, the second part describes the per- 669 recipient information type RecipientInfo, and the third and fourth 670 parts describe the content-encryption and key-encryption processes. 672 6.1 EnvelopedData Type 674 The following object identifier identifies the enveloped-data content 675 type: 677 id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 678 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 } 680 The enveloped-data content type shall have ASN.1 type EnvelopedData: 682 EnvelopedData ::= SEQUENCE { 683 version CMSVersion, 684 originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, 685 recipientInfos RecipientInfos, 686 encryptedContentInfo EncryptedContentInfo, 687 unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL } 689 OriginatorInfo ::= SEQUENCE { 690 certs [0] IMPLICIT CertificateSet OPTIONAL, 691 crls [1] IMPLICIT CertificateRevocationLists OPTIONAL } 693 RecipientInfos ::= SET SIZE (1..MAX) OF RecipientInfo 695 EncryptedContentInfo ::= SEQUENCE { 696 contentType ContentType, 697 contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier, 698 encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL } 700 EncryptedContent ::= OCTET STRING 702 UnprotectedAttributes ::= SET SIZE (1..MAX) OF Attribute 704 The fields of type EnvelopedData have the following meanings: 706 [*** NEW ***] version is the syntax version number. The 707 appropriate value depends on originatorInfo, RecipientInfo, and 708 unprotectedAttrs. The version MUST be assigned as follows: 710 IF ((originatorInfo is present) AND 711 (any version 2 attribute certificates are present)) OR 712 (any RecipientInfo structures include pwri) OR 713 (any RecipientInfo structures include ori) 714 THEN version is 3 715 ELSE 716 IF (originatorInfo is present) OR 717 (unprotectedAttrs is present) OR 718 (any RecipientInfo structures are a version other than 0) 719 THEN version is 2 720 ELSE version is 0 722 originatorInfo optionally provides information about the 723 originator. It is present only if required by the key management 724 algorithm. It may contain certificates and CRLs: 726 certs is a collection of certificates. certs may contain 727 originator certificates associated with several different key 728 management algorithms. certs may also contain attribute 729 certificates associated with the originator. The certificates 730 contained in certs are intended to be sufficient for all 731 recipients to build certification paths from a recognized 732 "root" or "top-level certification authority." However, certs 733 may contain more certificates than necessary, and there may be 734 certificates sufficient to make certification paths from two or 735 more independent top-level certification authorities. 736 Alternatively, certs may contain fewer certificates than 737 necessary, if it is expected that recipients have an alternate 738 means of obtaining necessary certificates (e.g., from a 739 previous set of certificates). 741 crls is a collection of CRLs. It is intended that the set 742 contain information sufficient to determine whether or not the 743 certificates in the certs field are valid, but such 744 correspondence is not necessary. There MAY be more CRLs than 745 necessary, and there MAY also be fewer CRLs than necessary. 747 recipientInfos is a collection of per-recipient information. 748 There MUST be at least one element in the collection. 750 encryptedContentInfo is the encrypted content information. 752 unprotectedAttrs is a collection of attributes that are not 753 encrypted. The field is optional. Useful attribute types are 754 defined in Section 11. 756 The fields of type EncryptedContentInfo have the following meanings: 758 contentType indicates the type of content. 760 contentEncryptionAlgorithm identifies the content-encryption 761 algorithm, and any associated parameters, used to encrypt the 762 content. The content-encryption process is described in Section 763 6.3. The same content-encryption algorithm and content-encryption 764 key are used for all recipients. 766 encryptedContent is the result of encrypting the content. The 767 field is optional, and if the field is not present, its intended 768 value must be supplied by other means. 770 The recipientInfos field comes before the encryptedContentInfo field 771 so that an EnvelopedData value may be processed in a single pass. 773 6.2 RecipientInfo Type 775 [*** NEW ***] Per-recipient information is represented in the type 776 RecipientInfo. RecipientInfo has a different format for each of the 777 supported key management techniques. Any of the key management 778 techniques can be used for each recipient of the same encrypted 779 content. In all cases, the content-encryption key is transferred to 780 one or more recipient in encrypted form. 782 [*** NEW ***] Since all implementations will not support every 783 possible key management algorithm, all implementations MUST 784 gracefully handle unimplemented algorithms when they are encountered. 785 For example, if a recipient receives a content-encryption key 786 encrypted in their RSA public key using RSA-OAEP and the 787 implementation only supports RSA PKCS #1 v1.5, then a graceful 788 failure must be implemented. 790 [*** NEW ***] Implementations MUST support key transport, key 791 agreement, and previously distributed symmetric key-encryption keys, 792 as represented by ktri, kari, and kekri, respectively. 793 Implementations MAY support the password-based key management as 794 represented by pwri. Implementations MAY support any other key 795 management technique as represented by ori. Since each recipient can 796 employ a different key management technique and future specifications 797 could define additional key management techniques, all 798 implementations MUST gracefully handle unimplemented alternatives 799 within the RecipientInfo CHOICE, all implementations MUST gracefully 800 handle unimplemented versions of otherwise supported alternatives 801 within the RecipientInfo CHOICE, and all implementations MUST 802 gracefully handle unimplemented or unknown ori alternatives. 804 RecipientInfo ::= CHOICE { 805 ktri KeyTransRecipientInfo, 806 kari [1] KeyAgreeRecipientInfo, 807 kekri [2] KEKRecipientInfo, 808 pwri [3] PasswordRecipientinfo, 809 ori [4] OtherRecipientInfo } 811 EncryptedKey ::= OCTET STRING 813 6.2.1 KeyTransRecipientInfo Type 815 Per-recipient information using key transport is represented in the 816 type KeyTransRecipientInfo. Each instance of KeyTransRecipientInfo 817 transfers the content-encryption key to one recipient. 819 KeyTransRecipientInfo ::= SEQUENCE { 820 version CMSVersion, -- always set to 0 or 2 821 rid RecipientIdentifier, 822 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 823 encryptedKey EncryptedKey } 825 RecipientIdentifier ::= CHOICE { 826 issuerAndSerialNumber IssuerAndSerialNumber, 827 subjectKeyIdentifier [0] SubjectKeyIdentifier } 829 The fields of type KeyTransRecipientInfo have the following meanings: 831 version is the syntax version number. If the RecipientIdentifier 832 is the CHOICE issuerAndSerialNumber, then the version MUST be 0. 833 If the RecipientIdentifier is subjectKeyIdentifier, then the 834 version MUST be 2. 836 rid specifies the recipient's certificate or key that was used by 837 the sender to protect the content-encryption key. The 838 RecipientIdentifier provides two alternatives for specifying the 839 recipient's certificate, and thereby the recipient's public key. 840 The recipient's certificate must contain a key transport public 841 key. Therefore, a recipient X.509 version 3 certificate that 842 contains a key usage extension MUST assert the keyEncipherment 843 bit. The content-encryption key is encrypted with the recipient's 844 public key. The issuerAndSerialNumber alternative identifies the 845 recipient's certificate by the issuer's distinguished name and the 846 certificate serial number; the subjectKeyIdentifier identifies the 847 recipient's certificate by the X.509 subjectKeyIdentifier 848 extension value. [*** NEW ***] For recipient processing, 849 implementations MUST support both of these alternatives for 850 specifying the recipient's certificate; and for sender processing, 851 implementations MUST support at least one of these alternatives. 853 keyEncryptionAlgorithm identifies the key-encryption algorithm, 854 and any associated parameters, used to encrypt the content- 855 encryption key for the recipient. The key-encryption process is 856 described in Section 6.4. 858 encryptedKey is the result of encrypting the content-encryption 859 key for the recipient. 861 6.2.2 KeyAgreeRecipientInfo Type 863 Recipient information using key agreement is represented in the type 864 KeyAgreeRecipientInfo. Each instance of KeyAgreeRecipientInfo will 865 transfer the content-encryption key to one or more recipients that 866 use the same key agreement algorithm and domain parameters for that 867 algorithm. 869 KeyAgreeRecipientInfo ::= SEQUENCE { 870 version CMSVersion, -- always set to 3 871 originator [0] EXPLICIT OriginatorIdentifierOrKey, 872 ukm [1] EXPLICIT UserKeyingMaterial OPTIONAL, 873 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 874 recipientEncryptedKeys RecipientEncryptedKeys } 876 OriginatorIdentifierOrKey ::= CHOICE { 877 issuerAndSerialNumber IssuerAndSerialNumber, 878 subjectKeyIdentifier [0] SubjectKeyIdentifier, 879 originatorKey [1] OriginatorPublicKey } 881 OriginatorPublicKey ::= SEQUENCE { 882 algorithm AlgorithmIdentifier, 883 publicKey BIT STRING } 885 RecipientEncryptedKeys ::= SEQUENCE OF RecipientEncryptedKey 887 RecipientEncryptedKey ::= SEQUENCE { 888 rid KeyAgreeRecipientIdentifier, 889 encryptedKey EncryptedKey } 891 KeyAgreeRecipientIdentifier ::= CHOICE { 892 issuerAndSerialNumber IssuerAndSerialNumber, 893 rKeyId [0] IMPLICIT RecipientKeyIdentifier } 895 RecipientKeyIdentifier ::= SEQUENCE { 896 subjectKeyIdentifier SubjectKeyIdentifier, 897 date GeneralizedTime OPTIONAL, 898 other OtherKeyAttribute OPTIONAL } 900 SubjectKeyIdentifier ::= OCTET STRING 902 The fields of type KeyAgreeRecipientInfo have the following meanings: 904 version is the syntax version number. It MUST always be 3. 906 originator is a CHOICE with three alternatives specifying the 907 sender's key agreement public key. The sender uses the 908 corresponding private key and the recipient's public key to 909 generate a pairwise key. The content-encryption key is encrypted 910 in the pairwise key. The issuerAndSerialNumber alternative 911 identifies the sender's certificate, and thereby the sender's 912 public key, by the issuer's distinguished name and the certificate 913 serial number. The subjectKeyIdentifier alternative identifies 914 the sender's certificate, and thereby the sender's public key, by 915 the X.509 subjectKeyIdentifier extension value. The originatorKey 916 alternative includes the algorithm identifier and sender's key 917 agreement public key. This alternative permits originator 918 anonymity since the public key is not certified. [*** NEW ***] 919 Implementations MUST support all three alternatives for specifying 920 the sender's public key. 922 ukm is optional. With some key agreement algorithms, the sender 923 provides a User Keying Material (UKM) to ensure that a different 924 key is generated each time the same two parties generate a 925 pairwise key. [*** NEW ***] Implementations MUST support 926 recipient processing of a KeyAgreeRecipientInfo SEQUENCE that 927 includes a ukm field. Implementations that do not support key 928 agreement algorithms that make use of UKMs MUST gracefully handle 929 the presence of UKMs. 931 keyEncryptionAlgorithm identifies the key-encryption algorithm, 932 and any associated parameters, used to encrypt the content- 933 encryption key with the key-encryption key. The key-encryption 934 process is described in Section 6.4. 936 recipientEncryptedKeys includes a recipient identifier and 937 encrypted key for one or more recipients. The 938 KeyAgreeRecipientIdentifier is a CHOICE with two alternatives 939 specifying the recipient's certificate, and thereby the 940 recipient's public key, that was used by the sender to generate a 941 pairwise key-encryption key. The recipient's certificate must 942 contain a key agreement public key. Therefore, a recipient X.509 943 version 3 certificate that contains a key usage extension MUST 944 assert the keyAgreement bit. The content-encryption key is 945 encrypted in the pairwise key-encryption key. The 946 issuerAndSerialNumber alternative identifies the recipient's 947 certificate by the issuer's distinguished name and the certificate 948 serial number; the RecipientKeyIdentifier is described below. The 949 encryptedKey is the result of encrypting the content-encryption 950 key in the pairwise key-encryption key generated using the key 951 agreement algorithm. [*** NEW ***] Implementations MUST support 952 both alternatives for specifying the recipient's certificate. 954 The fields of type RecipientKeyIdentifier have the following 955 meanings: 957 subjectKeyIdentifier identifies the recipient's certificate by the 958 X.509 subjectKeyIdentifier extension value. 960 date is optional. When present, the date specifies which of the 961 recipient's previously distributed UKMs was used by the sender. 963 other is optional. When present, this field contains additional 964 information used by the recipient to locate the public keying 965 material used by the sender. 967 6.2.3 KEKRecipientInfo Type 969 Recipient information using previously distributed symmetric keys is 970 represented in the type KEKRecipientInfo. Each instance of 971 KEKRecipientInfo will transfer the content-encryption key to one or 972 more recipients who have the previously distributed key-encryption 973 key. 975 KEKRecipientInfo ::= SEQUENCE { 976 version CMSVersion, -- always set to 4 977 kekid KEKIdentifier, 978 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 979 encryptedKey EncryptedKey } 981 KEKIdentifier ::= SEQUENCE { 982 keyIdentifier OCTET STRING, 983 date GeneralizedTime OPTIONAL, 984 other OtherKeyAttribute OPTIONAL } 986 The fields of type KEKRecipientInfo have the following meanings: 988 version is the syntax version number. It MUST always be 4. 990 kekid specifies a symmetric key-encryption key that was previously 991 distributed to the sender and one or more recipients. 993 keyEncryptionAlgorithm identifies the key-encryption algorithm, 994 and any associated parameters, used to encrypt the content- 995 encryption key with the key-encryption key. The key-encryption 996 process is described in Section 6.4. 998 encryptedKey is the result of encrypting the content-encryption 999 key in the key-encryption key. 1001 The fields of type KEKIdentifier have the following meanings: 1003 keyIdentifier identifies the key-encryption key that was 1004 previously distributed to the sender and one or more recipients. 1006 date is optional. When present, the date specifies a single key- 1007 encryption key from a set that was previously distributed. 1009 other is optional. When present, this field contains additional 1010 information used by the recipient to determine the key-encryption 1011 key used by the sender. 1013 6.2.4 [*** NEW ***] PasswordRecipientInfo Type 1015 Recipient information using a password or shared secret value is 1016 represented in the type PasswordRecipientInfo. Each instance of 1017 PasswordRecipientInfo will transfer the content-encryption key to one 1018 or more recipients who possess the password or shared secret value. 1020 The PasswordRecipientInfo Type is specified in RFC [PWRI]. The 1021 PasswordRecipientInfo structure is repeated here for completeness. 1023 PasswordRecipientInfo ::= SEQUENCE { 1024 version CMSVersion, -- Always set to 0 1025 keyDerivationAlgorithm [0] KeyDerivationAlgorithmIdentifier 1026 OPTIONAL, 1027 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 1028 encryptedKey EncryptedKey } 1029 The fields of type PasswordRecipientInfo have the following meanings: 1031 version is the syntax version number. It MUST always be 0. 1033 keyDerivationAlgorithm identifies the key-derivation algorithm, 1034 and any associated parameters, used to derive the key-encryption 1035 key from the password or shared secret value. If this field is 1036 absent, the key-encryption key is supplied from an external 1037 source, for example a hardware crypto token such as a smart card. 1039 keyEncryptionAlgorithm identifies the encryption algorithm, and 1040 any associated parameters, used to encrypt the content-encryption 1041 key with the key-encryption key. 1043 encryptedKey is the result of encrypting the content-encryption 1044 key with the key-encryption key. 1046 6.2.5 [*** NEW ***] OtherRecipientInfo Type 1048 Recipient information for additional key management techniques are 1049 represented in the type OtherRecipientInfo. The OtherRecipientInfo 1050 type allows key management techniques beyond key transport, key 1051 agreement, previously distributed symmetric key-encryption keys, and 1052 password-based key management to be specified in future documents. 1053 An object identifier uniquely identifies such key management 1054 techniques. 1056 OtherRecipientInfo ::= SEQUENCE { 1057 oriType OBJECT IDENTIFIER, 1058 oriValue ANY DEFINED BY oriType } 1059 The fields of type OtherRecipientInfo have the following meanings: 1061 oriType identifies the key management technique. 1063 oriValue contains the protocol data elements needed by a recipient 1064 using the identified key management technique. 1066 6.3 Content-encryption Process 1068 The content-encryption key for the desired content-encryption 1069 algorithm is randomly generated. The data to be protected is padded 1070 as described below, then the padded data is encrypted using the 1071 content-encryption key. The encryption operation maps an arbitrary 1072 string of octets (the data) to another string of octets (the 1073 ciphertext) under control of a content-encryption key. The encrypted 1074 data is included in the envelopedData encryptedContentInfo 1075 encryptedContent OCTET STRING. 1077 Some content-encryption algorithms assume the input length is a 1078 multiple of k octets, where k is greater than one. For such 1079 algorithms, the input shall be padded at the trailing end with 1080 k-(lth mod k) octets all having value k-(lth mod k), where lth is 1081 the length of the input. In other words, the input is padded at 1082 the trailing end with one of the following strings: 1084 01 -- if lth mod k = k-1 1085 02 02 -- if lth mod k = k-2 1086 . 1087 . 1088 . 1089 k k ... k k -- if lth mod k = 0 1091 The padding can be removed unambiguously since all input is padded, 1092 including input values that are already a multiple of the block size, 1093 and no padding string is a suffix of another. This padding method is 1094 well defined if and only if k is less than 256. 1096 6.4 Key-encryption Process 1098 The input to the key-encryption process -- the value supplied to the 1099 recipient's key-encryption algorithm --is just the "value" of the 1100 content-encryption key. 1102 Any of the aforementioned key management techniques can be used for 1103 each recipient of the same encrypted content. 1105 7 Digested-data Content Type 1107 The digested-data content type consists of content of any type and a 1108 message digest of the content. 1110 Typically, the digested-data content type is used to provide content 1111 integrity, and the result generally becomes an input to the 1112 enveloped-data content type. 1114 The following steps construct digested-data: 1116 1. A message digest is computed on the content with a message- 1117 digest algorithm. 1119 2. The message-digest algorithm and the message digest are 1120 collected together with the content into a DigestedData value. 1122 A recipient verifies the message digest by comparing the message 1123 digest to an independently computed message digest. 1125 The following object identifier identifies the digested-data content 1126 type: 1128 id-digestedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 1129 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 5 } 1131 The digested-data content type shall have ASN.1 type DigestedData: 1133 DigestedData ::= SEQUENCE { 1134 version CMSVersion, 1135 digestAlgorithm DigestAlgorithmIdentifier, 1136 encapContentInfo EncapsulatedContentInfo, 1137 digest Digest } 1139 Digest ::= OCTET STRING 1141 The fields of type DigestedData have the following meanings: 1143 version is the syntax version number. If the encapsulated content 1144 type is id-data, then the value of version MUST be 0; however, if 1145 the encapsulated content type is other than id-data, then the 1146 value of version MUST be 2. 1148 digestAlgorithm identifies the message digest algorithm, and any 1149 associated parameters, under which the content is digested. The 1150 message-digesting process is the same as in Section 5.4 in the 1151 case when there are no signed attributes. 1153 encapContentInfo is the content that is digested, as defined in 1154 section 5.2. 1156 digest is the result of the message-digesting process. 1158 The ordering of the digestAlgorithm field, the encapContentInfo 1159 field, and the digest field makes it possible to process a 1160 DigestedData value in a single pass. 1162 8 Encrypted-data Content Type 1164 The encrypted-data content type consists of encrypted content of any 1165 type. Unlike the enveloped-data content type, the encrypted-data 1166 content type has neither recipients nor encrypted content-encryption 1167 keys. Keys MUST be managed by other means. 1169 The typical application of the encrypted-data content type will be to 1170 encrypt the content of the data content type for local storage, 1171 perhaps where the encryption key is derived from a password. 1173 The following object identifier identifies the encrypted-data content 1174 type: 1176 id-encryptedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 1177 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 6 } 1179 The encrypted-data content type shall have ASN.1 type EncryptedData: 1181 EncryptedData ::= SEQUENCE { 1182 version CMSVersion, 1183 encryptedContentInfo EncryptedContentInfo, 1184 unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL } 1186 The fields of type EncryptedData have the following meanings: 1188 version is the syntax version number. If unprotectedAttrs is 1189 present, then version MUST be 2. If unprotectedAttrs is absent, 1190 then version MUST be 0. 1192 encryptedContentInfo is the encrypted content information, as 1193 defined in Section 6.1. 1195 unprotectedAttrs is a collection of attributes that are not 1196 encrypted. The field is optional. Useful attribute types are 1197 defined in Section 11. 1199 9 Authenticated-data Content Type 1201 The authenticated-data content type consists of content of any type, 1202 a message authentication code (MAC), and encrypted authentication 1203 keys for one or more recipients. The combination of the MAC and one 1204 encrypted authentication key for a recipient is necessary for that 1205 recipient to verify the integrity of the content. Any type of 1206 content can be integrity protected for an arbitrary number of 1207 recipients. 1209 The process by which authenticated-data is constructed involves the 1210 following steps: 1212 1. A message-authentication key for a particular message- 1213 authentication algorithm is generated at random. 1215 2. The message-authentication key is encrypted for each 1216 recipient. The details of this encryption depend on the key 1217 management algorithm used. 1219 3. For each recipient, the encrypted message-authentication key 1220 and other recipient-specific information are collected into a 1221 RecipientInfo value, defined in Section 6.2. 1223 4. Using the message-authentication key, the originator computes 1224 a MAC value on the content. If the originator is authenticating 1225 any information in addition to the content (see Section 9.2), a 1226 message digest is calculated on the content, the message digest of 1227 the content and the other information are authenticated using the 1228 message-authentication key, and the result becomes the "MAC 1229 value." 1231 9.1 AuthenticatedData Type 1233 The following object identifier identifies the authenticated-data 1234 content type: 1236 id-ct-authData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 1237 us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) 1238 ct(1) 2 } 1240 The authenticated-data content type shall have ASN.1 type 1241 AuthenticatedData: 1243 AuthenticatedData ::= SEQUENCE { 1244 version CMSVersion, 1245 originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, 1246 recipientInfos RecipientInfos, 1247 macAlgorithm MessageAuthenticationCodeAlgorithm, 1248 digestAlgorithm [1] DigestAlgorithmIdentifier OPTIONAL, 1249 encapContentInfo EncapsulatedContentInfo, 1250 authAttrs [2] IMPLICIT AuthAttributes OPTIONAL, 1251 mac MessageAuthenticationCode, 1252 unauthAttrs [3] IMPLICIT UnauthAttributes OPTIONAL } 1254 AuthAttributes ::= SET SIZE (1..MAX) OF Attribute 1256 UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute 1258 MessageAuthenticationCode ::= OCTET STRING 1260 The fields of type AuthenticatedData have the following meanings: 1262 [*** NEW ***] version is the syntax version number. The version 1263 MUST be assigned as follows: 1265 IF ((originatorInfo is present) AND 1266 (any version 2 attribute certificates are present)) 1267 THEN version is 1 1268 ELSE version is 0 1270 originatorInfo optionally provides information about the 1271 originator. It is present only if required by the key management 1272 algorithm. It MAY contain certificates, attribute certificates, 1273 and CRLs, as defined in Section 6.1. 1275 recipientInfos is a collection of per-recipient information, as 1276 defined in Section 6.1. There MUST be at least one element in the 1277 collection. 1279 macAlgorithm is a message authentication code (MAC) algorithm 1280 identifier. It identifies the MAC algorithm, along with any 1281 associated parameters, used by the originator. Placement of the 1282 macAlgorithm field facilitates one-pass processing by the 1283 recipient. 1285 digestAlgorithm identifies the message digest algorithm, and any 1286 associated parameters, used to compute a message digest on the 1287 encapsulated content if authenticated attributes are present. The 1288 message digesting process is described in Section 9.2. Placement 1289 of the digestAlgorithm field facilitates one-pass processing by 1290 the recipient. If the digestAlgorithm field is present, then the 1291 authAttrs field MUST also be present. 1293 encapContentInfo is the content that is authenticated, as defined 1294 in section 5.2. 1296 authAttrs is a collection of authenticated attributes. The 1297 authAttrs structure is optional, but it MUST be present if the 1298 content type of the EncapsulatedContentInfo value being 1299 authenticated is not id-data. If the authAttrs field is present, 1300 then the digestAlgorithm field MUST also be present. Each 1301 attribute in the SET MUST be DER encoded. Useful attribute types 1302 are defined in Section 11. If the authAttrs field is present, it 1303 MUST contain, at a minimum, the following two attributes: 1305 A content-type attribute having as its value the content type 1306 of the EncapsulatedContentInfo value being authenticated. 1307 Section 11.1 defines the content-type attribute. 1309 A message-digest attribute, having as its value the message 1310 digest of the content. Section 11.2 defines the message-digest 1311 attribute. 1313 mac is the message authentication code. 1315 unauthAttrs is a collection of attributes that are not 1316 authenticated. The field is optional. To date, no attributes 1317 have been defined for use as unauthenticated attributes, but other 1318 useful attribute types are defined in Section 11. 1320 9.2 MAC Generation 1322 The MAC calculation process computes a message authentication code 1323 (MAC) on either the message being authenticated or a message digest 1324 of message being authenticated together with the originator's 1325 authenticated attributes. 1327 If authAttrs field is absent, the input to the MAC calculation 1328 process is the value of the encapContentInfo eContent OCTET STRING. 1329 Only the octets comprising the value of the eContent OCTET STRING are 1330 input to the MAC algorithm; the tag and the length octets are 1331 omitted. This has the advantage that the length of the content being 1332 authenticated need not be known in advance of the MAC generation 1333 process. 1335 If authAttrs field is present, the content-type attribute (as 1336 described in Section 11.1) and the message-digest attribute (as 1337 described in section 11.2) MUST be included, and the input to the MAC 1338 calculation process is the DER encoding of authAttrs. A separate 1339 encoding of the authAttrs field is performed for message digest 1340 calculation. The IMPLICIT [2] tag in the authAttrs field is not used 1341 for the DER encoding, rather an EXPLICIT SET OF tag is used. That 1342 is, the DER encoding of the SET OF tag, rather than of the IMPLICIT 1343 [2] tag, is to be included in the message digest calculation along 1344 with the length and content octets of the authAttrs value. 1346 The message digest calculation process computes a message digest on 1347 the content being authenticated. The initial input to the message 1348 digest calculation process is the "value" of the encapsulated content 1349 being authenticated. Specifically, the input is the encapContentInfo 1350 eContent OCTET STRING to which the authentication process is applied. 1351 Only the octets comprising the value of the encapContentInfo eContent 1352 OCTET STRING are input to the message digest algorithm, not the tag 1353 or the length octets. This has the advantage that the length of the 1354 content being authenticated need not be known in advance. Although 1355 the encapContentInfo eContent OCTET STRING tag and length octets are 1356 not included in the message digest calculation, they are still 1357 protected by other means. The length octets are protected by the 1358 nature of the message digest algorithm since it is computationally 1359 infeasible to find any two distinct messages of any length that have 1360 the same message digest. 1362 The input to the MAC calculation process includes the MAC input data, 1363 defined above, and an authentication key conveyed in a recipientInfo 1364 structure. The details of MAC calculation depend on the MAC 1365 algorithm employed (e.g., HMAC). The object identifier, along with 1366 any parameters, that specifies the MAC algorithm employed by the 1367 originator is carried in the macAlgorithm field. The MAC value 1368 generated by the originator is encoded as an OCTET STRING and carried 1369 in the mac field. 1371 9.3 MAC Verification 1373 The input to the MAC verification process includes the input data 1374 (determined based on the presence or absence of the authAttrs field, 1375 as defined in 9.2), and the authentication key conveyed in 1376 recipientInfo. The details of the MAC verification process depend on 1377 the MAC algorithm employed. 1379 The recipient MUST NOT rely on any MAC values or message digest 1380 values computed by the originator. The content is authenticated as 1381 described in section 9.2. If the originator includes authenticated 1382 attributes, then the content of the authAttrs is authenticated as 1383 described in section 9.2. For authentication to succeed, the message 1384 MAC value calculated by the recipient MUST be the same as the value 1385 of the mac field. Similarly, for authentication to succeed when the 1386 authAttrs field is present, the content message digest value 1387 calculated by the recipient MUST be the same as the message digest 1388 value included in the authAttrs message-digest attribute. 1390 If the AuthenticatedData includes authAttrs, then the content-type 1391 attribute value MUST match the AuthenticatedData encapContentInfo 1392 eContentType value. 1394 10 Useful Types 1396 This section is divided into two parts. The first part defines 1397 algorithm identifiers, and the second part defines other useful 1398 types. 1400 10.1 Algorithm Identifier Types 1402 All of the algorithm identifiers have the same type: 1403 AlgorithmIdentifier. The definition of AlgorithmIdentifier is 1404 imported from X.509 [X.509-88]. 1406 There are many alternatives for each algorithm type. 1408 10.1.1 DigestAlgorithmIdentifier 1410 The DigestAlgorithmIdentifier type identifies a message-digest 1411 algorithm. Examples include SHA-1, MD2, and MD5. A message-digest 1412 algorithm maps an octet string (the message) to another octet string 1413 (the message digest). 1415 DigestAlgorithmIdentifier ::= AlgorithmIdentifier 1417 10.1.2 SignatureAlgorithmIdentifier 1419 The SignatureAlgorithmIdentifier type identifies a signature 1420 algorithm. Examples include RSA, DSA, and ECDSA. A signature 1421 algorithm supports signature generation and verification operations. 1422 The signature generation operation uses the message digest and the 1423 signer's private key to generate a signature value. The signature 1424 verification operation uses the message digest and the signer's 1425 public key to determine whether or not a signature value is valid. 1426 Context determines which operation is intended. 1428 SignatureAlgorithmIdentifier ::= AlgorithmIdentifier 1430 10.1.3 KeyEncryptionAlgorithmIdentifier 1432 The KeyEncryptionAlgorithmIdentifier type identifies a key-encryption 1433 algorithm used to encrypt a content-encryption key. The encryption 1434 operation maps an octet string (the key) to another octet string (the 1435 encrypted key) under control of a key-encryption key. The decryption 1436 operation is the inverse of the encryption operation. Context 1437 determines which operation is intended. 1439 The details of encryption and decryption depend on the key management 1440 algorithm used. Key transport, key agreement, previously distributed 1441 symmetric key-encrypting keys, and symmetric key-encrypting keys 1442 derived from passwords are supported. 1444 KeyEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier 1446 10.1.4 ContentEncryptionAlgorithmIdentifier 1448 The ContentEncryptionAlgorithmIdentifier type identifies a content- 1449 encryption algorithm. Examples include Triple-DES and RC2. A 1450 content-encryption algorithm supports encryption and decryption 1451 operations. The encryption operation maps an octet string (the 1452 message) to another octet string (the ciphertext) under control of a 1453 content-encryption key. The decryption operation is the inverse of 1454 the encryption operation. Context determines which operation is 1455 intended. 1457 ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier 1459 10.1.5 MessageAuthenticationCodeAlgorithm 1461 The MessageAuthenticationCodeAlgorithm type identifies a message 1462 authentication code (MAC) algorithm. Examples include DES-MAC and 1463 HMAC-SHA-1. A MAC algorithm supports generation and verification 1464 operations. The MAC generation and verification operations use the 1465 same symmetric key. Context determines which operation is intended. 1467 MessageAuthenticationCodeAlgorithm ::= AlgorithmIdentifier 1469 10.1.6 [*** NEW ***] KeyDerivationAlgorithmIdentifier 1471 The KeyDerivationAlgorithmIdentifier type is specified in RFC 1472 [PWRI]. The KeyDerivationAlgorithmIdentifier definition is repeated 1473 here for completeness. 1475 Key derivation algorithms convert a password or shared secret value 1476 into a key-encryption key. 1478 KeyDerivationAlgorithmIdentifier ::= AlgorithmIdentifier 1480 10.2 Other Useful Types 1482 This section defines types that are used other places in the 1483 document. The types are not listed in any particular order. 1485 10.2.1 CertificateRevocationLists 1487 The CertificateRevocationLists type gives a set of certificate 1488 revocation lists (CRLs). It is intended that the set contain 1489 information sufficient to determine whether the certificates and 1490 attribute certificates with which the set is associated are revoked. 1491 However, there may be more CRLs than necessary or there MAY be fewer 1492 CRLs than necessary. 1494 The CertificateList may contain a CRL, an Authority Revocation List 1495 (ARL), a Delta CRL, or an Attribute Certificate Revocation List. All 1496 of these lists share a common syntax. 1498 CRLs are specified in X.509 [X.509-97], and they are profiled for use 1499 in the Internet in RFC [PROFILE]. 1501 The definition of CertificateList is imported from X.509. 1503 CertificateRevocationLists ::= SET OF CertificateList 1505 10.2.2 CertificateChoices 1507 [*** NEW ***] The CertificateChoices type gives either a PKCS #6 1508 extended certificate [PKCS#6], an X.509 certificate, a version 1 1509 X.509 attribute certificate (ACv1) [X.509-97], or a version 2 X.509 1510 attribute certificate (ACv2) [X.509-00]. The PKCS #6 extended 1511 certificate is obsolete. The PKCS #6 certificate is included for 1512 backward compatibility, and PKCS #6 certificates SHOULD NOT be used. 1513 The ACv1 is also obsolete. ACv1 is included for backward 1514 compatibility, and ACv1 SHOULD NOT be used. The Internet profile of 1515 X.509 certificates is specified in the "Internet X.509 Public Key 1516 Infrastructure: Certificate and CRL Profile" [PROFILE]. The Internet 1517 profile of ACv2 is specified in the "An Internet Attribute 1518 Certificate Profile for Authorization" [ACPROFILE]. 1520 The definition of Certificate is imported from X.509. 1522 [*** NEW ***] The definitions of AttributeCertificate are imported 1523 from X.509-1997 and X.509-2000. The definition from X.509-1997 is 1524 assigned to AttributeCertificateV1 (see Appendix B), and the 1525 definition from X.509-2000 is assigned to AttributeCertificateV2. 1527 CertificateChoices ::= CHOICE { 1528 certificate Certificate, -- See X.509 1529 extendedCertificate [0] IMPLICIT ExtendedCertificate, -- Obsolete 1530 v1AttrCert [1] IMPLICIT AttributeCertificateV1, -- Obsolete 1531 v2AttrCert [2] IMPLICIT AttributeCertificateV2 } -- See X.509 1533 10.2.3 CertificateSet 1535 The CertificateSet type provides a set of certificates. It is 1536 intended that the set be sufficient to contain chains from a 1537 recognized "root" or "top-level certification authority" to all of 1538 the sender certificates with which the set is associated. However, 1539 there may be more certificates than necessary, or there MAY be fewer 1540 than necessary. 1542 The precise meaning of a "chain" is outside the scope of this 1543 document. Some applications may impose upper limits on the length of 1544 a chain; others may enforce certain relationships between the 1545 subjects and issuers of certificates within a chain. 1547 CertificateSet ::= SET OF CertificateChoices 1549 10.2.4 IssuerAndSerialNumber 1551 The IssuerAndSerialNumber type identifies a certificate, and thereby 1552 an entity and a public key, by the distinguished name of the 1553 certificate issuer and an issuer-specific certificate serial number. 1555 The definition of Name is imported from X.501 [X.501-88], and the 1556 definition of CertificateSerialNumber is imported from X.509 1557 [X.509-97]. 1559 IssuerAndSerialNumber ::= SEQUENCE { 1560 issuer Name, 1561 serialNumber CertificateSerialNumber } 1563 CertificateSerialNumber ::= INTEGER 1565 10.2.5 CMSVersion 1567 The CMSVersion type gives a syntax version number, for compatibility 1568 with future revisions of this specification. 1570 CMSVersion ::= INTEGER { v0(0), v1(1), v2(2), v3(3), v4(4) } 1572 10.2.6 UserKeyingMaterial 1574 The UserKeyingMaterial type gives a syntax for user keying material 1575 (UKM). Some key agreement algorithms require UKMs to ensure that a 1576 different key is generated each time the same two parties generate a 1577 pairwise key. The sender provides a UKM for use with a specific key 1578 agreement algorithm. 1580 UserKeyingMaterial ::= OCTET STRING 1582 10.2.7 OtherKeyAttribute 1584 The OtherKeyAttribute type gives a syntax for the inclusion of other 1585 key attributes that permit the recipient to select the key used by 1586 the sender. The attribute object identifier must be registered along 1587 with the syntax of the attribute itself. Use of this structure 1588 should be avoided since it might impede interoperability. 1590 OtherKeyAttribute ::= SEQUENCE { 1591 keyAttrId OBJECT IDENTIFIER, 1592 keyAttr ANY DEFINED BY keyAttrId OPTIONAL } 1594 11 Useful Attributes 1596 This section defines attributes that may be used with signed-data, 1597 enveloped-data, encrypted-data, or authenticated-data. The syntax of 1598 Attribute is compatible with X.501 [X.501-88] and RFC 1599 [PROFILE]. Some of the attributes defined in this section were 1600 originally defined in PKCS #9 [PKCS#9]; others were originally 1601 defined in a previous version of this specification [OLDCMS]. The 1602 attributes are not listed in any particular order. 1604 Additional attributes are defined in many places, notably the S/MIME 1605 Version 3 Message Specification [MSG] and the Enhanced Security 1606 Services for S/MIME [ESS], which also include recommendations on the 1607 placement of these attributes. 1609 11.1 Content Type 1611 [*** NEW ***] The content-type attribute type specifies the content 1612 type of the ContentInfo within signed-data or authenticated-data. 1613 The content-type attribute type MUST be present whenever signed 1614 attributes are present in signed-data or authenticated attributes 1615 present in authenticated-data. The content-type attribute value MUST 1616 match the encapContentInfo eContentType value in the signed-data or 1617 authenticated-data. 1619 [*** NEW ***] The content-type attribute MUST be a signed attribute 1620 or an authenticated attribute; it MUST NOT be an unsigned attribute, 1621 unauthenticated attribute, or unprotected attribute. 1623 The following object identifier identifies the content-type 1624 attribute: 1626 id-contentType OBJECT IDENTIFIER ::= { iso(1) member-body(2) 1627 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 3 } 1629 Content-type attribute values have ASN.1 type ContentType: 1631 ContentType ::= OBJECT IDENTIFIER 1633 Even though the syntax is defined as a SET OF AttributeValue, a 1634 content-type attribute MUST have a single attribute value; zero or 1635 multiple instances of AttributeValue are not permitted. 1637 The SignedAttributes and AuthAttributes syntaxes are each defined as 1638 a SET OF Attributes. The SignedAttributes in a signerInfo MUST NOT 1639 include multiple instances of the content-type attribute. Similarly, 1640 the AuthAttributes in an AuthenticatedData MUST NOT include multiple 1641 instances of the content-type attribute. 1643 11.2 Message Digest 1645 The message-digest attribute type specifies the message digest of the 1646 encapContentInfo eContent OCTET STRING being signed in signed-data 1647 (see section 5.4) or authenticated in authenticated-data (see section 1648 9.2). For signed-data, the message digest is computed using the 1649 signer's message digest algorithm. For authenticated-data, the 1650 message digest is computed using the originator's message digest 1651 algorithm. 1653 [*** NEW ***] Within signed-data, the message-digest signed attribute 1654 type MUST be present when there are any signed attributes present. 1655 Within authenticated-data, the message-digest authenticated attribute 1656 type MUST be present when there are any authenticated attributes 1657 present. 1659 [*** NEW ***] The message-digest attribute MUST be a signed attribute 1660 or an authenticated attribute; it MUST NOT be an unsigned attribute, 1661 unauthenticated attribute, or unprotected attribute. 1663 The following object identifier identifies the message-digest 1664 attribute: 1666 id-messageDigest OBJECT IDENTIFIER ::= { iso(1) member-body(2) 1667 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 4 } 1669 Message-digest attribute values have ASN.1 type MessageDigest: 1671 MessageDigest ::= OCTET STRING 1673 A message-digest attribute MUST have a single attribute value, even 1674 though the syntax is defined as a SET OF AttributeValue. There MUST 1675 NOT be zero or multiple instances of AttributeValue present. 1677 The SignedAttributes syntax and AuthAttributes syntax are each 1678 defined as a SET OF Attributes. The SignedAttributes in a signerInfo 1679 MUST include only one instance of the message-digest attribute. 1680 Similarly, the AuthAttributes in an AuthenticatedData MUST include 1681 only one instance of the message-digest attribute. 1683 11.3 Signing Time 1685 The signing-time attribute type specifies the time at which the 1686 signer (purportedly) performed the signing process. The signing-time 1687 attribute type is intended for use in signed-data. 1689 [*** NEW ***] The signing-time attribute MUST be a signed attribute 1690 or an authenticated attribute; it MUST NOT be an unsigned attribute, 1691 unauthenticated attribute, or unprotected attribute. 1693 The following object identifier identifies the signing-time 1694 attribute: 1696 id-signingTime OBJECT IDENTIFIER ::= { iso(1) member-body(2) 1697 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 5 } 1699 Signing-time attribute values have ASN.1 type SigningTime: 1701 SigningTime ::= Time 1703 Time ::= CHOICE { 1704 utcTime UTCTime, 1705 generalizedTime GeneralizedTime } 1707 Note: The definition of Time matches the one specified in the 1997 1708 version of X.509 [X.509-97]. 1710 Dates between 1 January 1950 and 31 December 2049 (inclusive) MUST be 1711 encoded as UTCTime. Any dates with year values before 1950 or after 1712 2049 MUST be encoded as GeneralizedTime. 1714 UTCTime values MUST be expressed in Greenwich Mean Time (Zulu) and 1715 MUST include seconds (i.e., times are YYMMDDHHMMSSZ), even where the 1716 number of seconds is zero. Midnight (GMT) MUST be represented as 1717 "YYMMDD000000Z". Century information is implicit, and the century 1718 MUST be determined as follows: 1720 Where YY is greater than or equal to 50, the year MUST be 1721 interpreted as 19YY; and 1723 Where YY is less than 50, the year MUST be interpreted as 20YY. 1725 GeneralizedTime values MUST be expressed in Greenwich Mean Time 1726 (Zulu) and MUST include seconds (i.e., times are YYYYMMDDHHMMSSZ), 1727 even where the number of seconds is zero. GeneralizedTime values 1728 MUST NOT include fractional seconds. 1730 A signing-time attribute MUST have a single attribute value, even 1731 though the syntax is defined as a SET OF AttributeValue. There MUST 1732 NOT be zero or multiple instances of AttributeValue present. 1734 The SignedAttributes syntax and the AuthAttributes syntax are each 1735 defined as a SET OF Attributes. The SignedAttributes in a signerInfo 1736 MUST NOT include multiple instances of the signing-time attribute. 1737 Similarly, the AuthAttributes in an AuthenticatedData MUST NOT 1738 include multiple instances of the signing-time attribute. 1740 No requirement is imposed concerning the correctness of the signing 1741 time, and acceptance of a purported signing time is a matter of a 1742 recipient's discretion. It is expected, however, that some signers, 1743 such as time-stamp servers, will be trusted implicitly. 1745 11.4 Countersignature 1747 The countersignature attribute type specifies one or more signatures 1748 on the contents octets of the DER encoding of the signatureValue 1749 field of a SignerInfo value in signed-data. Thus, the 1750 countersignature attribute type countersigns (signs in serial) 1751 another signature. 1753 [*** NEW ***] The countersignature attribute MUST be an unsigned 1754 attribute; it MUST NOT be a signed attribute, an authenticated 1755 attribute, an unauthenticated attribute, or an unprotected attribute. 1757 The following object identifier identifies the countersignature 1758 attribute: 1760 id-countersignature OBJECT IDENTIFIER ::= { iso(1) member-body(2) 1761 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 6 } 1763 Countersignature attribute values have ASN.1 type Countersignature: 1765 Countersignature ::= SignerInfo 1767 [*** NEW ***] Countersignature values have the same meaning as 1768 SignerInfo values for ordinary signatures, except that: 1770 1. The signedAttributes field MUST NOT contain a content-type 1771 attribute; there is no content type for countersignatures. 1773 2. The signedAttributes field MUST contain a message-digest 1774 attribute if it contains any other attributes. 1776 3. The input to the message-digesting process is the contents 1777 octets of the DER encoding of the signatureValue field of the 1778 SignerInfo value with which the attribute is associated. 1780 A countersignature attribute can have multiple attribute values. The 1781 syntax is defined as a SET OF AttributeValue, and there MUST be one 1782 or more instances of AttributeValue present. 1784 The UnsignedAttributes syntax is defined as a SET OF Attributes. The 1785 UnsignedAttributes in a signerInfo may include multiple instances of 1786 the countersignature attribute. 1788 A countersignature, since it has type SignerInfo, can itself contain 1789 a countersignature attribute. Thus, it is possible to construct 1790 arbitrarily long series of countersignatures. 1792 Appendix A: CMS ASN.1 Module 1794 CryptographicMessageSyntax 1795 { iso(1) member-body(2) us(840) rsadsi(113549) 1796 pkcs(1) pkcs-9(9) smime(16) modules(0) cms-2001(14) } 1798 -- [*** NEW ***] A new OID was assigned for this updated module. 1800 DEFINITIONS IMPLICIT TAGS ::= 1801 BEGIN 1803 -- EXPORTS All 1804 -- The types and values defined in this module are exported for use in 1805 -- the other ASN.1 modules. Other applications may use them for their 1806 -- own purposes. 1808 IMPORTS 1810 -- Directory Information Framework (X.501) 1811 Name 1812 FROM InformationFramework { joint-iso-itu-t ds(5) modules(1) 1813 informationFramework(1) 3 } 1815 -- Directory Authentication Framework (X.509-2000) 1816 AlgorithmIdentifier, Certificate, CertificateList, 1817 CertificateSerialNumber 1818 FROM AuthenticationFramework { joint-iso-itu-t ds(5) 1819 module(1) authenticationFramework(7) 4 } 1821 -- [*** NEW ***] 1822 -- Attribute Certificate Definitions (X.509-2000) 1823 AttributeCertificate 1824 FROM AttributeCertificateDefinitions { joint-iso-itu-t 1825 ds(5) module(1) attributeCertificateDefinitions(32) 4 } 1827 -- [*** NEW ***] 1828 -- Indirectly from Directory Authentication Framework (X.509-1997) 1829 AttributeCertificateV1 1830 FROM AttributeCertificateVersion1 { iso(1) member-body(2) 1831 us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) 1832 modules(0) v1AttrCert(15) } ; 1834 -- Cryptographic Message Syntax 1836 ContentInfo ::= SEQUENCE { 1837 contentType ContentType, 1838 content [0] EXPLICIT ANY DEFINED BY contentType } 1840 ContentType ::= OBJECT IDENTIFIER 1842 SignedData ::= SEQUENCE { 1843 version CMSVersion, 1844 digestAlgorithms DigestAlgorithmIdentifiers, 1845 encapContentInfo EncapsulatedContentInfo, 1846 certificates [0] IMPLICIT CertificateSet OPTIONAL, 1847 crls [1] IMPLICIT CertificateRevocationLists OPTIONAL, 1848 signerInfos SignerInfos } 1850 DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier 1852 SignerInfos ::= SET OF SignerInfo 1854 EncapsulatedContentInfo ::= SEQUENCE { 1855 eContentType ContentType, 1856 eContent [0] EXPLICIT OCTET STRING OPTIONAL } 1858 SignerInfo ::= SEQUENCE { 1859 version CMSVersion, 1860 sid SignerIdentifier, 1861 digestAlgorithm DigestAlgorithmIdentifier, 1862 signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL, 1863 signatureAlgorithm SignatureAlgorithmIdentifier, 1864 signature SignatureValue, 1865 unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL } 1867 SignerIdentifier ::= CHOICE { 1868 issuerAndSerialNumber IssuerAndSerialNumber, 1869 subjectKeyIdentifier [0] SubjectKeyIdentifier } 1871 SignedAttributes ::= SET SIZE (1..MAX) OF Attribute 1873 UnsignedAttributes ::= SET SIZE (1..MAX) OF Attribute 1875 Attribute ::= SEQUENCE { 1876 attrType OBJECT IDENTIFIER, 1877 attrValues SET OF AttributeValue } 1879 AttributeValue ::= ANY 1881 SignatureValue ::= OCTET STRING 1882 EnvelopedData ::= SEQUENCE { 1883 version CMSVersion, 1884 originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, 1885 recipientInfos RecipientInfos, 1886 encryptedContentInfo EncryptedContentInfo, 1887 unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL } 1889 OriginatorInfo ::= SEQUENCE { 1890 certs [0] IMPLICIT CertificateSet OPTIONAL, 1891 crls [1] IMPLICIT CertificateRevocationLists OPTIONAL } 1893 -- [*** OLD ***] 1894 -- RecipientInfos ::= SET OF RecipientInfo 1896 -- [*** NEW ***] 1897 RecipientInfos ::= SET SIZE (1..MAX) OF RecipientInfo 1899 EncryptedContentInfo ::= SEQUENCE { 1900 contentType ContentType, 1901 contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier, 1902 encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL } 1904 EncryptedContent ::= OCTET STRING 1906 UnprotectedAttributes ::= SET SIZE (1..MAX) OF Attribute 1908 -- [*** OLD ***] 1909 -- RecipientInfo ::= CHOICE { 1910 -- ktri KeyTransRecipientInfo, 1911 -- kari [1] KeyAgreeRecipientInfo, 1912 -- kekri [2] KEKRecipientInfo } 1914 -- [*** NEW ***] 1915 RecipientInfo ::= CHOICE { 1916 ktri KeyTransRecipientInfo, 1917 kari [1] KeyAgreeRecipientInfo, 1918 kekri [2] KEKRecipientInfo, 1919 pwri [3] PasswordRecipientInfo, 1920 ori [4] OtherRecipientInfo } 1922 EncryptedKey ::= OCTET STRING 1924 KeyTransRecipientInfo ::= SEQUENCE { 1925 version CMSVersion, -- always set to 0 or 2 1926 rid RecipientIdentifier, 1927 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 1928 encryptedKey EncryptedKey } 1930 RecipientIdentifier ::= CHOICE { 1931 issuerAndSerialNumber IssuerAndSerialNumber, 1932 subjectKeyIdentifier [0] SubjectKeyIdentifier } 1934 KeyAgreeRecipientInfo ::= SEQUENCE { 1935 version CMSVersion, -- always set to 3 1936 originator [0] EXPLICIT OriginatorIdentifierOrKey, 1937 ukm [1] EXPLICIT UserKeyingMaterial OPTIONAL, 1938 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 1939 recipientEncryptedKeys RecipientEncryptedKeys } 1941 OriginatorIdentifierOrKey ::= CHOICE { 1942 issuerAndSerialNumber IssuerAndSerialNumber, 1943 subjectKeyIdentifier [0] SubjectKeyIdentifier, 1944 originatorKey [1] OriginatorPublicKey } 1946 OriginatorPublicKey ::= SEQUENCE { 1947 algorithm AlgorithmIdentifier, 1948 publicKey BIT STRING } 1950 RecipientEncryptedKeys ::= SEQUENCE OF RecipientEncryptedKey 1952 RecipientEncryptedKey ::= SEQUENCE { 1953 rid KeyAgreeRecipientIdentifier, 1954 encryptedKey EncryptedKey } 1956 KeyAgreeRecipientIdentifier ::= CHOICE { 1957 issuerAndSerialNumber IssuerAndSerialNumber, 1958 rKeyId [0] IMPLICIT RecipientKeyIdentifier } 1960 RecipientKeyIdentifier ::= SEQUENCE { 1961 subjectKeyIdentifier SubjectKeyIdentifier, 1962 date GeneralizedTime OPTIONAL, 1963 other OtherKeyAttribute OPTIONAL } 1965 SubjectKeyIdentifier ::= OCTET STRING 1967 KEKRecipientInfo ::= SEQUENCE { 1968 version CMSVersion, -- always set to 4 1969 kekid KEKIdentifier, 1970 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 1971 encryptedKey EncryptedKey } 1973 KEKIdentifier ::= SEQUENCE { 1974 keyIdentifier OCTET STRING, 1975 date GeneralizedTime OPTIONAL, 1976 other OtherKeyAttribute OPTIONAL } 1978 -- [*** NEW ***] 1979 PasswordRecipientInfo ::= SEQUENCE { 1980 version CMSVersion, -- always set to 0 1981 keyDerivationAlgorithm [0] KeyDerivationAlgorithmIdentifier 1982 OPTIONAL, 1983 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 1984 encryptedKey EncryptedKey } 1986 -- [*** NEW ***] 1987 OtherRecipientInfo ::= SEQUENCE { 1988 oriType OBJECT IDENTIFIER, 1989 oriValue ANY DEFINED BY oriType } 1991 DigestedData ::= SEQUENCE { 1992 version CMSVersion, 1993 digestAlgorithm DigestAlgorithmIdentifier, 1994 encapContentInfo EncapsulatedContentInfo, 1995 digest Digest } 1997 Digest ::= OCTET STRING 1999 EncryptedData ::= SEQUENCE { 2000 version CMSVersion, 2001 encryptedContentInfo EncryptedContentInfo, 2002 unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL } 2004 -- [*** OLD ***] 2005 -- AuthenticatedData ::= SEQUENCE { 2006 -- version CMSVersion, 2007 -- originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, 2008 -- recipientInfos RecipientInfos, 2009 -- macAlgorithm MessageAuthenticationCodeAlgorithm, 2010 -- digestAlgorithm [1] DigestAlgorithmIdentifier OPTIONAL, 2011 -- encapContentInfo EncapsulatedContentInfo, 2012 -- authenticatedAttributes [2] IMPLICIT AuthAttributes OPTIONAL, 2013 -- mac MessageAuthenticationCode, 2014 -- unauthenticatedAttributes [3] IMPLICIT UnauthAttributes OPTIONAL } 2016 -- [*** NEW ***] 2017 AuthenticatedData ::= SEQUENCE { 2018 version CMSVersion, 2019 originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, 2020 recipientInfos RecipientInfos, 2021 macAlgorithm MessageAuthenticationCodeAlgorithm, 2022 digestAlgorithm [1] DigestAlgorithmIdentifier OPTIONAL, 2023 encapContentInfo EncapsulatedContentInfo, 2024 authAttrs [2] IMPLICIT AuthAttributes OPTIONAL, 2025 mac MessageAuthenticationCode, 2026 unauthAttrs [3] IMPLICIT UnauthAttributes OPTIONAL } 2028 AuthAttributes ::= SET SIZE (1..MAX) OF Attribute 2030 UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute 2032 MessageAuthenticationCode ::= OCTET STRING 2034 DigestAlgorithmIdentifier ::= AlgorithmIdentifier 2036 SignatureAlgorithmIdentifier ::= AlgorithmIdentifier 2038 KeyEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier 2040 ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier 2042 MessageAuthenticationCodeAlgorithm ::= AlgorithmIdentifier 2044 -- [*** NEW ***] 2045 KeyDerivationAlgorithmIdentifier ::= AlgorithmIdentifier 2047 CertificateRevocationLists ::= SET OF CertificateList 2049 -- [*** OLD ***] 2050 -- CertificateChoices ::= CHOICE { 2051 -- certificate Certificate, - - See X.509 2052 -- extendedCertificate [0] IMPLICIT ExtendedCertificate, - - Obsolete 2053 -- attrCert [1] IMPLICIT AttributeCertificate } - - See X.509 & X9.57 2055 -- [*** NEW ***] 2056 CertificateChoices ::= CHOICE { 2057 certificate Certificate, -- See X.509 2058 extendedCertificate [0] IMPLICIT ExtendedCertificate, -- Obsolete 2059 v1AttrCert [1] IMPLICIT AttributeCertificateV1, -- Obsolete 2060 v2AttrCert [2] IMPLICIT AttributeCertificateV2 } -- See X.509 2062 -- [*** NEW ***] 2063 AttributeCertificateV2 ::= AttributeCertificate -- See X.509-2000 2065 CertificateSet ::= SET OF CertificateChoices 2067 IssuerAndSerialNumber ::= SEQUENCE { 2068 issuer Name, 2069 serialNumber CertificateSerialNumber } 2071 CMSVersion ::= INTEGER { v0(0), v1(1), v2(2), v3(3), v4(4) } 2073 UserKeyingMaterial ::= OCTET STRING 2074 UserKeyingMaterials ::= SET SIZE (1..MAX) OF UserKeyingMaterial 2076 OtherKeyAttribute ::= SEQUENCE { 2077 keyAttrId OBJECT IDENTIFIER, 2078 keyAttr ANY DEFINED BY keyAttrId OPTIONAL } 2080 -- The CMS Attributes 2082 MessageDigest ::= OCTET STRING 2084 SigningTime ::= Time 2086 Time ::= CHOICE { 2087 utcTime UTCTime, 2088 generalTime GeneralizedTime } 2090 Countersignature ::= SignerInfo 2092 -- Attribute Object Identifiers 2094 id-contentType OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2095 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 3 } 2097 id-messageDigest OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2098 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 4 } 2100 id-signingTime OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2101 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 5 } 2103 id-countersignature OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2104 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 6 } 2106 -- Obsolete Extended Certificate syntax from PKCS#6 2108 ExtendedCertificateOrCertificate ::= CHOICE { 2109 certificate Certificate, 2110 extendedCertificate [0] IMPLICIT ExtendedCertificate } 2112 ExtendedCertificate ::= SEQUENCE { 2113 extendedCertificateInfo ExtendedCertificateInfo, 2114 signatureAlgorithm SignatureAlgorithmIdentifier, 2115 signature Signature } 2117 ExtendedCertificateInfo ::= SEQUENCE { 2118 version CMSVersion, 2119 certificate Certificate, 2120 attributes UnauthAttributes } 2122 Signature ::= BIT STRING 2124 END -- of CryptographicMessageSyntax 2126 Appendix B: Version 1 Attribute Certificate ASN.1 Module 2128 [*** NEW ***] 2130 AttributeCertificateVersion1 2131 { iso(1) member-body(2) us(840) rsadsi(113549) 2132 pkcs(1) pkcs-9(9) smime(16) modules(0) v1AttrCert(15) } 2134 DEFINITIONS IMPLICIT TAGS ::= 2135 BEGIN 2137 -- EXPORTS All 2138 -- Only one type is defined, and it is exported. 2140 IMPORTS 2142 -- Directory Authentication Framework (X.509-1997) 2143 AttributeCertificate 2144 FROM AuthenticationFramework { joint-iso-itu-t ds(5) 2145 module(1) authenticationFramework(7) 3 } ; 2147 -- Version 1 Attribute Certificate 2149 AttributeCertificateV1 ::= AttributeCertificate 2151 END -- of AttributeCertificateVersion1 2153 References 2155 3DES American National Standards Institute. ANSI X9.52-1998, 2156 Triple Data Encryption Algorithm Modes of Operation. 1998. 2158 ACPROFILE Farrell, S., and R. Housley. An Internet Attribute 2159 Certificate Profile for Authorization. RFC . . 2160 {draft-ietf-pkix-ac509prof-*.txt} 2162 CMSALG Housley, R. Cryptographic Message Syntax (CMS) Algorithms. 2163 RFC . . {draft-ietf-smime-cmsalg-*.txt} 2165 DES American National Standards Institute. ANSI X3.106, 2166 "American National Standard for Information Systems - Data 2167 Link Encryption". 1983. 2169 DH-X9.42 Rescorla, E. Diffie-Hellman Key Agreement Method. 2170 RFC 2631. June 1999. 2172 DSS National Institute of Standards and Technology. 2173 FIPS Pub 186: Digital Signature Standard. 19 May 1994. 2175 ESS Hoffman, P. Enhanced Security Services for S/MIME. 2176 RFC 2634. June 1999. 2178 HMAC Krawczyk, H. HMAC: Keyed-Hashing for Message Authentication. 2179 RFC 2104. February 1997. 2181 MD5 Rivest, R. The MD5 Message-Digest Algorithm. RFC 1321. 2182 April 1992. 2184 MODES National Institute of Standards and Technology. 2185 FIPS Pub 81: DES Modes of Operation. 2 December 1980. 2187 MSG Ramsdell, B. S/MIME Version 3 Message Specification. 2188 RFC 2633. June 1999. 2190 NEWPKCS#1 Kaliski, B., and J. Staddon. PKCS #1: RSA Encryption, 2191 Version 2.0. RFC 2437. October 1998. 2193 OLDCMS Housley, R., "Cryptographic Message Syntax", RFC 2630, 2194 June 1999. 2196 PROFILE Housley, R., W. Ford, W. Polk, and D. Solo. Internet 2197 X.509 Public Key Infrastructure: Certificate and CRL 2198 Profile. RFC . . 2199 [draft-ietf-pkix-new-part1-*.txt] 2201 PKCS#1 Kaliski, B. PKCS #1: RSA Encryption, Version 1.5. 2202 RFC 2313. March 1998. 2204 PKCS#6 RSA Laboratories. PKCS #6: Extended-Certificate Syntax 2205 Standard, Version 1.5. November 1993. 2207 PKCS#7 Kaliski, B. PKCS #7: Cryptographic Message Syntax, 2208 Version 1.5. RFC 2315. March 1998. 2210 PKCS#9 RSA Laboratories. PKCS #9: Selected Attribute Types, 2211 Version 1.1. November 1993. 2213 PWRI Gutmann, P. Password-based Encryption for S/MIME. 2214 RFC . . [draft-ietf-smime-password-*.txt] 2216 RANDOM Eastlake, D., S. Crocker, and J. Schiller. Randomness 2217 Recommendations for Security. RFC 1750. December 1994. 2219 RC2 Rivest, R. A Description of the RC2 (r) Encryption Algorithm. 2220 RFC 2268. March 1998. 2222 SHA1 National Institute of Standards and Technology. 2223 FIPS Pub 180-1: Secure Hash Standard. 17 April 1995. 2225 STDWORDS Bradner, S. Key Words for Use in RFCs to Indicate 2226 Requirement Levels. RFC2119. March 1997. 2228 X.208-88 CCITT. Recommendation X.208: Specification of Abstract 2229 Syntax Notation One (ASN.1). 1988. 2231 X.209-88 CCITT. Recommendation X.209: Specification of Basic Encoding 2232 Rules for Abstract Syntax Notation One (ASN.1). 1988. 2234 X.501-88 CCITT. Recommendation X.501: The Directory - Models. 1988. 2236 X.509-88 CCITT. Recommendation X.509: The Directory - Authentication 2237 Framework. 1988. 2239 X.509-97 ITU-T. Recommendation X.509: The Directory - Authentication 2240 Framework. 1997. 2242 X.509-00 ITU-T. Recommendation X.509: The Directory - Authentication 2243 Framework. 2000. 2245 Security Considerations 2247 The Cryptographic Message Syntax provides a method for digitally 2248 signing data, digesting data, encrypting data, and authenticating 2249 data. 2251 Implementations must protect the signer's private key. Compromise of 2252 the signer's private key permits masquerade. 2254 Implementations must protect the key management private key, the key- 2255 encryption key, and the content-encryption key. Compromise of the 2256 key management private key or the key-encryption key may result in 2257 the disclosure of all messages protected with that key. Similarly, 2258 compromise of the content-encryption key may result in disclosure of 2259 the associated encrypted content. 2261 Implementations must protect the key management private key and the 2262 message-authentication key. Compromise of the key management private 2263 key permits masquerade of authenticated data. Similarly, compromise 2264 of the message-authentication key may result in undetectable 2265 modification of the authenticated content. 2267 [*** NEW ***] The key management technique employed to distribute 2268 message-authentication keys must itself provide data origin 2269 authentication, otherwise the message content is delivered with 2270 integrity from an unknown source. Neither RSA [PKCS#1, NEWPKCS#1] 2271 nor Ephemeral-Static Diffie-Hellman [DH-X9.42] provide the necessary 2272 data origin authentication. Static-Static Diffie-Hellman [DH-X9.42] 2273 does provide the necessary data origin authentication when both the 2274 originator and recipient public keys are bound to appropriate 2275 identities in X.509 certificates. 2277 [*** NEW ***] When more than two parties share the same message- 2278 authentication key, data origin authentication is not provided. Any 2279 party that knows the message-authentication key can compute a valid 2280 MAC, therefore the message could originate from any one of the 2281 parties. 2283 Implementations must randomly generate content-encryption keys, 2284 message-authentication keys, initialization vectors (IVs), and 2285 padding. Also, the generation of public/private key pairs relies on 2286 a random numbers. The use of inadequate pseudo-random number 2287 generators (PRNGs) to generate cryptographic keys can result in 2288 little or no security. An attacker may find it much easier to 2289 reproduce the PRNG environment that produced the keys, searching the 2290 resulting small set of possibilities, rather than brute force 2291 searching the whole key space. The generation of quality random 2292 numbers is difficult. RFC 1750 [RANDOM] offers important guidance in 2293 this area, and Appendix 3 of FIPS Pub 186 [DSS] provides one quality 2294 PRNG technique. 2296 When using key agreement algorithms or previously distributed 2297 symmetric key-encryption keys, a key-encryption key is used to 2298 encrypt the content-encryption key. If the key-encryption and 2299 content-encryption algorithms are different, the effective security 2300 is determined by the weaker of the two algorithms. If, for example, 2301 a message content is encrypted with 168-bit Triple-DES and the 2302 Triple-DES content-encryption key is wrapped with a 40-bit RC2 key, 2303 then at most 40 bits of protection is provided. A trivial search to 2304 determine the value of the 40-bit RC2 key can recover Triple-DES key, 2305 and then the Triple-DES key can be used to decrypt the content. 2306 Therefore, implementers must ensure that key-encryption algorithms 2307 are as strong or stronger than content-encryption algorithms. 2309 Implementers should be aware that cryptographic algorithms become 2310 weaker with time. As new cryptoanalysis techniques are developed and 2311 computing performance improves, the work factor to break a particular 2312 cryptographic algorithm will reduce. Therefore, cryptographic 2313 algorithm implementations should be modular allowing new algorithms 2314 to be readily inserted. That is, implementers should be prepared for 2315 the set of mandatory to implement algorithms to change over time. 2317 The countersignature unsigned attribute includes a digital signature 2318 that is computed on the content signature value, thus the 2319 countersigning process need not know the original signed content. 2320 This structure permits implementation efficiency advantages; however, 2321 this structure may also permit the countersigning of an inappropriate 2322 signature value. Therefore, implementations that perform 2323 countersignatures should either verify the original signature value 2324 prior to countersigning it (this verification requires processing of 2325 the original content), or implementations should perform 2326 countersigning in a context that ensures that only appropriate 2327 signature values are countersigned. 2329 Users of the CMS, particularly those employing the CMS to support 2330 interactive applications, should be aware that PKCS #1 Version 1.5 as 2331 specified in RFC 2313 [PKCS#1] is vulnerable to adaptive chosen 2332 ciphertext attacks when applied for encryption purposes. 2333 Exploitation of this identified vulnerability, revealing the result 2334 of a particular RSA decryption, requires access to an oracle which 2335 will respond to a large number of ciphertexts (based on currently 2336 available results, hundreds of thousands or more), which are 2337 constructed adaptively in response to previously-received replies 2338 providing information on the successes or failures of attempted 2339 decryption operations. As a result, the attack appears significantly 2340 less feasible to perpetrate for store-and-forward S/MIME environments 2341 than for directly interactive protocols. Where the CMS constructs 2342 are applied as an intermediate encryption layer within an interactive 2343 request-response communications environment, exploitation could be 2344 more feasible. 2346 An updated version of PKCS #1 has been published, PKCS #1 Version 2.0 2347 [NEWPKCS#1]. This new document will supersede RFC 2313. PKCS #1 2348 Version 2.0 preserves support for the encryption padding format 2349 defined in PKCS #1 Version 1.5 [PKCS#1], and it also defines a new 2350 alternative. To resolve the adaptive chosen ciphertext 2351 vulnerability, the PKCS #1 Version 2.0 specifies and recommends use 2352 of Optimal Asymmetric Encryption Padding (OAEP) when RSA encryption 2353 is used to provide confidentiality. Designers of protocols and 2354 systems employing the CMS for interactive environments should either 2355 consider usage of OAEP, or should ensure that information which could 2356 reveal the success or failure of attempted PKCS #1 Version 1.5 2357 decryption operations is not provided. Support for OAEP will likely 2358 be added to a future version of this specification. 2360 Acknowledgments 2362 This document is the result of contributions from many professionals. 2363 I appreciate the hard work of all members of the IETF S/MIME Working 2364 Group. I extend a special thanks to Rich Ankney, Simon Blake-Wilson, 2365 Tim Dean, Steve Dusse, Carl Ellison, Peter Gutmann, Bob Jueneman, 2366 Stephen Henson, Paul Hoffman, Scott Hollenbeck, Don Johnson, Burt 2367 Kaliski, John Linn, John Pawling, Blake Ramsdell, Francois Rousseau, 2368 Jim Schaad, and Dave Solo for their efforts and support. 2370 Author Address 2372 Russell Housley 2373 RSA Laboratories 2374 918 Spring Knoll Drive 2375 Herndon, VA 20170 2376 USA 2378 rhousley@rsasecurity.com 2380 Full Copyright Statement 2382 Copyright (C) The Internet Society (date). All Rights Reserved. 2384 This document and translations of it may be copied and furnished to 2385 others, and derivative works that comment on or otherwise explain it 2386 or assist in its implementation may be prepared, copied, published 2387 and distributed, in whole or in part, without restriction of any 2388 kind, provided that the above copyright notice and this paragraph are 2389 included on all such copies and derivative works. In addition, the 2390 ASN.1 module presented in Appendix A may be used in whole or in part 2391 without inclusion of the copyright notice. However, this document 2392 itself may not be modified in any way, such as by removing the 2393 copyright notice or references to the Internet Society or other 2394 Internet organizations, except as needed for the purpose of 2395 developing Internet standards in which case the procedures for 2396 copyrights defined in the Internet Standards process shall be 2397 followed, or as required to translate it into languages other than 2398 English. 2400 The limited permissions granted above are perpetual and will not be 2401 revoked by the Internet Society or its successors or assigns. This 2402 document and the information contained herein is provided on an "AS 2403 IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK 2404 FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT 2405 LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL 2406 NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY 2407 OR FITNESS FOR A PARTICULAR PURPOSE.