idnits 2.17.1 draft-ietf-smime-rfc3369bis-02.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: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. == No 'Intended status' indicated for this document; assuming Proposed Standard 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.) ** There are 4 instances of too long lines in the document, the longest one being 2 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- 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 (March 2004) is 7341 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '0' on line 2307 -- Looks like a reference, but probably isn't: '1' on line 2309 -- Looks like a reference, but probably isn't: '2' on line 2172 -- Looks like a reference, but probably isn't: '3' on line 2173 -- Looks like a reference, but probably isn't: '4' on line 2046 ** Obsolete normative reference: RFC 3281 (ref. 'ACPROFILE') (Obsoleted by RFC 5755) ** Obsolete normative reference: RFC 3280 (ref. 'PROFILE') (Obsoleted by RFC 5280) -- Obsolete informational reference (is this intentional?): RFC 2630 (ref. 'CMS1') (Obsoleted by RFC 3369, RFC 3370) -- Obsolete informational reference (is this intentional?): RFC 3369 (ref. 'CMS2') (Obsoleted by RFC 3852) -- Obsolete informational reference (is this intentional?): RFC 2633 (ref. 'MSG') (Obsoleted by RFC 3851) -- Obsolete informational reference (is this intentional?): RFC 2560 (ref. 'OCSP') (Obsoleted by RFC 6960) -- Obsolete informational reference (is this intentional?): RFC 3211 (ref. 'PWRI') (Obsoleted by RFC 3369, RFC 3370) -- Obsolete informational reference (is this intentional?): RFC 1750 (ref. 'RANDOM') (Obsoleted by RFC 4086) Summary: 9 errors (**), 0 flaws (~~), 3 warnings (==), 13 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 S/MIME Working Group R. Housley 2 Internet-Draft Vigil Security 3 When Approved, Obsoletes: 3369 March 2004 5 Cryptographic Message Syntax (CMS) 7 9 Status of this Memo 11 This document is an Internet-Draft and is in full conformance with 12 all provisions of Section 10 of RFC2026. Internet-Drafts are working 13 documents of the Internet Engineering Task Force (IETF), its areas, 14 and its working groups. Note that other groups may also distribute 15 working documents as Internet-Drafts. 17 Internet-Drafts are draft documents valid for a maximum of six months 18 and may be updated, replaced, or obsoleted by other documents at any 19 time. It is inappropriate to use Internet-Drafts as reference 20 material or to cite them other than as "work in progress." 22 To view the entire list of current Internet-Drafts, please check the 23 "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow 24 Directories on ftp.is.co.za (Africa), ftp.nordu.net (Northern 25 Europe), ftp.nis.garr.it (Southern Europe), munnari.oz.au (Pacific 26 Rim), ftp.ietf.org (US East Coast), or ftp.isi.edu (US West Coast). 28 Copyright Notice 30 Copyright (C) The Internet Society (2004). All Rights Reserved. 32 Abstract 34 This document describes the Cryptographic Message Syntax (CMS). This 35 syntax is used to digitally sign, digest, authenticate, or encrypt 36 arbitrary message content. 38 Table of Contents 40 1 Introduction ............................................. ?? 41 1.1 Changes Since RFC 2630 ................................... ?? 42 1.2 Changes Since RFC 3369 ................................... ?? 43 1.3 Terminology .............................................. ?? 44 2 General Overview ......................................... ?? 45 3 General Syntax ........................................... ?? 46 4 Data Content Type ........................................ ?? 47 5 Signed-data Content Type ................................. ?? 48 5.1 SignedData Type .......................................... ?? 49 5.2 EncapsulatedContentInfo Type ............................. ?? 50 5.2.1 Compatibility with PKCS #7 ............................... ?? 51 5.3 SignerInfo Type .......................................... ?? 52 5.4 Message Digest Calculation Process ....................... ?? 53 5.5 Signature Generation Process ............................. ?? 54 5.6 Signature Verification Process ........................... ?? 55 6 Enveloped-data Content Type .............................. ?? 56 6.1 EnvelopedData Type ....................................... ?? 57 6.2 RecipientInfo Type ....................................... ?? 58 6.2.1 KeyTransRecipientInfo Type ............................... ?? 59 6.2.2 KeyAgreeRecipientInfo Type ............................... ?? 60 6.2.3 KEKRecipientInfo Type .................................... ?? 61 6.2.4 PasswordRecipientInfo Type ............................... ?? 62 6.2.5 OtherRecipientInfo Type .................................. ?? 63 6.3 Content-encryption Process ............................... ?? 64 6.4 Key-encryption Process ................................... ?? 65 7 Digested-data Content Type ............................... ?? 66 8 Encrypted-data Content Type .............................. ?? 67 9 Authenticated-data Content Type .......................... ?? 68 9.1 AuthenticatedData Type ................................... ?? 69 9.2 MAC Generation ........................................... ?? 70 9.3 MAC Verification ......................................... ?? 71 10 Useful Types ............................................. ?? 72 10.1 Algorithm Identifier Types ............................... ?? 73 10.1.1 DigestAlgorithmIdentifier ................................ ?? 74 10.1.2 SignatureAlgorithmIdentifier ............................. ?? 75 10.1.3 KeyEncryptionAlgorithmIdentifier ......................... ?? 76 10.1.4 ContentEncryptionAlgorithmIdentifier ..................... ?? 77 10.1.5 MessageAuthenticationCodeAlgorithm ....................... ?? 78 10.1.6 KeyDerivationAlgorithmIdentifier ......................... ?? 79 10.2 Other Useful Types ....................................... ?? 80 10.2.1 RevocationInfoChoices .................................... ?? 81 10.2.2 CertificateChoices ....................................... ?? 82 10.2.3 CertificateSet ........................................... ?? 83 10.2.4 IssuerAndSerialNumber .................................... ?? 84 10.2.5 CMSVersion ............................................... ?? 85 10.2.6 UserKeyingMaterial ....................................... ?? 86 10.2.7 OtherKeyAttribute ........................................ ?? 87 11 Useful Attributes ........................................ ?? 88 11.1 Content Type ............................................. ?? 89 11.2 Message Digest ........................................... ?? 90 11.3 Signing Time ............................................. ?? 91 11.4 Countersignature ......................................... ?? 92 12 ASN.1 Modules ............................................ ?? 93 12.1 CMS ASN.1 Module ......................................... ?? 94 12.2 Version 1 Attribute Certificate ASN.1 Module ............. ?? 95 13 Normative References ..................................... ?? 96 14 Informative References ................................... ?? 97 15 Security Considerations .................................. ?? 98 16 Acknowledgments .......................................... ?? 99 17 Author Address ........................................... ?? 100 18 Full Copyright Statement ................................. ?? 102 1. Introduction 104 This document describes the Cryptographic Message Syntax (CMS). This 105 syntax is used to digitally sign, digest, authenticate, or encrypt 106 arbitrary message content. 108 The CMS describes an encapsulation syntax for data protection. It 109 supports digital signatures and encryption. The syntax allows 110 multiple encapsulations; one encapsulation envelope can be nested 111 inside another. Likewise, one party can digitally sign some 112 previously encapsulated data. It also allows arbitrary attributes, 113 such as signing time, to be signed along with the message content, 114 and provides for other attributes such as countersignatures to be 115 associated with a signature. 117 The CMS can support a variety of architectures for certificate-based 118 key management, such as the one defined by the PKIX working group 119 [PROFILE]. 121 The CMS values are generated using ASN.1 [X.208-88], using BER- 122 encoding [X.209-88]. Values are typically represented as octet 123 strings. While many systems are capable of transmitting arbitrary 124 octet strings reliably, it is well known that many electronic mail 125 systems are not. This document does not address mechanisms for 126 encoding octet strings for reliable transmission in such 127 environments. 129 The CMS is derived from PKCS #7 version 1.5 as specified in RFC 2315 130 [PKCS#7]. Wherever possible, backward compatibility is preserved; 131 however, changes were necessary to accommodate version 1 attribute 132 certificate transfer, key agreement and symmetric key-encryption key 133 techniques for key management. 135 1.1 Changes Since RFC 2630 137 RFC 3369 [CMS2] obsoletes RFC 2630 [CMS1] and RFC 3211 [PWRI]. 138 Password-based key management is included in the CMS specification, 139 and an extension mechanism to support new key management schemes 140 without further changes to the CMS is specified. Backward 141 compatibility with RFC 2630 and RFC 3211 is preserved; however, 142 version 2 attribute certificate transfer is added. The use of 143 version 1 attribute certificates is deprecated. 145 S/MIME v2 signatures [OLDMSG], which are based on PKCS#7 version 1.5, 146 are compatible with S/MIME v3 signatures [MSG], which are based on 147 RFC 2630. However, there are some subtle compatibility issues with 148 signatures using PKCS#7 version 1.5 and the CMS. These issues are 149 discussed in section 5.2.1. 151 Specific cryptographic algorithms are not discussed in this document, 152 but they were discussed in RFC 2630. The discussion of specific 153 cryptographic algorithms has been moved to a separate document 154 [CMSALG]. Separation of the protocol and algorithm specifications 155 allows the IETF to update each document independently. This 156 specification does not require the implementation of any particular 157 algorithms. Rather, protocols that rely on the CMS are expected to 158 choose appropriate algorithms for their environment. The algorithms 159 may be selected from [CMSALG] or elsewhere. 161 1.2 Changes Since RFC 3369 163 This document obsoletes RFC 3369 [CMS2]. As discussed in the 164 previous section, RFC 3369 introduced an extension mechanism to 165 support new key management schemes without further changes to the 166 CMS. This document introduces a similar extension mechanism to 167 support additional certificate formats and revocation status 168 information formats without further changes to the CMS. These 169 extensions are primarily documented in section 10.2.1 and section 170 10.2.2. Backward compatibility with both RFC 2630 and RFC 3369 is 171 preserved. 173 Since the publication of RFC 3369, a few errata have been noted. 174 These errata are posted on the RFC Editor web site. These errors 175 have been corrected in this document. 177 The text in section 11.4 that describes the counter signature 178 unsigned attribute is clarified. Hopefully the revised text is 179 clearer about the portion of the SignerInfo signature that is covered 180 by a countersignature. 182 1.3 Terminology 184 In this document, the key words MUST, MUST NOT, REQUIRED, SHOULD, 185 SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL are to be interpreted as 186 described in [STDWORDS]. 188 2 General Overview 190 The CMS is general enough to support many different content types. 191 This document defines one protection content, ContentInfo. 192 ContentInfo encapsulates a single identified content type, and the 193 identified type may provide further encapsulation. This document 194 defines six content types: data, signed-data, enveloped-data, 195 digested-data, encrypted-data, and authenticated-data. Additional 196 content types can be defined outside this document. 198 An implementation that conforms to this specification MUST implement 199 the protection content, ContentInfo, and MUST implement the data, 200 signed-data, and enveloped-data content types. The other content 201 types MAY be implemented. 203 As a general design philosophy, each content type permits single pass 204 processing using indefinite-length Basic Encoding Rules (BER) 205 encoding. Single-pass operation is especially helpful if content is 206 large, stored on tapes, or is "piped" from another process. Single- 207 pass operation has one significant drawback: it is difficult to 208 perform encode operations using the Distinguished Encoding Rules 209 (DER) [X.509-88] encoding in a single pass since the lengths of the 210 various components may not be known in advance. However, signed 211 attributes within the signed-data content type and authenticated 212 attributes within the authenticated-data content type need to be 213 transmitted in DER form to ensure that recipients can verify a 214 content that contains one or more unrecognized attributes. Signed 215 attributes and authenticated attributes are the only data types used 216 in the CMS that require DER encoding. 218 3 General Syntax 220 The following object identifier identifies the content information 221 type: 223 id-ct-contentInfo OBJECT IDENTIFIER ::= { iso(1) member-body(2) 224 us(840) rsadsi(113549) pkcs(1) pkcs9(9) smime(16) ct(1) 6 } 226 The CMS associates a content type identifier with a content. The 227 syntax MUST have ASN.1 type ContentInfo: 229 ContentInfo ::= SEQUENCE { 230 contentType ContentType, 231 content [0] EXPLICIT ANY DEFINED BY contentType } 233 ContentType ::= OBJECT IDENTIFIER 235 The fields of ContentInfo have the following meanings: 237 contentType indicates the type of the associated content. It is 238 an object identifier; it is a unique string of integers assigned 239 by an authority that defines the content type. 241 content is the associated content. The type of content can be 242 determined uniquely by contentType. Content types for data, 243 signed-data, enveloped-data, digested-data, encrypted-data, and 244 authenticated-data are defined in this document. If additional 245 content types are defined in other documents, the ASN.1 type 246 defined SHOULD NOT be a CHOICE type. 248 4 Data Content Type 250 The following object identifier identifies the data content type: 252 id-data OBJECT IDENTIFIER ::= { iso(1) member-body(2) 253 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 1 } 255 The data content type is intended to refer to arbitrary octet 256 strings, such as ASCII text files; the interpretation is left to the 257 application. Such strings need not have any internal structure 258 (although they could have their own ASN.1 definition or other 259 structure). 261 S/MIME uses id-data to identify MIME encoded content. The use of 262 this content identifier is specified in RFC 2311 for S/MIME v2 263 [OLDMSG] and RFC 2633 for S/MIME v3 [MSG]. 265 The data content type is generally encapsulated in the signed-data, 266 enveloped-data, digested-data, encrypted-data, or authenticated-data 267 content type. 269 5. Signed-data Content Type 271 The signed-data content type consists of a content of any type and 272 zero or more signature values. Any number of signers in parallel can 273 sign any type of content. 275 The typical application of the signed-data content type represents 276 one signer's digital signature on content of the data content type. 277 Another typical application disseminates certificates and certificate 278 revocation lists (CRLs). 280 The process by which signed-data is constructed involves the 281 following steps: 283 1. For each signer, a message digest, or hash value, is computed 284 on the content with a signer-specific message-digest algorithm. 285 If the signer is signing any information other than the content, 286 the message digest of the content and the other information are 287 digested with the signer's message digest algorithm (see Section 288 5.4), and the result becomes the "message digest." 290 2. For each signer, the message digest is digitally signed using 291 the signer's private key. 293 3. For each signer, the signature value and other signer-specific 294 information are collected into a SignerInfo value, as defined in 295 Section 5.3. Certificates and CRLs for each signer, and those not 296 corresponding to any signer, are collected in this step. 298 4. The message digest algorithms for all the signers and the 299 SignerInfo values for all the signers are collected together with 300 the content into a SignedData value, as defined in Section 5.1. 302 A recipient independently computes the message digest. This message 303 digest and the signer's public key are used to verify the signature 304 value. The signer's public key is referenced either by an issuer 305 distinguished name along with an issuer-specific serial number or by 306 a subject key identifier that uniquely identifies the certificate 307 containing the public key. The signer's certificate can be included 308 in the SignedData certificates field. 310 This section is divided into six parts. The first part describes the 311 top-level type SignedData, the second part describes 312 EncapsulatedContentInfo, the third part describes the per-signer 313 information type SignerInfo, and the fourth, fifth, and sixth parts 314 describe the message digest calculation, signature generation, and 315 signature verification processes, respectively. 317 5.1 SignedData Type 319 The following object identifier identifies the signed-data content 320 type: 322 id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 323 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 } 325 The signed-data content type shall have ASN.1 type SignedData: 327 SignedData ::= SEQUENCE { 328 version CMSVersion, 329 digestAlgorithms DigestAlgorithmIdentifiers, 330 encapContentInfo EncapsulatedContentInfo, 332 certificates [0] IMPLICIT CertificateSet OPTIONAL, 333 crls [1] IMPLICIT RevocationInfoChoices OPTIONAL, 334 signerInfos SignerInfos } 336 DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier 338 SignerInfos ::= SET OF SignerInfo 340 The fields of type SignedData have the following meanings: 342 version is the syntax version number. The appropriate value 343 depends on certificates, eContentType, and SignerInfo. The 344 version MUST be assigned as follows: 346 IF ((certificates is present) AND 347 (any certificates with a type of other are present)) OR 348 ((crls is present) AND 349 (any crls with a type of other are present)) 350 THEN version MUST be 5 351 ELSE 352 IF (certificates is present) AND 353 (any version 2 attribute certificates are present) 354 THEN version MUST be 4 355 ELSE 356 IF ((certificates is present) AND 357 (any version 1 attribute certificates are present)) OR 358 (any SignerInfo structures are version 3) OR 359 (encapContentInfo eContentType is other than id-data) 360 THEN version MUST be 3 361 ELSE version MUST be 1 363 digestAlgorithms is a collection of message digest algorithm 364 identifiers. There MAY be any number of elements in the 365 collection, including zero. Each element identifies the message 366 digest algorithm, along with any associated parameters, used by 367 one or more signer. The collection is intended to list the 368 message digest algorithms employed by all of the signers, in any 369 order, to facilitate one-pass signature verification. 370 Implementations MAY fail to validate signatures that use a digest 371 algorithm that is not included in this set. The message digesting 372 process is described in Section 5.4. 374 encapContentInfo is the signed content, consisting of a content 375 type identifier and the content itself. Details of the 376 EncapsulatedContentInfo type are discussed in section 5.2. 378 certificates is a collection of certificates. It is intended that 379 the set of certificates be sufficient to contain certification 380 paths from a recognized "root" or "top-level certification 381 authority" to all of the 383 signers in the signerInfos field. There may be more certificates 384 than necessary, and there may be certificates sufficient to 385 contain certification paths from two or more independent top-level 386 certification authorities. There may also be fewer certificates 387 than necessary, if it is expected that recipients have an 388 alternate means of obtaining necessary certificates (e.g., from a 389 previous set of certificates). The signer's certificate MAY be 390 included. The use of version 1 attribute certificates is strongly 391 discouraged. 393 crls is a collection of revocation status information. It is 394 intended that the collection contain information sufficient to 395 determine whether the certificates in the certificates field are 396 valid, but such correspondence is not necessary. Certificate 397 revocation lists (CRLs) are the primary source of revocation 398 status information. There MAY be more CRLs than necessary, and 399 there MAY also be fewer CRLs than necessary. 401 signerInfos is a collection of per-signer information. There MAY 402 be any number of elements in the collection, including zero. The 403 details of the SignerInfo type are discussed in section 5.3. 404 Since each signer can employ a digital signature technique and 405 future specifications could update the syntax, all implementations 406 MUST gracefully handle unimplemented versions of SignerInfo. 407 Further, since all implementations will not support every possible 408 signature algorithm, all implementations MUST gracefully handle 409 unimplemented signature algorithms when they are encountered. 411 5.2 EncapsulatedContentInfo Type 413 The content is represented in the type EncapsulatedContentInfo: 415 EncapsulatedContentInfo ::= SEQUENCE { 416 eContentType ContentType, 417 eContent [0] EXPLICIT OCTET STRING OPTIONAL } 419 ContentType ::= OBJECT IDENTIFIER 421 The fields of type EncapsulatedContentInfo have the following 422 meanings: 424 eContentType is an object identifier. The object identifier 425 uniquely specifies the content type. 427 eContent is the content itself, carried as an octet string. The 428 eContent need not be DER encoded. 430 The optional omission of the eContent within the 431 EncapsulatedContentInfo field makes it possible to construct 432 "external signatures." In the case of external signatures, the 433 content being signed is absent from the EncapsulatedContentInfo value 434 included in the signed-data content type. If the eContent value 435 within EncapsulatedContentInfo is absent, then the signatureValue is 436 calculated and the eContentType is assigned as though the eContent 437 value was present. 439 In the degenerate case where there are no signers, the 440 EncapsulatedContentInfo value being "signed" is irrelevant. In this 441 case, the content type within the EncapsulatedContentInfo value being 442 "signed" MUST be id-data (as defined in section 4), and the content 443 field of the EncapsulatedContentInfo value MUST be omitted. 445 5.2.1 Compatibility with PKCS #7 447 This section contains a word of warning to implementers that wish to 448 support both the CMS and PKCS #7 [PKCS#7] SignedData content types. 449 Both the CMS and PKCS #7 identify the type of the encapsulated 450 content with an object identifier, but the ASN.1 type of the content 451 itself is variable in PKCS #7 SignedData content type. 453 PKCS #7 defines content as: 455 content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL 457 The CMS defines eContent as: 459 eContent [0] EXPLICIT OCTET STRING OPTIONAL 461 The CMS definition is much easier to use in most applications, and it 462 is compatible with both S/MIME v2 and S/MIME v3. S/MIME signed 463 messages using the CMS and PKCS #7 are compatible because identical 464 signed message formats are specified in RFC 2311 for S/MIME v2 465 [OLDMSG] and RFC 2633 for S/MIME v3 [MSG]. S/MIME v2 encapsulates 466 the MIME content in a Data type (that is, an OCTET STRING) carried in 467 the SignedData contentInfo content ANY field, and S/MIME v3 carries 468 the MIME content in the SignedData encapContentInfo eContent OCTET 469 STRING. Therefore, in both S/MIME v2 and S/MIME v3, the MIME content 470 is placed in an OCTET STRING and the message digest is computed over 471 the identical portions of the content. That is, the message digest 472 is computed over the octets comprising the value of the OCTET STRING, 473 neither the tag nor length octets are included. 475 There are incompatibilities between the CMS and PKCS #7 SignedData 476 types when the encapsulated content is not formatted using the Data 477 type. For example, when an RFC 2634 [ESS] signed receipt is 478 encapsulated in the CMS SignedData type, then the Receipt SEQUENCE is 479 encoded in the SignedData encapContentInfo eContent OCTET STRING and 480 the message digest is computed using the entire Receipt SEQUENCE 481 encoding (including tag, length and value octets). However, if an 482 RFC 2634 signed receipt is encapsulated in the PKCS #7 SignedData 483 type, then the Receipt SEQUENCE is DER encoded [X.509-88] in the 484 SignedData contentInfo content ANY field (a SEQUENCE, not an OCTET 485 STRING). Therefore, the message digest is computed using only the 486 value octets of the Receipt SEQUENCE encoding. 488 The following strategy can be used to achieve backward compatibility 489 with PKCS #7 when processing SignedData content types. If the 490 implementation is unable to ASN.1 decode the SignedData type using 491 the CMS SignedData encapContentInfo eContent OCTET STRING syntax, 492 then the implementation MAY attempt to decode the SignedData type 493 using the PKCS #7 SignedData contentInfo content ANY syntax and 494 compute the message digest accordingly. 496 The following strategy can be used to achieve backward compatibility 497 with PKCS #7 when creating a SignedData content type in which the 498 encapsulated content is not formatted using the Data type. 499 Implementations MAY examine the value of the eContentType, and then 500 adjust the expected DER encoding of eContent based on the object 501 identifier value. For example, to support Microsoft AuthentiCode, 502 the following information MAY be included: 504 eContentType Object Identifier is set to { 1 3 6 1 4 1 311 2 1 4 } 506 eContent contains DER encoded AuthentiCode signing information 508 5.3 SignerInfo Type 510 Per-signer information is represented in the type SignerInfo: 512 SignerInfo ::= SEQUENCE { 513 version CMSVersion, 514 sid SignerIdentifier, 515 digestAlgorithm DigestAlgorithmIdentifier, 516 signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL, 517 signatureAlgorithm SignatureAlgorithmIdentifier, 518 signature SignatureValue, 519 unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL } 521 SignerIdentifier ::= CHOICE { 522 issuerAndSerialNumber IssuerAndSerialNumber, 523 subjectKeyIdentifier [0] SubjectKeyIdentifier } 525 SignedAttributes ::= SET SIZE (1..MAX) OF Attribute 527 UnsignedAttributes ::= SET SIZE (1..MAX) OF Attribute 529 Attribute ::= SEQUENCE { 530 attrType OBJECT IDENTIFIER, 531 attrValues SET OF AttributeValue } 533 AttributeValue ::= ANY 535 SignatureValue ::= OCTET STRING 537 The fields of type SignerInfo have the following meanings: 539 version is the syntax version number. If the SignerIdentifier is 540 the CHOICE issuerAndSerialNumber, then the version MUST be 1. If 541 the SignerIdentifier is subjectKeyIdentifier, then the version 542 MUST be 3. 544 sid specifies the signer's certificate (and thereby the signer's 545 public key). The signer's public key is needed by the recipient 546 to verify the signature. SignerIdentifier provides two 547 alternatives for specifying the signer's public key. The 548 issuerAndSerialNumber alternative identifies the signer's 549 certificate by the issuer's distinguished name and the certificate 550 serial number; the subjectKeyIdentifier identifies the signer's 551 certificate by a key identifier. When an X.509 certificate is 552 reference, the key identifier matches the X.509 553 subjectKeyIdentifier extension value. When other certificate 554 formats are referenced, the documents that specify the certificate 555 format and their use with the CMS must include details on matching 556 the key identifier to the appropriate certificate field. 557 Implementations MUST support the reception of the 558 issuerAndSerialNumber and subjectKeyIdentifier forms of 559 SignerIdentifier. When generating a SignerIdentifier, 560 implementations MAY support one of the forms (either 561 issuerAndSerialNumber or subjectKeyIdentifier) and always use it, 562 or implementations MAY arbitrarily mix the two forms. However, 563 subjectKeyIdentifier MUST be used to refer to a public key 564 contained in a non-X.509 certificate. 566 digestAlgorithm identifies the message digest algorithm, and any 567 associated parameters, used by the signer. The message digest is 568 computed on either the content being signed or the content 569 together with the signed attributes using the process described in 570 section 5.4. The message digest algorithm SHOULD be among those 571 listed in the digestAlgorithms field of the associated SignerData. 572 Implementations MAY fail to validate signatures that use a digest 573 algorithm that is not included in the SignedData digestAlgorithms 574 set. 576 signedAttrs is a collection of attributes that are signed. The 577 field is optional, but it MUST be present if the content type of 578 the EncapsulatedContentInfo value being signed is not id-data. 579 SignedAttributes MUST be DER encoded, even if the rest of the 580 structure is BER encoded. Useful attribute types, such as signing 581 time, are defined in Section 11. If the field is present, it MUST 582 contain, at a minimum, the following two attributes: 584 A content-type attribute having as its value the content type 585 of the EncapsulatedContentInfo value being signed. Section 586 11.1 defines the content-type attribute. However, the content- 587 type attribute MUST NOT be used as part of a countersignature 588 unsigned attribute as defined in section 11.4. 590 A message-digest attribute, having as its value the message 591 digest of the content. Section 11.2 defines the message-digest 592 attribute. 594 signatureAlgorithm identifies the signature algorithm, and any 595 associated parameters, used by the signer to generate the digital 596 signature. 598 signature is the result of digital signature generation, using the 599 message digest and the signer's private key. The details of the 600 signature depend on the signature algorithm employed. 602 unsignedAttrs is a collection of attributes that are not signed. 603 The field is optional. Useful attribute types, such as 604 countersignatures, are defined in Section 11. 606 The fields of type SignedAttribute and UnsignedAttribute have the 607 following meanings: 609 attrType indicates the type of attribute. It is an object 610 identifier. 612 attrValues is a set of values that comprise the attribute. The 613 type of each value in the set can be determined uniquely by 614 attrType. The attrType can impose restrictions on the number of 615 items in the set. 617 5.4 Message Digest Calculation Process 619 The message digest calculation process computes a message digest on 620 either the content being signed or the content together with the 621 signed attributes. In either case, the initial input to the message 622 digest calculation process is the "value" of the encapsulated content 623 being signed. Specifically, the initial input is the 624 encapContentInfo eContent OCTET STRING to which the signing process 625 is applied. Only the octets comprising the value of the eContent 626 OCTET STRING are input to the message digest algorithm, not the tag 627 or the length octets. 629 The result of the message digest calculation process depends on 630 whether the signedAttrs field is present. When the field is absent, 631 the result is just the message digest of the content as described 632 above. When the field is present, however, the result is the message 633 digest of the complete DER encoding of the SignedAttrs value 634 contained in the signedAttrs field. Since the SignedAttrs value, 635 when present, must contain the content-type and the message-digest 636 attributes, those values are indirectly included in the result. The 637 content-type attribute MUST NOT be included in a countersignature 638 unsigned attribute as defined in section 11.4. A separate encoding 639 of the signedAttrs field is performed for message digest calculation. 640 The IMPLICIT [0] tag in the signedAttrs is not used for the DER 641 encoding, rather an EXPLICIT SET OF tag is used. That is, the DER 642 encoding of the EXPLICIT SET OF tag, rather than of the IMPLICIT [0] 643 tag, MUST be included in the message digest calculation along with 644 the length and content octets of the SignedAttributes value. 646 When the signedAttrs field is absent, only the octets comprising the 647 value of the SignedData encapContentInfo eContent OCTET STRING (e.g., 648 the contents of a file) are input to the message digest calculation. 649 This has the advantage that the length of the content being signed 650 need not be known in advance of the signature generation process. 652 Although the encapContentInfo eContent OCTET STRING tag and length 653 octets are not included in the message digest calculation, they are 654 protected by other means. The length octets are protected by the 655 nature of the message digest algorithm since it is computationally 656 infeasible to find any two distinct message contents of any length 657 that have the same message digest. 659 5.5 Signature Generation Process 661 The input to the signature generation process includes the result of 662 the message digest calculation process and the signer's private key. 663 The details of the signature generation depend on the signature 664 algorithm employed. The object identifier, along with any 665 parameters, that specifies the signature algorithm employed by the 666 signer is carried in the signatureAlgorithm field. The signature 667 value generated by the signer MUST be encoded as an OCTET STRING and 668 carried in the signature field. 670 5.6 Signature Verification Process 672 The input to the signature verification process includes the result 673 of the message digest calculation process and the signer's public 674 key. The recipient MAY obtain the correct public key for the signer 675 by any means, but the preferred method is from a certificate obtained 676 from the SignedData certificates field. The selection and validation 677 of the signer's public key MAY be based on certification path 678 validation (see [PROFILE]) as well as other external context, but is 679 beyond the scope of this document. The details of the signature 680 verification depend on the signature algorithm employed. 682 The recipient MUST NOT rely on any message digest values computed by 683 the originator. If the SignedData signerInfo includes 684 signedAttributes, then the content message digest MUST be calculated 685 as described in section 5.4. For the signature to be valid, the 686 message digest value calculated by the recipient MUST be the same as 687 the value of the messageDigest attribute included in the 688 signedAttributes of the SignedData signerInfo. 690 If the SignedData signerInfo includes signedAttributes, then the 691 content-type attribute value MUST match the SignedData 692 encapContentInfo eContentType value. 694 6. Enveloped-data Content Type 696 The enveloped-data content type consists of an encrypted content of 697 any type and encrypted content-encryption keys for one or more 698 recipients. The combination of the encrypted content and one 699 encrypted content-encryption key for a recipient is a "digital 700 envelope" for that recipient. Any type of content can be enveloped 701 for an arbitrary number of recipients using any of the three key 702 management techniques for each recipient. 704 The typical application of the enveloped-data content type will 705 represent one or more recipients' digital envelopes on content of the 706 data or signed-data content types. 708 Enveloped-data is constructed by the following steps: 710 1. A content-encryption key for a particular content-encryption 711 algorithm is generated at random. 713 2. The content-encryption key is encrypted for each recipient. 714 The details of this encryption depend on the key management 715 algorithm used, but four general techniques are supported: 717 key transport: the content-encryption key is encrypted in the 718 recipient's public key; 720 key agreement: the recipient's public key and the sender's 721 private key are used to generate a pairwise symmetric key, then 722 the content-encryption key is encrypted in the pairwise 723 symmetric key; 725 symmetric key-encryption keys: the content-encryption key is 726 encrypted in a previously distributed symmetric key-encryption 727 key; and 728 passwords: the content-encryption key is encrypted in a key- 729 encryption key that is derived from a password or other shared 730 secret value. 732 3. For each recipient, the encrypted content-encryption key and 733 other recipient-specific information are collected into a 734 RecipientInfo value, defined in Section 6.2. 736 4. The content is encrypted with the content-encryption key. 737 Content encryption may require that the content be padded to a 738 multiple of some block size; see Section 6.3. 740 5. The RecipientInfo values for all the recipients are collected 741 together with the encrypted content to form an EnvelopedData value 742 as defined in Section 6.1. 744 A recipient opens the digital envelope by decrypting one of the 745 encrypted content-encryption keys and then decrypting the encrypted 746 content with the recovered content-encryption key. 748 This section is divided into four parts. The first part describes 749 the top-level type EnvelopedData, the second part describes the per- 750 recipient information type RecipientInfo, and the third and fourth 751 parts describe the content-encryption and key-encryption processes. 753 6.1 EnvelopedData Type 755 The following object identifier identifies the enveloped-data content 756 type: 758 id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 759 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 } 761 The enveloped-data content type shall have ASN.1 type EnvelopedData: 763 EnvelopedData ::= SEQUENCE { 764 version CMSVersion, 765 originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, 766 recipientInfos RecipientInfos, 767 encryptedContentInfo EncryptedContentInfo, 768 unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL } 770 OriginatorInfo ::= SEQUENCE { 771 certs [0] IMPLICIT CertificateSet OPTIONAL, 772 crls [1] IMPLICIT RevocationInfoChoices OPTIONAL } 774 RecipientInfos ::= SET SIZE (1..MAX) OF RecipientInfo 775 EncryptedContentInfo ::= SEQUENCE { 776 contentType ContentType, 777 contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier, 778 encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL } 780 EncryptedContent ::= OCTET STRING 782 UnprotectedAttributes ::= SET SIZE (1..MAX) OF Attribute 784 The fields of type EnvelopedData have the following meanings: 786 version is the syntax version number. The appropriate value 787 depends on originatorInfo, RecipientInfo, and unprotectedAttrs. 788 The version MUST be assigned as follows: 790 IF (originatorInfo is present) AND 791 ((any certificates with a type of other are present) OR 792 (any crls with a type of other are present)) 793 THEN version is 4 794 ELSE 795 IF ((originatorInfo is present) AND 796 (any version 2 attribute certificates are present)) OR 797 (any RecipientInfo structures include pwri) OR 798 (any RecipientInfo structures include ori) 799 THEN version is 3 800 ELSE 801 IF (originatorInfo is absent) OR 802 (unprotectedAttrs is absent) OR 803 (all RecipientInfo structures are version 0) 804 THEN version is 0 805 ELSE version is 2 807 originatorInfo optionally provides information about the 808 originator. It is present only if required by the key management 809 algorithm. It may contain certificates and CRLs: 811 certs is a collection of certificates. certs may contain 812 originator certificates associated with several different key 813 management algorithms. certs may also contain attribute 814 certificates associated with the originator. The certificates 815 contained in certs are intended to be sufficient for all 816 recipients to build certification paths from a recognized 817 "root" or "top-level certification authority." However, certs 818 may contain more certificates than necessary, and there may be 819 certificates sufficient to make certification paths from two or 820 more independent top-level certification authorities. 821 Alternatively, certs may contain fewer certificates than 822 necessary, if it is expected that recipients have an alternate 823 means of obtaining necessary certificates (e.g., from a 824 previous set of certificates). 826 crls is a collection of CRLs. It is intended that the set 827 contain information sufficient to determine whether or not the 828 certificates in the certs field are valid, but such 829 correspondence is not necessary. There MAY be more CRLs than 830 necessary, and there MAY also be fewer CRLs than necessary. 832 recipientInfos is a collection of per-recipient information. 833 There MUST be at least one element in the collection. 835 encryptedContentInfo is the encrypted content information. 837 unprotectedAttrs is a collection of attributes that are not 838 encrypted. The field is optional. Useful attribute types are 839 defined in Section 11. 841 The fields of type EncryptedContentInfo have the following meanings: 843 contentType indicates the type of content. 845 contentEncryptionAlgorithm identifies the content-encryption 846 algorithm, and any associated parameters, used to encrypt the 847 content. The content-encryption process is described in Section 848 6.3. The same content-encryption algorithm and content-encryption 849 key are used for all recipients. 851 encryptedContent is the result of encrypting the content. The 852 field is optional, and if the field is not present, its intended 853 value must be supplied by other means. 855 The recipientInfos field comes before the encryptedContentInfo field 856 so that an EnvelopedData value may be processed in a single pass. 858 6.2 RecipientInfo Type 860 Per-recipient information is represented in the type RecipientInfo. 861 RecipientInfo has a different format for each of the supported key 862 management techniques. Any of the key management techniques can be 863 used for each recipient of the same encrypted content. In all cases, 864 the encrypted content-encryption key is transferred to one or more 865 recipients. 867 Since all implementations will not support every possible key 868 management algorithm, all implementations MUST gracefully handle 869 unimplemented algorithms when they are encountered. For example, if 870 a recipient receives a content-encryption key encrypted in their RSA 871 public key using RSA-OAEP and the implementation only supports RSA 872 PKCS #1 v1.5, then a graceful failure must be implemented. 874 Implementations MUST support key transport, key agreement, and 875 previously distributed symmetric key-encryption keys, as represented 876 by ktri, kari, and kekri, respectively. Implementations MAY support 877 the password-based key management as represented by pwri. 878 Implementations MAY support any other key management technique as 879 represented by ori. Since each recipient can employ a different key 880 management technique and future specifications could define 881 additional key management techniques, all implementations MUST 882 gracefully handle 884 unimplemented alternatives within the RecipientInfo CHOICE, all 885 implementations MUST gracefully handle unimplemented versions of 886 otherwise supported alternatives within the RecipientInfo CHOICE, and 887 all implementations MUST gracefully handle unimplemented or unknown 888 ori alternatives. 890 RecipientInfo ::= CHOICE { 891 ktri KeyTransRecipientInfo, 892 kari [1] KeyAgreeRecipientInfo, 893 kekri [2] KEKRecipientInfo, 894 pwri [3] PasswordRecipientinfo, 895 ori [4] OtherRecipientInfo } 897 EncryptedKey ::= OCTET STRING 899 6.2.1 KeyTransRecipientInfo Type 901 Per-recipient information using key transport is represented in the 902 type KeyTransRecipientInfo. Each instance of KeyTransRecipientInfo 903 transfers the content-encryption key to one recipient. 905 KeyTransRecipientInfo ::= SEQUENCE { 906 version CMSVersion, -- always set to 0 or 2 907 rid RecipientIdentifier, 908 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 909 encryptedKey EncryptedKey } 911 RecipientIdentifier ::= CHOICE { 912 issuerAndSerialNumber IssuerAndSerialNumber, 913 subjectKeyIdentifier [0] SubjectKeyIdentifier } 915 The fields of type KeyTransRecipientInfo have the following meanings: 917 version is the syntax version number. If the RecipientIdentifier 918 is the CHOICE issuerAndSerialNumber, then the version MUST be 0. 920 If the RecipientIdentifier is subjectKeyIdentifier, then the 921 version MUST be 2. 923 rid specifies the recipient's certificate or key that was used by 924 the sender to protect the content-encryption key. The content- 925 encryption key is encrypted with the recipient's public key. The 926 RecipientIdentifier provides two alternatives for specifying the 927 recipient's certificate, and thereby the recipient's public key. 928 The recipient's certificate must contain a key transport public 929 key. Therefore, a recipient X.509 version 3 certificate that 930 contains a key usage extension MUST assert the keyEncipherment 931 bit. The issuerAndSerialNumber alternative identifies the 932 recipient's certificate by the issuer's distinguished name and the 933 certificate serial number; the subjectKeyIdentifier identifies the 934 recipient's certificate by a key identifier. When an X.509 935 certificate is referenced, the key identifier matches the X.509 936 subjectKeyIdentifier extension value. When other certificate 937 formats are referenced, the documents that specify the certificate 938 format and their use with the CMS must include details on matching 939 the key identifier to the appropriate certificate field. For 940 recipient processing, implementations MUST support both of these 941 alternatives for specifying the recipient's certificate. For 942 sender processing, implementations MUST support at least one of 943 these alternatives. 945 keyEncryptionAlgorithm identifies the key-encryption algorithm, 946 and any associated parameters, used to encrypt the content- 947 encryption key for the recipient. The key-encryption process is 948 described in Section 6.4. 950 encryptedKey is the result of encrypting the content-encryption 951 key for the recipient. 953 6.2.2 KeyAgreeRecipientInfo Type 955 Recipient information using key agreement is represented in the type 956 KeyAgreeRecipientInfo. Each instance of KeyAgreeRecipientInfo will 957 transfer the content-encryption key to one or more recipients that 958 use the same key agreement algorithm and domain parameters for that 959 algorithm. 961 KeyAgreeRecipientInfo ::= SEQUENCE { 962 version CMSVersion, -- always set to 3 963 originator [0] EXPLICIT OriginatorIdentifierOrKey, 964 ukm [1] EXPLICIT UserKeyingMaterial OPTIONAL, 965 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 966 recipientEncryptedKeys RecipientEncryptedKeys } 968 OriginatorIdentifierOrKey ::= CHOICE { 969 issuerAndSerialNumber IssuerAndSerialNumber, 970 subjectKeyIdentifier [0] SubjectKeyIdentifier, 971 originatorKey [1] OriginatorPublicKey } 973 OriginatorPublicKey ::= SEQUENCE { 974 algorithm AlgorithmIdentifier, 975 publicKey BIT STRING } 977 RecipientEncryptedKeys ::= SEQUENCE OF RecipientEncryptedKey 979 RecipientEncryptedKey ::= SEQUENCE { 980 rid KeyAgreeRecipientIdentifier, 981 encryptedKey EncryptedKey } 983 KeyAgreeRecipientIdentifier ::= CHOICE { 984 issuerAndSerialNumber IssuerAndSerialNumber, 985 rKeyId [0] IMPLICIT RecipientKeyIdentifier } 987 RecipientKeyIdentifier ::= SEQUENCE { 988 subjectKeyIdentifier SubjectKeyIdentifier, 989 date GeneralizedTime OPTIONAL, 990 other OtherKeyAttribute OPTIONAL } 992 SubjectKeyIdentifier ::= OCTET STRING 994 The fields of type KeyAgreeRecipientInfo have the following meanings: 996 version is the syntax version number. It MUST always be 3. 998 originator is a CHOICE with three alternatives specifying the 999 sender's key agreement public key. The sender uses the 1000 corresponding private key and the recipient's public key to 1001 generate a pairwise key. The content-encryption key is encrypted 1002 in the pairwise key. The issuerAndSerialNumber alternative 1003 identifies the sender's certificate, and thereby the sender's 1004 public key, by the issuer's distinguished name and the certificate 1005 serial number. The subjectKeyIdentifier alternative identifies 1006 the sender's certificate, and thereby the sender's public key, by 1007 a key identifier. When an X.509 certificate is referenced, the 1008 key identifier matches the X.509 subjectKeyIdentifier extension 1009 value. When other certificate formats are referenced, the 1010 documents that specify the certificate format and their use with 1011 the CMS must must include details on matching the key identifier 1012 to the appropriate certificate field. The originatorKey 1013 alternative includes the algorithm identifier and sender's key 1014 agreement public key. This alternative permits originator 1015 anonymity since the public key is not certified. Implementations 1016 MUST support all three alternatives for specifying the sender's 1017 public key. 1019 ukm is optional. With some key agreement algorithms, the sender 1020 provides a User Keying Material (UKM) to ensure that a different 1021 key is generated each time the same two parties generate a 1022 pairwise key. Implementations MUST support recipient processing 1023 of a KeyAgreeRecipientInfo SEQUENCE that includes a ukm field. 1024 Implementations that do not support key agreement algorithms that 1025 make use of UKMs MUST gracefully handle the presence of UKMs. 1027 keyEncryptionAlgorithm identifies the key-encryption algorithm, 1028 and any associated parameters, used to encrypt the content- 1029 encryption key with the key-encryption key. The key-encryption 1030 process is described in Section 6.4. 1032 recipientEncryptedKeys includes a recipient identifier and 1033 encrypted key for one or more recipients. The 1034 KeyAgreeRecipientIdentifier is a CHOICE with two alternatives 1035 specifying the recipient's certificate, and thereby the 1036 recipient's public key, that was used by the sender to generate a 1037 pairwise key-encryption key. The recipient's certificate must 1038 contain a key agreement public key. Therefore, a recipient X.509 1039 version 3 certificate that contains a key usage extension MUST 1040 assert the keyAgreement bit. The content-encryption key is 1041 encrypted in the pairwise key-encryption key. The 1042 issuerAndSerialNumber alternative identifies the recipient's 1043 certificate by the issuer's distinguished name and the certificate 1044 serial number; the RecipientKeyIdentifier is described below. The 1045 encryptedKey is the result of encrypting the content-encryption 1046 key in the pairwise key-encryption key generated using the key 1047 agreement algorithm. Implementations MUST support both 1048 alternatives for specifying the recipient's certificate. 1050 The fields of type RecipientKeyIdentifier have the following 1051 meanings: 1053 subjectKeyIdentifier identifies the recipient's certificate by a 1054 key identifier. When an X.509 certificate is referenced, the key 1055 identifier matches the X.509 subjectKeyIdentifier extension value. 1056 When other certificate formats are referenced, the documents that 1057 specify the certificate format and their use with the CMS must 1058 include details on matching the key identifier to the appropriate 1059 certificate field. 1061 date is optional. When present, the date specifies which of the 1062 recipient's previously distributed UKMs was used by the sender. 1064 other is optional. When present, this field contains additional 1065 information used by the recipient to locate the public keying 1066 material used by the sender. 1068 6.2.3 KEKRecipientInfo Type 1070 Recipient information using previously distributed symmetric keys is 1071 represented in the type KEKRecipientInfo. Each instance of 1072 KEKRecipientInfo will transfer the content-encryption key to one or 1073 more recipients who have the previously distributed key-encryption 1074 key. 1076 KEKRecipientInfo ::= SEQUENCE { 1077 version CMSVersion, -- always set to 4 1078 kekid KEKIdentifier, 1079 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 1080 encryptedKey EncryptedKey } 1082 KEKIdentifier ::= SEQUENCE { 1083 keyIdentifier OCTET STRING, 1084 date GeneralizedTime OPTIONAL, 1085 other OtherKeyAttribute OPTIONAL } 1087 The fields of type KEKRecipientInfo have the following meanings: 1089 version is the syntax version number. It MUST always be 4. 1091 kekid specifies a symmetric key-encryption key that was previously 1092 distributed to the sender and one or more recipients. 1094 keyEncryptionAlgorithm identifies the key-encryption algorithm, 1095 and any associated parameters, used to encrypt the content- 1096 encryption key with the key-encryption key. The key-encryption 1097 process is described in Section 6.4. 1099 encryptedKey is the result of encrypting the content-encryption 1100 key in the key-encryption key. 1102 The fields of type KEKIdentifier have the following meanings: 1104 keyIdentifier identifies the key-encryption key that was 1105 previously distributed to the sender and one or more recipients. 1107 date is optional. When present, the date specifies a single key- 1108 encryption key from a set that was previously distributed. 1110 other is optional. When present, this field contains additional 1111 information used by the recipient to determine the key-encryption 1112 key used by the sender. 1114 6.2.4 PasswordRecipientInfo Type 1116 Recipient information using a password or shared secret value is 1117 represented in the type PasswordRecipientInfo. Each instance of 1118 PasswordRecipientInfo will transfer the content-encryption key to one 1119 or more recipients who possess the password or shared secret value. 1121 The PasswordRecipientInfo Type is specified in RFC 3211 [PWRI]. The 1122 PasswordRecipientInfo structure is repeated here for completeness. 1124 PasswordRecipientInfo ::= SEQUENCE { 1125 version CMSVersion, -- Always set to 0 1126 keyDerivationAlgorithm [0] KeyDerivationAlgorithmIdentifier 1127 OPTIONAL, 1128 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 1129 encryptedKey EncryptedKey } 1131 The fields of type PasswordRecipientInfo have the following meanings: 1133 version is the syntax version number. It MUST always be 0. 1135 keyDerivationAlgorithm identifies the key-derivation algorithm, 1136 and any associated parameters, used to derive the key-encryption 1137 key from the password or shared secret value. If this field is 1138 absent, the key-encryption key is supplied from an external 1139 source, for example a hardware crypto token such as a smart card. 1141 keyEncryptionAlgorithm identifies the encryption algorithm, and 1142 any associated parameters, used to encrypt the content-encryption 1143 key with the key-encryption key. 1145 encryptedKey is the result of encrypting the content-encryption 1146 key with the key-encryption key. 1148 6.2.5 OtherRecipientInfo Type 1150 Recipient information for additional key management techniques are 1151 represented in the type OtherRecipientInfo. The OtherRecipientInfo 1152 type allows key management techniques beyond key transport, key 1153 agreement, previously distributed symmetric key-encryption keys, and 1154 password-based key management to be specified in future documents. 1155 An object identifier uniquely identifies such key management 1156 techniques. 1158 OtherRecipientInfo ::= SEQUENCE { 1159 oriType OBJECT IDENTIFIER, 1160 oriValue ANY DEFINED BY oriType } 1162 The fields of type OtherRecipientInfo have the following meanings: 1164 oriType identifies the key management technique. 1166 oriValue contains the protocol data elements needed by a recipient 1167 using the identified key management technique. 1169 6.3 Content-encryption Process 1171 The content-encryption key for the desired content-encryption 1172 algorithm is randomly generated. The data to be protected is padded 1173 as described below, 1175 then the padded data is encrypted using the content-encryption key. 1176 The encryption operation maps an arbitrary string of octets (the 1177 data) to another string of octets (the ciphertext) under control of a 1178 content-encryption key. The encrypted data is included in the 1179 EnvelopedData encryptedContentInfo encryptedContent OCTET STRING. 1181 Some content-encryption algorithms assume the input length is a 1182 multiple of k octets, where k is greater than one. For such 1183 algorithms, the input shall be padded at the trailing end with 1184 k-(lth mod k) octets all having value k-(lth mod k), where lth is 1185 the length of the input. In other words, the input is padded at 1186 the trailing end with one of the following strings: 1188 01 -- if lth mod k = k-1 1189 02 02 -- if lth mod k = k-2 1190 . 1191 . 1192 . 1193 k k ... k k -- if lth mod k = 0 1195 The padding can be removed unambiguously since all input is padded, 1196 including input values that are already a multiple of the block size, 1197 and no padding string is a suffix of another. This padding method is 1198 well defined if and only if k is less than 256. 1200 6.4 Key-encryption Process 1202 The input to the key-encryption process -- the value supplied to the 1203 recipient's key-encryption algorithm -- is just the "value" of the 1204 content-encryption key. 1206 Any of the aforementioned key management techniques can be used for 1207 each recipient of the same encrypted content. 1209 7. Digested-data Content Type 1211 The digested-data content type consists of content of any type and a 1212 message digest of the content. 1214 Typically, the digested-data content type is used to provide content 1215 integrity, and the result generally becomes an input to the 1216 enveloped-data content type. 1218 The following steps construct digested-data: 1220 1. A message digest is computed on the content with a message- 1221 digest algorithm. 1223 2. The message-digest algorithm and the message digest are 1224 collected together with the content into a DigestedData value. 1226 A recipient verifies the message digest by comparing the message 1227 digest to an independently computed message digest. 1229 The following object identifier identifies the digested-data content 1230 type: 1232 id-digestedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 1233 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 5 } 1235 The digested-data content type shall have ASN.1 type DigestedData: 1237 DigestedData ::= SEQUENCE { 1238 version CMSVersion, 1239 digestAlgorithm DigestAlgorithmIdentifier, 1240 encapContentInfo EncapsulatedContentInfo, 1241 digest Digest } 1243 Digest ::= OCTET STRING 1245 The fields of type DigestedData have the following meanings: 1247 version is the syntax version number. If the encapsulated content 1248 type is id-data, then the value of version MUST be 0; however, if 1249 the encapsulated content type is other than id-data, then the 1250 value of version MUST be 2. 1252 digestAlgorithm identifies the message digest algorithm, and any 1253 associated parameters, under which the content is digested. The 1254 message-digesting process is the same as in Section 5.4 in the 1255 case when there are no signed attributes. 1257 encapContentInfo is the content that is digested, as defined in 1258 section 5.2. 1260 digest is the result of the message-digesting process. 1262 The ordering of the digestAlgorithm field, the encapContentInfo 1263 field, and the digest field makes it possible to process a 1264 DigestedData value in a single pass. 1266 8. Encrypted-data Content Type 1268 The encrypted-data content type consists of encrypted content of any 1269 type. Unlike the enveloped-data content type, the encrypted-data 1270 content type has neither recipients nor encrypted content-encryption 1271 keys. Keys MUST be managed by other means. 1273 The typical application of the encrypted-data content type will be to 1274 encrypt the content of the data content type for local storage, 1275 perhaps where the encryption key is derived from a password. 1277 The following object identifier identifies the encrypted-data content 1278 type: 1280 id-encryptedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 1281 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 6 } 1283 The encrypted-data content type shall have ASN.1 type EncryptedData: 1285 EncryptedData ::= SEQUENCE { 1286 version CMSVersion, 1287 encryptedContentInfo EncryptedContentInfo, 1288 unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL } 1290 The fields of type EncryptedData have the following meanings: 1292 version is the syntax version number. If unprotectedAttrs is 1293 present, then version MUST be 2. If unprotectedAttrs is absent, 1294 then version MUST be 0. 1296 encryptedContentInfo is the encrypted content information, as 1297 defined in Section 6.1. 1299 unprotectedAttrs is a collection of attributes that are not 1300 encrypted. The field is optional. Useful attribute types are 1301 defined in Section 11. 1303 9. Authenticated-data Content Type 1305 The authenticated-data content type consists of content of any type, 1306 a message authentication code (MAC), and encrypted authentication 1307 keys for one or more recipients. The combination of the MAC and one 1308 encrypted authentication key for a recipient is necessary for that 1309 recipient to verify the integrity of the content. Any type of 1310 content can be integrity protected for an arbitrary number of 1311 recipients. 1313 The process by which authenticated-data is constructed involves the 1314 following steps: 1316 1. A message-authentication key for a particular message- 1317 authentication algorithm is generated at random. 1319 2. The message-authentication key is encrypted for each 1320 recipient. The details of this encryption depend on the key 1321 management algorithm used. 1323 3. For each recipient, the encrypted message-authentication key 1324 and other recipient-specific information are collected into a 1325 RecipientInfo value, defined in Section 6.2. 1327 4. Using the message-authentication key, the originator computes 1328 a MAC value on the content. If the originator is authenticating 1329 any information in addition to the content (see Section 9.2), a 1330 message digest is calculated on the content, the message digest of 1331 the content and the other information are authenticated using the 1332 message-authentication key, and the result becomes the "MAC 1333 value." 1335 9.1 AuthenticatedData Type 1337 The following object identifier identifies the authenticated-data 1338 content type: 1340 id-ct-authData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 1341 us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) 1342 ct(1) 2 } 1344 The authenticated-data content type shall have ASN.1 type 1345 AuthenticatedData: 1347 AuthenticatedData ::= SEQUENCE { 1348 version CMSVersion, 1349 originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, 1350 recipientInfos RecipientInfos, 1351 macAlgorithm MessageAuthenticationCodeAlgorithm, 1352 digestAlgorithm [1] DigestAlgorithmIdentifier OPTIONAL, 1353 encapContentInfo EncapsulatedContentInfo, 1354 authAttrs [2] IMPLICIT AuthAttributes OPTIONAL, 1355 mac MessageAuthenticationCode, 1356 unauthAttrs [3] IMPLICIT UnauthAttributes OPTIONAL } 1358 AuthAttributes ::= SET SIZE (1..MAX) OF Attribute 1360 UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute 1362 MessageAuthenticationCode ::= OCTET STRING 1364 The fields of type AuthenticatedData have the following meanings: 1366 version is the syntax version number. The version MUST be 1367 assigned as follows: 1369 IF (originatorInfo is present) AND 1370 ((any certificates with a type of other are present) OR 1371 (any crls with a type of other are present)) 1372 THEN version is 3 1373 ELSE 1374 IF ((originatorInfo is present) AND 1375 (any version 2 attribute certificates are present)) 1376 THEN version is 1 1377 ELSE version is 0 1379 originatorInfo optionally provides information about the 1380 originator. It is present only if required by the key management 1381 algorithm. It MAY contain certificates, attribute certificates, 1382 and CRLs, as defined in Section 6.1. 1384 recipientInfos is a collection of per-recipient information, as 1385 defined in Section 6.1. There MUST be at least one element in the 1386 collection. 1388 macAlgorithm is a message authentication code (MAC) algorithm 1389 identifier. It identifies the MAC algorithm, along with any 1390 associated parameters, used by the originator. Placement of the 1391 macAlgorithm field facilitates one-pass processing by the 1392 recipient. 1394 digestAlgorithm identifies the message digest algorithm, and any 1395 associated parameters, used to compute a message digest on the 1396 encapsulated content if authenticated attributes are present. The 1397 message digesting process is described in Section 9.2. Placement 1398 of the digestAlgorithm field facilitates one-pass processing by 1399 the recipient. If the digestAlgorithm field is present, then the 1400 authAttrs field MUST also be present. 1402 encapContentInfo is the content that is authenticated, as defined 1403 in section 5.2. 1405 authAttrs is a collection of authenticated attributes. The 1406 authAttrs structure is optional, but it MUST be present if the 1407 content type of the EncapsulatedContentInfo value being 1408 authenticated is not id-data. If the authAttrs field is present, 1409 then the digestAlgorithm field MUST also be present. The 1410 AuthAttributes structure MUST be DER encoded, even if the rest of 1411 the structure is BER encoded. Useful attribute types are defined 1412 in Section 11. If the authAttrs field is present, it MUST 1413 contain, at a minimum, the following two attributes: 1415 A content-type attribute having as its value the content type 1416 of the EncapsulatedContentInfo value being authenticated. 1417 Section 11.1 defines the content-type attribute. 1419 A message-digest attribute, having as its value the message 1420 digest of the content. Section 11.2 defines the message-digest 1421 attribute. 1423 mac is the message authentication code. 1425 unauthAttrs is a collection of attributes that are not 1426 authenticated. The field is optional. To date, no attributes 1427 have been defined for use as unauthenticated attributes, but other 1428 useful attribute types are defined in Section 11. 1430 9.2 MAC Generation 1432 The MAC calculation process computes a message authentication code 1433 (MAC) on either the content being authenticated or a message digest 1434 of content being authenticated together with the originator's 1435 authenticated attributes. 1437 If authAttrs field is absent, the input to the MAC calculation 1438 process is the value of the encapContentInfo eContent OCTET STRING. 1439 Only the octets comprising the value of the eContent OCTET STRING are 1440 input to the MAC algorithm; the tag and the length octets are 1441 omitted. This has the advantage that the length of the content being 1442 authenticated need not be known in advance of the MAC generation 1443 process. 1445 If authAttrs field is present, the content-type attribute (as 1446 described in Section 11.1) and the message-digest attribute (as 1447 described in section 11.2) MUST be included, and the input to the MAC 1448 calculation process is the DER encoding of authAttrs. A separate 1449 encoding of the authAttrs field is performed for message digest 1450 calculation. The IMPLICIT [2] tag in the authAttrs field is not used 1451 for the DER encoding, rather an EXPLICIT SET OF tag is used. That 1452 is, the DER encoding of the SET OF tag, rather than of the IMPLICIT 1453 [2] tag, is to be included in the message digest calculation along 1454 with the length and content octets of the authAttrs value. 1456 The message digest calculation process computes a message digest on 1457 the content being authenticated. The initial input to the message 1458 digest calculation process is the "value" of the encapsulated content 1459 being authenticated. Specifically, the input is the encapContentInfo 1460 eContent OCTET STRING to which the authentication process is applied. 1461 Only the octets comprising the value of the encapContentInfo eContent 1462 OCTET STRING are input to the message digest algorithm, not the tag 1463 or the length octets. This has the advantage that the length of the 1464 content being authenticated need not be known in advance. Although 1465 the encapContentInfo eContent OCTET STRING tag and length octets are 1466 not included in the message digest calculation, they are still 1467 protected by other means. The length octets are protected by the 1468 nature of the message digest algorithm since it is computationally 1469 infeasible to find any two distinct contents of any length that have 1470 the same message digest. 1472 The input to the MAC calculation process includes the MAC input data, 1473 defined above, and an authentication key conveyed in a recipientInfo 1474 structure. The details of MAC calculation depend on the MAC 1475 algorithm employed (e.g., HMAC). The object identifier, along with 1476 any parameters, that specifies the MAC algorithm employed by the 1477 originator is carried in the macAlgorithm field. The MAC value 1478 generated by the originator is encoded as an OCTET STRING and carried 1479 in the mac field. 1481 9.3 MAC Verification 1483 The input to the MAC verification process includes the input data 1484 (determined based on the presence or absence of the authAttrs field, 1485 as defined in 9.2), and the authentication key conveyed in 1486 recipientInfo. The details of the MAC verification process depend on 1487 the MAC algorithm employed. 1489 The recipient MUST NOT rely on any MAC values or message digest 1490 values computed by the originator. The content is authenticated as 1491 described in section 9.2. If the originator includes authenticated 1492 attributes, then the content of the authAttrs is authenticated as 1493 described in section 9.2. For authentication to succeed, the MAC 1494 value calculated by the recipient MUST be the same as the value of 1495 the mac field. Similarly, for authentication to succeed when the 1496 authAttrs field is present, the content message digest value 1497 calculated by the recipient MUST be the same as the message digest 1498 value included in the authAttrs message-digest attribute. 1500 If the AuthenticatedData includes authAttrs, then the content-type 1501 attribute value MUST match the AuthenticatedData encapContentInfo 1502 eContentType value. 1504 10. Useful Types 1506 This section is divided into two parts. The first part defines 1507 algorithm identifiers, and the second part defines other useful 1508 types. 1510 10.1 Algorithm Identifier Types 1512 All of the algorithm identifiers have the same type: 1513 AlgorithmIdentifier. The definition of AlgorithmIdentifier is taken 1514 from X.509 [X.509-88]. 1516 There are many alternatives for each algorithm type. 1518 10.1.1 DigestAlgorithmIdentifier 1520 The DigestAlgorithmIdentifier type identifies a message-digest 1521 algorithm. Examples include SHA-1, MD2, and MD5. A message-digest 1522 algorithm maps an octet string (the content) to another octet string 1523 (the message digest). 1525 DigestAlgorithmIdentifier ::= AlgorithmIdentifier 1527 10.1.2 SignatureAlgorithmIdentifier 1529 The SignatureAlgorithmIdentifier type identifies a signature 1530 algorithm. Examples include RSA, DSA, and ECDSA. A signature 1531 algorithm supports signature generation and verification operations. 1532 The signature generation operation uses the message digest and the 1533 signer's private key to generate a signature value. The signature 1534 verification operation uses the message digest and the signer's 1535 public key to determine whether or not a signature value is valid. 1536 Context determines which operation is intended. 1538 SignatureAlgorithmIdentifier ::= AlgorithmIdentifier 1540 10.1.3 KeyEncryptionAlgorithmIdentifier 1542 The KeyEncryptionAlgorithmIdentifier type identifies a key-encryption 1543 algorithm used to encrypt a content-encryption key. The encryption 1544 operation maps an octet string (the key) to another octet string (the 1545 encrypted key) under control of a key-encryption key. The decryption 1546 operation is the inverse of the encryption operation. Context 1547 determines which operation is intended. 1549 The details of encryption and decryption depend on the key management 1550 algorithm used. Key transport, key agreement, previously distributed 1551 symmetric key-encrypting keys, and symmetric key-encrypting keys 1552 derived from passwords are supported. 1554 KeyEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier 1556 10.1.4 ContentEncryptionAlgorithmIdentifier 1558 The ContentEncryptionAlgorithmIdentifier type identifies a content- 1559 encryption algorithm. Examples include Triple-DES and RC2. A 1560 content-encryption algorithm supports encryption and decryption 1561 operations. The encryption operation maps an octet string (the 1562 plaintext) to another octet string (the ciphertext) under control of 1563 a content-encryption key. The decryption operation is the inverse of 1564 the encryption operation. Context determines which operation is 1565 intended. 1567 ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier 1569 10.1.5 MessageAuthenticationCodeAlgorithm 1571 The MessageAuthenticationCodeAlgorithm type identifies a message 1572 authentication code (MAC) algorithm. Examples include DES-MAC and 1573 HMAC-SHA-1. A MAC algorithm supports generation and verification 1574 operations. The MAC generation and verification operations use the 1575 same symmetric key. Context determines which operation is intended. 1577 MessageAuthenticationCodeAlgorithm ::= AlgorithmIdentifier 1579 10.1.6 KeyDerivationAlgorithmIdentifier 1581 The KeyDerivationAlgorithmIdentifier type is specified in RFC 3211 1582 [PWRI]. The KeyDerivationAlgorithmIdentifier definition is repeated 1583 here for completeness. 1585 Key derivation algorithms convert a password or shared secret value 1586 into a key-encryption key. 1588 KeyDerivationAlgorithmIdentifier ::= AlgorithmIdentifier 1590 10.2 Other Useful Types 1592 This section defines types that are used other places in the 1593 document. The types are not listed in any particular order. 1595 10.2.1 RevocationInfoChoices 1597 The RevocationInfoChoices type gives a set of revocation status 1598 information alternatives. It is intended that the set contain 1599 information sufficient to determine whether the certificates and 1600 attribute certificates with which the set is associated are revoked. 1601 However, there MAY be more revocation status information than 1602 necessary or there MAY be less revocation status information than 1603 necessary. X.509 Certificate revocation lists (CRLs) [X.509-97] are 1604 the primary source of revocation status information, but any other 1605 revocation information format can be supported. The 1606 OtherRevocationInfoFormat alternative is provided to support any 1607 other revocation information format without further modifications to 1608 the CMS. For example, Online Certificate Status Protocol (OCSP) 1609 Responses [OCSP] can be supported using the 1610 OtherRevocationInfoFormat. 1612 The CertificateList may contain a CRL, an Authority Revocation List 1613 (ARL), a Delta CRL, or an Attribute Certificate Revocation List. All 1614 of these lists share a common syntax. 1616 The CertificateList type gives a certificate revocation list (CRL). 1617 CRLs are specified in X.509 [X.509-97], and they are profiled for use 1618 in the Internet in RFC 3280 [PROFILE]. 1620 The definition of CertificateList is taken from X.509. 1622 RevocationInfoChoices ::= SET OF RevocationInfoChoice 1623 RevocationInfoChoice ::= CHOICE { 1624 crl CertificateList, 1625 other [1] IMPLICIT OtherRevocationInfoFormat } 1627 OtherRevocationInfoFormat ::= SEQUENCE { 1628 otherRevInfoFormat OBJECT IDENTIFIER, 1629 otherRevInfo ANY DEFINED BY otherRevInfoFormat } 1631 10.2.2 CertificateChoices 1633 The CertificateChoices type gives either a PKCS #6 extended 1634 certificate [PKCS#6], an X.509 certificate, a version 1 X.509 1635 attribute certificate (ACv1) [X.509-97], a version 2 X.509 attribute 1636 certificate (ACv2) [X.509-00], or any other certificate format. The 1637 PKCS #6 extended certificate is obsolete. The PKCS #6 certificate is 1638 included for backward compatibility, and PKCS #6 certificates SHOULD 1639 NOT be used. The ACv1 is also obsolete. ACv1 is included for 1640 backward compatibility, and ACv1 SHOULD NOT be used. The Internet 1641 profile of X.509 certificates is specified in the "Internet X.509 1642 Public Key Infrastructure: Certificate and CRL Profile" [PROFILE]. 1643 The Internet profile of ACv2 is specified in the "An Internet 1644 Attribute Certificate Profile for Authorization" [ACPROFILE]. The 1645 OtherCertificateFormat alternative is provided to support any other 1646 certificate format without further modifications to the CMS. 1648 The definition of Certificate is taken from X.509. 1650 The definitions of AttributeCertificate are taken from X.509-1997 and 1651 X.509-2000. The definition from X.509-1997 is assigned to 1652 AttributeCertificateV1 (see section 12.2), and the definition from 1653 X.509-2000 is assigned to AttributeCertificateV2. 1655 CertificateChoices ::= CHOICE { 1656 certificate Certificate, 1657 extendedCertificate [0] IMPLICIT ExtendedCertificate, -- Obsolete 1658 v1AttrCert [1] IMPLICIT AttributeCertificateV1, -- Obsolete 1659 v2AttrCert [2] IMPLICIT AttributeCertificateV2, 1660 other [3] IMPLICIT OtherCertificateFormat } 1662 OtherCertificateFormat ::= SEQUENCE { 1663 otherCertFormat OBJECT IDENTIFIER, 1664 otherCert ANY DEFINED BY otherCertFormat } 1666 10.2.3 CertificateSet 1668 The CertificateSet type provides a set of certificates. It is 1669 intended that the set be sufficient to contain certification paths 1670 from a recognized "root" or "top-level certification authority" to 1671 all of the sender certificates with which the set is associated. 1672 However, there may be more certificates than necessary, or there MAY 1673 be fewer than necessary. 1675 The precise meaning of a "certification path" is outside the scope of 1676 this document. However, [PROFILE] provides a definition for X.509 1677 certificates. Some applications may impose upper limits on the 1678 length of a 1680 certification path; others may enforce certain relationships between 1681 the subjects and issuers of certificates within a certification path. 1683 CertificateSet ::= SET OF CertificateChoices 1685 10.2.4 IssuerAndSerialNumber 1687 The IssuerAndSerialNumber type identifies a certificate, and thereby 1688 an entity and a public key, by the distinguished name of the 1689 certificate issuer and an issuer-specific certificate serial number. 1691 The definition of Name is taken from X.501 [X.501-88], and the 1692 definition of CertificateSerialNumber is taken from X.509 [X.509-97]. 1694 IssuerAndSerialNumber ::= SEQUENCE { 1695 issuer Name, 1696 serialNumber CertificateSerialNumber } 1698 CertificateSerialNumber ::= INTEGER 1700 10.2.5 CMSVersion 1702 The CMSVersion type gives a syntax version number, for compatibility 1703 with future revisions of this specification. 1705 CMSVersion ::= INTEGER 1706 { v0(0), v1(1), v2(2), v3(3), v4(4), v5(5) } 1708 10.2.6 UserKeyingMaterial 1710 The UserKeyingMaterial type gives a syntax for user keying material 1711 (UKM). Some key agreement algorithms require UKMs to ensure that a 1712 different key is generated each time the same two parties generate a 1713 pairwise key. The sender provides a UKM for use with a specific key 1714 agreement algorithm. 1716 UserKeyingMaterial ::= OCTET STRING 1718 10.2.7 OtherKeyAttribute 1720 The OtherKeyAttribute type gives a syntax for the inclusion of other 1721 key attributes that permit the recipient to select the key used by 1722 the sender. The attribute object identifier must be registered along 1723 with the syntax of the attribute itself. Use of this structure 1724 should be avoided since it might impede interoperability. 1726 OtherKeyAttribute ::= SEQUENCE { 1727 keyAttrId OBJECT IDENTIFIER, 1728 keyAttr ANY DEFINED BY keyAttrId OPTIONAL } 1730 11. Useful Attributes 1732 This section defines attributes that may be used with signed-data, 1733 enveloped-data, encrypted-data, or authenticated-data. The syntax of 1734 Attribute is compatible with X.501 [X.501-88] and RFC 3280 [PROFILE]. 1735 Some of the attributes defined in this section were originally 1736 defined in PKCS #9 [PKCS#9]; others were originally defined in a 1737 previous version of this specification [CMS1]. The attributes are 1738 not listed in any particular order. 1740 Additional attributes are defined in many places, notably the S/MIME 1741 Version 3 Message Specification [MSG] and the Enhanced Security 1742 Services for S/MIME [ESS], which also include recommendations on the 1743 placement of these attributes. 1745 11.1 Content Type 1747 The content-type attribute type specifies the content type of the 1748 ContentInfo within signed-data or authenticated-data. The content- 1749 type attribute type MUST be present whenever signed attributes are 1750 present in signed-data or authenticated attributes present in 1751 authenticated-data. The content-type attribute value MUST match the 1752 encapContentInfo eContentType value in the signed-data or 1753 authenticated-data. 1755 The content-type attribute MUST be a signed attribute or an 1756 authenticated attribute; it MUST NOT be an unsigned attribute, 1757 unauthenticated attribute, or unprotected attribute. 1759 The following object identifier identifies the content-type 1760 attribute: 1762 id-contentType OBJECT IDENTIFIER ::= { iso(1) member-body(2) 1763 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 3 } 1765 Content-type attribute values have ASN.1 type ContentType: 1767 ContentType ::= OBJECT IDENTIFIER 1769 Even though the syntax is defined as a SET OF AttributeValue, a 1770 content-type attribute MUST have a single attribute value; zero or 1771 multiple instances of AttributeValue are not permitted. 1773 The SignedAttributes and AuthAttributes syntaxes are each defined as 1774 a SET OF Attributes. The SignedAttributes in a signerInfo MUST NOT 1775 include multiple instances of the content-type attribute. Similarly, 1776 the AuthAttributes in an AuthenticatedData MUST NOT include multiple 1777 instances of the content-type attribute. 1779 11.2 Message Digest 1781 The message-digest attribute type specifies the message digest of the 1782 encapContentInfo eContent OCTET STRING being signed in signed-data 1783 (see section 5.4) or authenticated in authenticated-data (see section 1784 9.2). For signed-data, the message digest is computed using the 1785 signer's message digest algorithm. For authenticated-data, the 1786 message digest is computed using the originator's message digest 1787 algorithm. 1789 Within signed-data, the message-digest signed attribute type MUST be 1790 present when there are any signed attributes present. Within 1791 authenticated-data, the message-digest authenticated attribute type 1792 MUST be present when there are any authenticated attributes present. 1794 The message-digest attribute MUST be a signed attribute or an 1795 authenticated attribute; it MUST NOT be an unsigned attribute, 1796 unauthenticated attribute, or unprotected attribute. 1798 The following object identifier identifies the message-digest 1799 attribute: 1801 id-messageDigest OBJECT IDENTIFIER ::= { iso(1) member-body(2) 1802 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 4 } 1804 Message-digest attribute values have ASN.1 type MessageDigest: 1806 MessageDigest ::= OCTET STRING 1808 A message-digest attribute MUST have a single attribute value, even 1809 though the syntax is defined as a SET OF AttributeValue. There MUST 1810 NOT be zero or multiple instances of AttributeValue present. 1812 The SignedAttributes syntax and AuthAttributes syntax are each 1813 defined as a SET OF Attributes. The SignedAttributes in a signerInfo 1814 MUST include only one instance of the message-digest attribute. 1815 Similarly, the AuthAttributes in an AuthenticatedData MUST include 1816 only one instance of the message-digest attribute. 1818 11.3 Signing Time 1820 The signing-time attribute type specifies the time at which the 1821 signer (purportedly) performed the signing process. The signing-time 1822 attribute type is intended for use in signed-data. 1824 The signing-time attribute MUST be a signed attribute or an 1825 authenticated attribute; it MUST NOT be an unsigned attribute, 1826 unauthenticated attribute, or unprotected attribute. 1828 The following object identifier identifies the signing-time 1829 attribute: 1831 id-signingTime OBJECT IDENTIFIER ::= { iso(1) member-body(2) 1832 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 5 } 1834 Signing-time attribute values have ASN.1 type SigningTime: 1836 SigningTime ::= Time 1838 Time ::= CHOICE { 1839 utcTime UTCTime, 1840 generalizedTime GeneralizedTime } 1842 Note: The definition of Time matches the one specified in the 1997 1843 version of X.509 [X.509-97]. 1845 Dates between 1 January 1950 and 31 December 2049 (inclusive) MUST be 1846 encoded as UTCTime. Any dates with year values before 1950 or after 1847 2049 MUST be encoded as GeneralizedTime. 1849 UTCTime values MUST be expressed in Greenwich Mean Time (Zulu) and 1850 MUST include seconds (i.e., times are YYMMDDHHMMSSZ), even where the 1852 number of seconds is zero. Midnight (GMT) MUST be represented as 1853 "YYMMDD000000Z". Century information is implicit, and the century 1854 MUST be determined as follows: 1856 Where YY is greater than or equal to 50, the year MUST be 1857 interpreted as 19YY; and 1859 Where YY is less than 50, the year MUST be interpreted as 20YY. 1861 GeneralizedTime values MUST be expressed in Greenwich Mean Time 1862 (Zulu) and MUST include seconds (i.e., times are YYYYMMDDHHMMSSZ), 1863 even where the number of seconds is zero. GeneralizedTime values 1864 MUST NOT include fractional seconds. 1866 A signing-time attribute MUST have a single attribute value, even 1867 though the syntax is defined as a SET OF AttributeValue. There MUST 1868 NOT be zero or multiple instances of AttributeValue present. 1870 The SignedAttributes syntax and the AuthAttributes syntax are each 1871 defined as a SET OF Attributes. The SignedAttributes in a signerInfo 1872 MUST NOT include multiple instances of the signing-time attribute. 1873 Similarly, the AuthAttributes in an AuthenticatedData MUST NOT 1874 include multiple instances of the signing-time attribute. 1876 No requirement is imposed concerning the correctness of the signing 1877 time, and acceptance of a purported signing time is a matter of a 1878 recipient's discretion. It is expected, however, that some signers, 1879 such as time-stamp servers, will be trusted implicitly. 1881 11.4 Countersignature 1883 The countersignature attribute type specifies one or more signatures 1884 on the contents octets of the signature OCTET STRING in a SignerInfo 1885 value of the signed-data. That is, the message digest is computed 1886 over the octets comprising the value of the OCTET STRING, neither the 1887 tag nor length octets are included. Thus, the countersignature 1888 attribute type countersigns (signs in serial) another signature. 1890 The countersignature attribute MUST be an unsigned attribute; it MUST 1891 NOT be a signed attribute, an authenticated attribute, an 1892 unauthenticated attribute, or an unprotected attribute. 1894 The following object identifier identifies the countersignature 1895 attribute: 1897 id-countersignature OBJECT IDENTIFIER ::= { iso(1) member-body(2) 1898 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 6 } 1900 Countersignature attribute values have ASN.1 type Countersignature: 1902 Countersignature ::= SignerInfo 1904 Countersignature values have the same meaning as SignerInfo values 1905 for ordinary signatures, except that: 1907 1. The signedAttributes field MUST NOT contain a content-type 1908 attribute; there is no content type for countersignatures. 1910 2. The signedAttributes field MUST contain a message-digest 1911 attribute if it contains any other attributes. 1913 3. The input to the message-digesting process is the contents 1914 octets of the DER encoding of the signatureValue field of the 1915 SignerInfo value with which the attribute is associated. 1917 A countersignature attribute can have multiple attribute values. The 1918 syntax is defined as a SET OF AttributeValue, and there MUST be one 1919 or more instances of AttributeValue present. 1921 The UnsignedAttributes syntax is defined as a SET OF Attributes. The 1922 UnsignedAttributes in a signerInfo may include multiple instances of 1923 the countersignature attribute. 1925 A countersignature, since it has type SignerInfo, can itself contain 1926 a countersignature attribute. Thus, it is possible to construct an 1927 arbitrarily long series of countersignatures. 1929 12. ASN.1 Modules 1931 Section 12.1 contains the ASN.1 module for the CMS, and section 12.2 1932 contains the ASN.1 module for the Version 1 Attribute Certificate. 1934 12.1 CMS ASN.1 Module 1936 CryptographicMessageSyntax2004 1937 { iso(1) member-body(2) us(840) rsadsi(113549) 1938 pkcs(1) pkcs-9(9) smime(16) modules(0) cms-2004(24) } 1940 DEFINITIONS IMPLICIT TAGS ::= 1941 BEGIN 1943 -- EXPORTS All 1944 -- The types and values defined in this module are exported for use 1945 -- in the other ASN.1 modules. Other applications may use them for 1946 -- their own purposes. 1948 IMPORTS 1950 -- Imports from RFC 3280 [PROFILE], Appendix A.1 1951 AlgorithmIdentifier, Certificate, CertificateList, 1952 CertificateSerialNumber, Name 1953 FROM PKIX1Explicit88 1954 { iso(1) identified-organization(3) dod(6) 1955 internet(1) security(5) mechanisms(5) pkix(7) 1956 mod(0) pkix1-explicit(18) } 1958 -- Imports from RFC 3281 [ACPROFILE], Appendix B 1959 AttributeCertificate 1960 FROM PKIXAttributeCertificate 1961 { iso(1) identified-organization(3) dod(6) 1962 internet(1) security(5) mechanisms(5) pkix(7) 1963 mod(0) attribute-cert(12) } 1965 -- Imports from Appendix B of this document 1966 AttributeCertificateV1 1967 FROM AttributeCertificateVersion1 1968 { iso(1) member-body(2) us(840) rsadsi(113549) 1969 pkcs(1) pkcs-9(9) smime(16) modules(0) 1970 v1AttrCert(15) } ; 1972 -- Cryptographic Message Syntax 1974 ContentInfo ::= SEQUENCE { 1975 contentType ContentType, 1976 content [0] EXPLICIT ANY DEFINED BY contentType } 1978 ContentType ::= OBJECT IDENTIFIER 1979 SignedData ::= SEQUENCE { 1980 version CMSVersion, 1981 digestAlgorithms DigestAlgorithmIdentifiers, 1982 encapContentInfo EncapsulatedContentInfo, 1983 certificates [0] IMPLICIT CertificateSet OPTIONAL, 1984 crls [1] IMPLICIT RevocationInfoChoices OPTIONAL, 1985 signerInfos SignerInfos } 1987 DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier 1989 SignerInfos ::= SET OF SignerInfo 1991 EncapsulatedContentInfo ::= SEQUENCE { 1992 eContentType ContentType, 1993 eContent [0] EXPLICIT OCTET STRING OPTIONAL } 1995 SignerInfo ::= SEQUENCE { 1996 version CMSVersion, 1997 sid SignerIdentifier, 1998 digestAlgorithm DigestAlgorithmIdentifier, 1999 signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL, 2000 signatureAlgorithm SignatureAlgorithmIdentifier, 2001 signature SignatureValue, 2002 unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL } 2004 SignerIdentifier ::= CHOICE { 2005 issuerAndSerialNumber IssuerAndSerialNumber, 2006 subjectKeyIdentifier [0] SubjectKeyIdentifier } 2008 SignedAttributes ::= SET SIZE (1..MAX) OF Attribute 2010 UnsignedAttributes ::= SET SIZE (1..MAX) OF Attribute 2012 Attribute ::= SEQUENCE { 2013 attrType OBJECT IDENTIFIER, 2014 attrValues SET OF AttributeValue } 2016 AttributeValue ::= ANY 2018 SignatureValue ::= OCTET STRING 2020 EnvelopedData ::= SEQUENCE { 2021 version CMSVersion, 2022 originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, 2023 recipientInfos RecipientInfos, 2024 encryptedContentInfo EncryptedContentInfo, 2025 unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL } 2027 OriginatorInfo ::= SEQUENCE { 2028 certs [0] IMPLICIT CertificateSet OPTIONAL, 2029 crls [1] IMPLICIT RevocationInfoChoices OPTIONAL } 2031 RecipientInfos ::= SET SIZE (1..MAX) OF RecipientInfo 2033 EncryptedContentInfo ::= SEQUENCE { 2034 contentType ContentType, 2035 contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier, 2036 encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL } 2038 EncryptedContent ::= OCTET STRING 2040 UnprotectedAttributes ::= SET SIZE (1..MAX) OF Attribute 2041 RecipientInfo ::= CHOICE { 2042 ktri KeyTransRecipientInfo, 2043 kari [1] KeyAgreeRecipientInfo, 2044 kekri [2] KEKRecipientInfo, 2045 pwri [3] PasswordRecipientInfo, 2046 ori [4] OtherRecipientInfo } 2048 EncryptedKey ::= OCTET STRING 2050 KeyTransRecipientInfo ::= SEQUENCE { 2051 version CMSVersion, -- always set to 0 or 2 2052 rid RecipientIdentifier, 2053 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 2054 encryptedKey EncryptedKey } 2056 RecipientIdentifier ::= CHOICE { 2057 issuerAndSerialNumber IssuerAndSerialNumber, 2058 subjectKeyIdentifier [0] SubjectKeyIdentifier } 2060 KeyAgreeRecipientInfo ::= SEQUENCE { 2061 version CMSVersion, -- always set to 3 2062 originator [0] EXPLICIT OriginatorIdentifierOrKey, 2063 ukm [1] EXPLICIT UserKeyingMaterial OPTIONAL, 2064 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 2065 recipientEncryptedKeys RecipientEncryptedKeys } 2067 OriginatorIdentifierOrKey ::= CHOICE { 2068 issuerAndSerialNumber IssuerAndSerialNumber, 2069 subjectKeyIdentifier [0] SubjectKeyIdentifier, 2070 originatorKey [1] OriginatorPublicKey } 2072 OriginatorPublicKey ::= SEQUENCE { 2073 algorithm AlgorithmIdentifier, 2074 publicKey BIT STRING } 2076 RecipientEncryptedKeys ::= SEQUENCE OF RecipientEncryptedKey 2078 RecipientEncryptedKey ::= SEQUENCE { 2079 rid KeyAgreeRecipientIdentifier, 2080 encryptedKey EncryptedKey } 2082 KeyAgreeRecipientIdentifier ::= CHOICE { 2083 issuerAndSerialNumber IssuerAndSerialNumber, 2084 rKeyId [0] IMPLICIT RecipientKeyIdentifier } 2086 RecipientKeyIdentifier ::= SEQUENCE { 2087 subjectKeyIdentifier SubjectKeyIdentifier, 2088 date GeneralizedTime OPTIONAL, 2089 other OtherKeyAttribute OPTIONAL } 2091 SubjectKeyIdentifier ::= OCTET STRING 2093 KEKRecipientInfo ::= SEQUENCE { 2094 version CMSVersion, -- always set to 4 2095 kekid KEKIdentifier, 2096 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 2097 encryptedKey EncryptedKey } 2099 KEKIdentifier ::= SEQUENCE { 2100 keyIdentifier OCTET STRING, 2101 date GeneralizedTime OPTIONAL, 2102 other OtherKeyAttribute OPTIONAL } 2104 PasswordRecipientInfo ::= SEQUENCE { 2105 version CMSVersion, -- always set to 0 2106 keyDerivationAlgorithm [0] KeyDerivationAlgorithmIdentifier 2107 OPTIONAL, 2108 keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, 2109 encryptedKey EncryptedKey } 2111 OtherRecipientInfo ::= SEQUENCE { 2112 oriType OBJECT IDENTIFIER, 2113 oriValue ANY DEFINED BY oriType } 2115 DigestedData ::= SEQUENCE { 2116 version CMSVersion, 2117 digestAlgorithm DigestAlgorithmIdentifier, 2118 encapContentInfo EncapsulatedContentInfo, 2119 digest Digest } 2121 Digest ::= OCTET STRING 2123 EncryptedData ::= SEQUENCE { 2124 version CMSVersion, 2125 encryptedContentInfo EncryptedContentInfo, 2126 unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL } 2128 AuthenticatedData ::= SEQUENCE { 2129 version CMSVersion, 2130 originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, 2131 recipientInfos RecipientInfos, 2132 macAlgorithm MessageAuthenticationCodeAlgorithm, 2133 digestAlgorithm [1] DigestAlgorithmIdentifier OPTIONAL, 2135 encapContentInfo EncapsulatedContentInfo, 2136 authAttrs [2] IMPLICIT AuthAttributes OPTIONAL, 2137 mac MessageAuthenticationCode, 2138 unauthAttrs [3] IMPLICIT UnauthAttributes OPTIONAL } 2140 AuthAttributes ::= SET SIZE (1..MAX) OF Attribute 2142 UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute 2144 MessageAuthenticationCode ::= OCTET STRING 2146 DigestAlgorithmIdentifier ::= AlgorithmIdentifier 2148 SignatureAlgorithmIdentifier ::= AlgorithmIdentifier 2150 KeyEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier 2152 ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier 2154 MessageAuthenticationCodeAlgorithm ::= AlgorithmIdentifier 2156 KeyDerivationAlgorithmIdentifier ::= AlgorithmIdentifier 2158 RevocationInfoChoices ::= SET OF RevocationInfoChoice 2160 RevocationInfoChoice ::= CHOICE { 2161 crl CertificateList, 2162 other [1] IMPLICIT OtherRevocationInfoFormat } 2164 OtherRevocationInfoFormat ::= SEQUENCE { 2165 otherRevInfoFormat OBJECT IDENTIFIER, 2166 otherRevInfo ANY DEFINED BY otherRevInfoFormat } 2168 CertificateChoices ::= CHOICE { 2169 certificate Certificate, 2170 extendedCertificate [0] IMPLICIT ExtendedCertificate, -- Obsolete 2171 v1AttrCert [1] IMPLICIT AttributeCertificateV1, -- Obsolete 2172 v2AttrCert [2] IMPLICIT AttributeCertificateV2, 2173 other [3] IMPLICIT OtherCertificateFormat } 2175 AttributeCertificateV2 ::= AttributeCertificate 2176 OtherCertificateFormat ::= SEQUENCE { 2177 otherCertFormat OBJECT IDENTIFIER, 2178 otherCert ANY DEFINED BY otherCertFormat } 2180 CertificateSet ::= SET OF CertificateChoices 2182 IssuerAndSerialNumber ::= SEQUENCE { 2183 issuer Name, 2184 serialNumber CertificateSerialNumber } 2186 CMSVersion ::= INTEGER { v0(0), v1(1), v2(2), v3(3), v4(4), v5(5) } 2188 UserKeyingMaterial ::= OCTET STRING 2190 OtherKeyAttribute ::= SEQUENCE { 2191 keyAttrId OBJECT IDENTIFIER, 2192 keyAttr ANY DEFINED BY keyAttrId OPTIONAL } 2194 -- Content Type Object Identifiers 2196 id-ct-contentInfo OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2197 us(840) rsadsi(113549) pkcs(1) pkcs9(9) smime(16) ct(1) 6 } 2199 id-data OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2200 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 1 } 2202 id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2203 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 } 2205 id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2206 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 } 2208 id-digestedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2209 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 5 } 2211 id-encryptedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2212 us(840) rsadsi(113549) pkcs(1) pkcs7(7) 6 } 2214 id-ct-authData OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2215 us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) ct(1) 2 } 2217 -- The CMS Attributes 2219 MessageDigest ::= OCTET STRING 2221 SigningTime ::= Time 2222 Time ::= CHOICE { 2223 utcTime UTCTime, 2224 generalTime GeneralizedTime } 2226 Countersignature ::= SignerInfo 2228 -- Attribute Object Identifiers 2230 id-contentType OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2231 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 3 } 2233 id-messageDigest OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2234 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 4 } 2236 id-signingTime OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2237 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 5 } 2239 id-countersignature OBJECT IDENTIFIER ::= { iso(1) member-body(2) 2240 us(840) rsadsi(113549) pkcs(1) pkcs9(9) 6 } 2242 -- Obsolete Extended Certificate syntax from PKCS#6 2244 ExtendedCertificateOrCertificate ::= CHOICE { 2245 certificate Certificate, 2246 extendedCertificate [0] IMPLICIT ExtendedCertificate } 2247 ExtendedCertificate ::= SEQUENCE { 2248 extendedCertificateInfo ExtendedCertificateInfo, 2249 signatureAlgorithm SignatureAlgorithmIdentifier, 2250 signature Signature } 2252 ExtendedCertificateInfo ::= SEQUENCE { 2253 version CMSVersion, 2254 certificate Certificate, 2255 attributes UnauthAttributes } 2257 Signature ::= BIT STRING 2259 END -- of CryptographicMessageSyntax2004 2261 12.2 Version 1 Attribute Certificate ASN.1 Module 2263 AttributeCertificateVersion1 2264 { iso(1) member-body(2) us(840) rsadsi(113549) 2265 pkcs(1) pkcs-9(9) smime(16) modules(0) v1AttrCert(15) } 2267 DEFINITIONS EXPLICIT TAGS ::= 2268 BEGIN 2270 -- EXPORTS All 2272 IMPORTS 2274 -- Imports from RFC 3280 [PROFILE], Appendix A.1 2275 AlgorithmIdentifier, Attribute, CertificateSerialNumber, 2276 Extensions, UniqueIdentifier 2277 FROM PKIX1Explicit88 2278 { iso(1) identified-organization(3) dod(6) 2279 internet(1) security(5) mechanisms(5) pkix(7) 2280 mod(0) pkix1-explicit(18) } 2282 -- Imports from RFC 3280 [PROFILE], Appendix A.2 2283 GeneralNames 2284 FROM PKIX1Implicit88 2285 { iso(1) identified-organization(3) dod(6) 2286 internet(1) security(5) mechanisms(5) pkix(7) 2287 mod(0) pkix1-implicit(19) } 2289 -- Imports from RFC 3281 [ACPROFILE], Appendix B 2290 AttCertValidityPeriod, IssuerSerial 2291 FROM PKIXAttributeCertificate 2292 { iso(1) identified-organization(3) dod(6) 2293 internet(1) security(5) mechanisms(5) pkix(7) 2294 mod(0) attribute-cert(12) } ; 2296 -- Definition extracted from X.509-1997 [X.509-97], but 2297 -- different type names are used to avoid collisions. 2299 AttributeCertificateV1 ::= SEQUENCE { 2300 acInfo AttributeCertificateInfoV1, 2301 signatureAlgorithm AlgorithmIdentifier, 2302 signature BIT STRING } 2304 AttributeCertificateInfoV1 ::= SEQUENCE { 2305 version AttCertVersionV1 DEFAULT v1, 2306 subject CHOICE { 2307 baseCertificateID [0] IssuerSerial, 2308 -- associated with a Public Key Certificate 2309 subjectName [1] GeneralNames }, 2310 -- associated with a name 2311 issuer GeneralNames, 2312 signature AlgorithmIdentifier, 2313 serialNumber CertificateSerialNumber, 2314 attCertValidityPeriod AttCertValidityPeriod, 2315 attributes SEQUENCE OF Attribute, 2316 issuerUniqueID UniqueIdentifier OPTIONAL, 2317 extensions Extensions OPTIONAL } 2319 AttCertVersionV1 ::= INTEGER { v1(0) } 2321 END -- of AttributeCertificateVersion1 2323 13. Normative References 2325 [ACPROFILE] Farrell, S. and R. Housley, "An Internet Attribute 2326 Certificate Profile for Authorization", RFC 3281, 2327 April 2002. 2329 [PROFILE] Housley, R., Polk, W., Ford, W. and D. Solo, "Internet 2330 X.509 Public Key Infrastructure: Certificate and CRL 2331 Profile", RFC 3280, April 2002. 2333 [STDWORDS] Bradner, S., "Key Words for Use in RFCs to Indicate 2334 Requirement Levels", BCP 14, RFC 2119, March 1997. 2336 [X.208-88] CCITT. Recommendation X.208: Specification of Abstract 2337 Syntax Notation One (ASN.1). 1988. 2339 [X.209-88] CCITT. Recommendation X.209: Specification of Basic 2340 Encoding Rules for Abstract Syntax Notation One (ASN.1). 2341 1988. 2343 [X.501-88] CCITT. Recommendation X.501: The Directory - Models. 2344 1988. 2346 [X.509-88] CCITT. Recommendation X.509: The Directory - 2347 Authentication Framework. 1988. 2349 [X.509-97] ITU-T. Recommendation X.509: The Directory - 2350 Authentication Framework. 1997. 2352 [X.509-00] ITU-T. Recommendation X.509: The Directory - 2353 Authentication Framework. 2000. 2355 14. Informative References 2357 [CMS1] Housley, R., "Cryptographic Message Syntax", 2358 RFC 2630, June 1999. 2360 [CMS2] Housley, R., "Cryptographic Message Syntax", 2361 RFC 3369, August 2002. 2363 [CMSALG] Housley, R., "Cryptographic Message Syntax (CMS) 2364 Algorithms", RFC 3370, August 2002. 2366 [DSS] National Institute of Standards and Technology. 2367 FIPS Pub 186: Digital Signature Standard. 19 May 1994. 2369 [ESS] Hoffman, P., "Enhanced Security Services for S/MIME", 2370 RFC 2634, June 1999. 2372 [MSG] Ramsdell, B., "S/MIME Version 3 Message Specification", 2373 RFC 2633, June 1999. 2375 [OCSP] Myers, M., Ankney, R., Malpani, A., Galperin, S., and 2376 C. Adams, "X.509 Internet Public Key Infrastructure 2377 Online Certificate Status Protocol - OCSP", RFC 2560, 2378 June 1999. 2380 [OLDMSG] Dusse, S., Hoffman, P., Ramsdell, B., Lundblade, L., and 2381 L. Repka, "S/MIME Version 2 Message Specification", 2382 RFC 2311, March 1998. 2384 [PKCS#6] RSA Laboratories. PKCS #6: Extended-Certificate Syntax 2385 Standard, Version 1.5. November 1993. 2387 [PKCS#7] Kaliski, B., "PKCS #7: Cryptographic Message Syntax, 2388 Version 1.5.", RFC 2315, March 1998. 2390 [PKCS#9] RSA Laboratories. PKCS #9: Selected Attribute Types, 2391 Version 1.1. November 1993. 2393 [PWRI] Gutmann, P., "Password-based Encryption for S/MIME", 2394 RFC 3211, December 2001. 2396 [RANDOM] Eastlake, D., Crocker, S. and J. Schiller, "Randomness 2397 Recommendations for Security", RFC 1750, December 1994. 2399 15. Security Considerations 2401 The Cryptographic Message Syntax provides a method for digitally 2402 signing data, digesting data, encrypting data, and authenticating 2403 data. 2405 Implementations must protect the signer's private key. Compromise of 2406 the signer's private key permits masquerade. 2408 Implementations must protect the key management private key, the key- 2409 encryption key, and the content-encryption key. Compromise of the 2410 key management private key or the key-encryption key may result in 2411 the disclosure of all contents protected with that key. Similarly, 2412 compromise of the content-encryption key may result in disclosure of 2413 the associated encrypted content. 2415 Implementations must protect the key management private key and the 2416 message-authentication key. Compromise of the key management private 2417 key permits masquerade of authenticated data. Similarly, compromise 2418 of the message-authentication key may result in undetectable 2419 modification of the authenticated content. 2421 The key management technique employed to distribute message- 2422 authentication keys must itself provide data origin authentication, 2423 otherwise the contents are delivered with integrity from an unknown 2424 source. Neither RSA [PKCS#1, NEWPKCS#1] nor Ephemeral-Static Diffie- 2425 Hellman [DH-X9.42] provide the necessary data origin authentication. 2426 Static-Static Diffie-Hellman [DH-X9.42] does provide the necessary 2427 data origin authentication when both the originator and recipient 2428 public keys are bound to appropriate identities in X.509 2429 certificates. 2431 When more than two parties share the same message-authentication key, 2432 data origin authentication is not provided. Any party that knows the 2433 message-authentication key can compute a valid MAC, therefore the 2434 contents could originate from any one of the parties. 2436 Implementations must randomly generate content-encryption keys, 2437 message-authentication keys, initialization vectors (IVs), and 2438 padding. Also, the generation of public/private key pairs relies on 2439 a random numbers. The use of inadequate pseudo-random number 2440 generators (PRNGs) to generate cryptographic keys can result in 2441 little or no security. An attacker may find it much easier to 2442 reproduce the PRNG environment that produced the keys, searching the 2443 resulting small set of possibilities, rather than brute force 2444 searching the whole key space. The generation of quality random 2445 numbers is difficult. RFC 1750 [RANDOM] offers important guidance 2446 in this area, and Appendix 3 of FIPS Pub 186 [DSS] provides one 2447 quality PRNG technique. 2449 When using key agreement algorithms or previously distributed 2450 symmetric key-encryption keys, a key-encryption key is used to 2451 encrypt the content-encryption key. If the key-encryption and 2452 content-encryption algorithms are different, the effective security 2453 is determined by the weaker of the two algorithms. If, for example, 2454 content is encrypted with Triple-DES using a 168-bit Triple-DES 2455 content-encryption key, and the content-encryption key is wrapped 2456 with RC2 using a 40-bit RC2 key-encryption key, then at most 40 bits 2457 of protection is provided. A trivial search to determine the value 2458 of the 40-bit RC2 key can recover the Triple-DES key, and then the 2459 Triple-DES key can be used to decrypt the content. Therefore, 2460 implementers must ensure that key-encryption algorithms are as strong 2461 or stronger than content-encryption algorithms. 2463 Implementers should be aware that cryptographic algorithms become 2464 weaker with time. As new cryptoanalysis techniques are developed and 2465 computing performance improves, the work factor to break a particular 2466 cryptographic algorithm will be reduced. Therefore, cryptographic 2467 algorithm implementations should be modular, allowing new algorithms 2468 to be readily inserted. That is, implementors should be prepared for 2469 the set of algorithms that must be supported to change over time. 2471 The countersignature unsigned attribute includes a digital signature 2472 that is computed on the content signature value, thus the 2473 countersigning process need not know the original signed content. 2474 This structure permits implementation efficiency advantages; however, 2475 this structure may also permit the countersigning of an inappropriate 2476 signature value. Therefore, implementations that perform 2477 countersignatures should either verify the original signature value 2478 prior to countersigning it (this verification requires processing of 2479 the original content), or implementations should perform 2480 countersigning in a context that ensures that only appropriate 2481 signature values are countersigned. 2483 16. Acknowledgments 2485 This document is the result of contributions from many professionals. 2486 I appreciate the hard work of all members of the IETF S/MIME Working 2487 Group. I extend a special thanks to Rich Ankney, Simon Blake-Wilson, 2488 Tim Dean, Steve Dusse, Carl Ellison, Peter Gutmann, Bob Jueneman, 2489 Stephen Henson, Paul Hoffman, Scott Hollenbeck, Don Johnson, Burt 2490 Kaliski, John Linn, John Pawling, Blake Ramsdell, Francois Rousseau, 2491 Jim Schaad, Dave Solo, Paul Timmel, and Sean Turner for their efforts 2492 and support. 2494 17. Authors' Address 2496 Russell Housley 2497 Vigil Security, LLC 2498 918 Spring Knoll Drive 2499 Herndon, VA 20170 2500 USA 2501 EMail: housley@vigilsec.com 2503 18. Full Copyright Statement 2505 Copyright (C) The Internet Society (2004). All Rights Reserved. 2507 This document and translations of it may be copied and furnished to 2508 others, and derivative works that comment on or otherwise explain it 2509 or assist in its implementation may be prepared, copied, published and 2510 distributed, in whole or in part, without restriction of any kind, 2511 provided that the above copyright notice and this paragraph are 2512 included on all such copies and derivative works. However, this 2513 document itself may not be modified in any way, such as by removing 2514 the copyright notice or references to the Internet Society or other 2515 Internet organizations, except as needed for the purpose of 2516 developing Internet standards in which case the procedures for 2517 copyrights defined in the Internet Standards process must be 2518 followed, or as required to translate it into languages other than 2519 English. 2521 The limited permissions granted above are perpetual and will not be 2522 revoked by the Internet Society or its successors or assigns. 2524 This document and the information contained herein is provided on an 2525 "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING 2526 TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT 2527 NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN 2528 WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF 2529 MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.