draft-ietf-smime-cms-11.txt   draft-ietf-smime-cms-12.txt 
S/MIME Working Group R. Housley S/MIME Working Group R. Housley
Internet Draft SPYRUS Internet Draft SPYRUS
expires in six months February 1999 expires in six months March 1999
Cryptographic Message Syntax Cryptographic Message Syntax
<draft-ietf-smime-cms-11.txt> <draft-ietf-smime-cms-12.txt>
Status of this Memo Status of this Memo
This document is an Internet-Draft and is in full conformance with This document is an Internet-Draft and is in full conformance with
all provisions of Section 10 of RFC2026. Internet-Drafts are working all provisions of Section 10 of RFC2026. Internet-Drafts are working
documents of the Internet Engineering Task Force (IETF), its areas, documents of the Internet Engineering Task Force (IETF), its areas,
and its working groups. Note that other groups may also distribute and its working groups. Note that other groups may also distribute
working documents as Internet-Drafts. working documents as Internet-Drafts.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as 'work in progress.' material or to cite them other than as "work in progress."
To view the entire list of current Internet-Drafts, please check the To view the entire list of current Internet-Drafts, please check the
'1id-abstracts.txt' listing contained in the Internet-Drafts Shadow "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow
Directories on ftp.is.co.za (Africa), ftp.nordu.net (Northern Directories on ftp.is.co.za (Africa), ftp.nordu.net (Northern
Europe), ftp.nis.garr.it (Southern Europe), munnari.oz.au (Pacific Europe), ftp.nis.garr.it (Southern Europe), munnari.oz.au (Pacific
Rim), ftp.ietf.org (US East Coast), or ftp.isi.edu (US West Coast). Rim), ftp.ietf.org (US East Coast), or ftp.isi.edu (US West Coast).
Abstract Abstract
This document describes the Cryptographic Message Syntax. This This document describes the Cryptographic Message Syntax. This
syntax is used to digitally sign, digest, authenticate, or encrypt syntax is used to digitally sign, digest, authenticate, or encrypt
arbitrary messages. arbitrary messages.
The Cryptographic Message Syntax is derived from PKCS #7 version 1.5 The Cryptographic Message Syntax is derived from PKCS #7 version 1.5
as specified in RFC 2315 [PKCS#7]. Wherever possible, backward as specified in RFC 2315 [PKCS#7]. Wherever possible, backward
compatibility is preserved; however, changes were necessary to compatibility is preserved; however, changes were necessary to
accommodate attribute certificate transfer and key agreement accommodate attribute certificate transfer and key agreement
techniques for key management. techniques for key management.
This draft is being discussed on the 'ietf-smime' mailing list. To This draft is being discussed on the "ietf-smime" mailing list. To
join the list, send a message to <ietf-smime-request@imc.org> with join the list, send a message to <ietf-smime-request@imc.org> with
the single word 'subscribe' in the body of the message. Also, there the single word "subscribe" in the body of the message. Also, there
is a Web site for the mailing list at <http://www.imc.org/ietf- is a Web site for the mailing list at <http://www.imc.org/ietf-
smime/>. smime/>.
Table of Contents Table of Contents
Status of this Memo .................................................. 1 Status of this Memo .................................................. 1
Abstract ............................................................. 1 Abstract ............................................................. 1
Table of Contents .................................................... 2 Table of Contents .................................................... 2
1 Introduction ..................................................... 4 1 Introduction ..................................................... 4
2 General Overview ................................................. 4 2 General Overview ................................................. 4
3 General Syntax ................................................... 5 3 General Syntax ................................................... 5
4 Data Content Type ................................................ 5 4 Data Content Type ................................................ 5
5 Signed-data Content Type ......................................... 6 5 Signed-data Content Type ......................................... 6
5.1 SignedData Type ............................................. 7 5.1 SignedData Type ............................................. 7
5.2 EncapsulatedContentInfo Type ................................ 8 5.2 EncapsulatedContentInfo Type ................................ 8
5.3 SignerInfo Type ............................................. 9 5.3 SignerInfo Type ............................................. 9
5.4 Message Digest Calculation Process .......................... 11 5.4 Message Digest Calculation Process .......................... 11
5.5 Message Signature Generation Process ........................ 12 5.5 Message Signature Generation Process ........................ 12
5.6 Message Signature Validation Process ........................ 12 5.6 Message Signature Verification Process ...................... 12
6 Enveloped-data Content Type ...................................... 12 6 Enveloped-data Content Type ...................................... 12
6.1 EnvelopedData Type .......................................... 14 6.1 EnvelopedData Type .......................................... 14
6.2 RecipientInfo Type .......................................... 15 6.2 RecipientInfo Type .......................................... 15
6.2.1 KeyTransRecipientInfo Type ........................... 16 6.2.1 KeyTransRecipientInfo Type ........................... 16
6.2.2 KeyAgreeRecipientInfo Type ........................... 17 6.2.2 KeyAgreeRecipientInfo Type ........................... 17
6.2.3 KEKRecipientInfo Type ................................ 19 6.2.3 KEKRecipientInfo Type ................................ 19
6.3 Content-encryption Process .................................. 20 6.3 Content-encryption Process .................................. 20
6.4 Key-encryption Process ...................................... 20 6.4 Key-encryption Process ...................................... 20
7 Digested-data Content Type ....................................... 21 7 Digested-data Content Type ....................................... 21
8 Encrypted-data Content Type ...................................... 22 8 Encrypted-data Content Type ...................................... 22
9 Authenticated-data Content Type .................................. 23 9 Authenticated-data Content Type .................................. 23
9.1 AuthenticatedData Type ...................................... 23 9.1 AuthenticatedData Type ...................................... 23
9.2 MAC Generation .............................................. 25 9.2 MAC Generation .............................................. 25
9.3 MAC Validation .............................................. 26 9.3 MAC Verification ............................................ 26
10 Useful Types ..................................................... 27 10 Useful Types ..................................................... 27
10.1 Algorithm Identifier Types ................................. 27 10.1 Algorithm Identifier Types ................................. 27
10.1.1 DigestAlgorithmIdentifier .......................... 27 10.1.1 DigestAlgorithmIdentifier .......................... 27
10.1.2 SignatureAlgorithmIdentifier ....................... 27 10.1.2 SignatureAlgorithmIdentifier ....................... 27
10.1.3 KeyEncryptionAlgorithmIdentifier ................... 27 10.1.3 KeyEncryptionAlgorithmIdentifier ................... 27
10.1.4 ContentEncryptionAlgorithmIdentifier ............... 28 10.1.4 ContentEncryptionAlgorithmIdentifier ............... 28
10.1.5 MessageAuthenticationCodeAlgorithm ................. 28 10.1.5 MessageAuthenticationCodeAlgorithm ................. 28
10.2 Other Useful Types ......................................... 28 10.2 Other Useful Types ......................................... 28
10.2.1 CertificateRevocationLists ......................... 28 10.2.1 CertificateRevocationLists ......................... 28
10.2.2 CertificateChoices ................................. 29 10.2.2 CertificateChoices ................................. 29
skipping to change at page 3, line 22 skipping to change at page 3, line 22
12.1.2 MD5 ................................................ 35 12.1.2 MD5 ................................................ 35
12.2 Signature Algorithms ....................................... 35 12.2 Signature Algorithms ....................................... 35
12.2.1 DSA ................................................ 36 12.2.1 DSA ................................................ 36
12.2.2 RSA ................................................ 36 12.2.2 RSA ................................................ 36
12.3 Key Management Algorithms .................................. 36 12.3 Key Management Algorithms .................................. 36
12.3.1 Key Agreement Algorithms ........................... 36 12.3.1 Key Agreement Algorithms ........................... 36
12.3.1.1 X9.42 Ephemeral-Static Diffie-Hellman .... 37 12.3.1.1 X9.42 Ephemeral-Static Diffie-Hellman .... 37
12.3.2 Key Transport Algorithms ........................... 38 12.3.2 Key Transport Algorithms ........................... 38
12.3.2.1 RSA ...................................... 38 12.3.2.1 RSA ...................................... 38
12.3.3 Symmetric Key-Encryption Key Algorithms ............ 39 12.3.3 Symmetric Key-Encryption Key Algorithms ............ 39
12.3.3.1 Triple-DES Key Wrap ...................... 39 12.3.3.1 Triple-DES Key Wrap ...................... 40
12.3.3.2 RC2 Key Wrap ............................. 40 12.3.3.2 RC2 Key Wrap ............................. 40
12.4 Content Encryption Algorithms ............................... 40 12.4 Content Encryption Algorithms ............................... 41
12.4.1 Triple-DES CBC ...................................... 41 12.4.1 Triple-DES CBC ...................................... 41
12.4.2 RC2 CBC ............................................. 41 12.4.2 RC2 CBC ............................................. 41
12.5 Message Authentication Code Algorithms ...................... 41 12.5 Message Authentication Code Algorithms ...................... 42
12.5.1 HMAC with SHA-1 ..................................... 42 12.5.1 HMAC with SHA-1 ..................................... 42
12.6 Triple-DES and RC2 Key Wrap Algorithms ...................... 42 12.6 Triple-DES and RC2 Key Wrap Algorithms ...................... 42
12.6.1 Key Checksum ........................................ 43 12.6.1 Key Checksum ........................................ 43
12.6.2 Triple-DES Key Wrap ................................. 43 12.6.2 Triple-DES Key Wrap ................................. 43
12.6.3 Triple-DES Key Unwrap ............................... 44 12.6.3 Triple-DES Key Unwrap ............................... 44
12.6.4 RC2 Key Wrap ........................................ 44 12.6.4 RC2 Key Wrap ........................................ 44
12.6.5 RC2 Key Unwrap ...................................... 45 12.6.5 RC2 Key Unwrap ...................................... 45
Appendix A: ASN.1 Module ............................................ 46 Appendix A: ASN.1 Module ............................................ 46
References ........................................................... 53 References ........................................................... 54
Security Considerations .............................................. 55 Security Considerations .............................................. 55
Acknowledgments ...................................................... 57 Acknowledgments ...................................................... 57
Author Address ....................................................... 57 Author Address ....................................................... 58
Full Copyright Statement ............................................. 57 Full Copyright Statement ............................................. 58
1 Introduction 1 Introduction
This document describes the Cryptographic Message Syntax. This This document describes the Cryptographic Message Syntax. This
syntax is used to digitally sign, digest, authenticate, or encrypt syntax is used to digitally sign, digest, authenticate, or encrypt
arbitrary messages. arbitrary messages.
The Cryptographic Message Syntax describes an encapsulation syntax The Cryptographic Message Syntax describes an encapsulation syntax
for data protection. It supports digital signatures and encryption. for data protection. It supports digital signatures and encryption.
The syntax allows multiple encapsulation, so one encapsulation The syntax allows multiple encapsulation, so one encapsulation
skipping to change at page 4, line 51 skipping to change at page 4, line 51
this document. this document.
An implementation that conforms to this specification must implement An implementation that conforms to this specification must implement
the protection content, ContentInfo, and must implement the data, the protection content, ContentInfo, and must implement the data,
signed-data, and enveloped-data content types. The other content signed-data, and enveloped-data content types. The other content
types may be implemented if desired. types may be implemented if desired.
As a general design philosophy, each content type permits single pass As a general design philosophy, each content type permits single pass
processing using indefinite-length Basic Encoding Rules (BER) processing using indefinite-length Basic Encoding Rules (BER)
encoding. Single-pass operation is especially helpful if content is encoding. Single-pass operation is especially helpful if content is
large, stored on tapes, or is 'piped' from another process. Single- large, stored on tapes, or is "piped" from another process. Single-
pass operation has one significant drawback: it is difficult to pass operation has one significant drawback: it is difficult to
perform encode operations using the Distinguished Encoding Rules perform encode operations using the Distinguished Encoding Rules
(DER) encoding in a single pass since the lengths of the various (DER) encoding in a single pass since the lengths of the various
components may not be known in advance. However, signed attributes components may not be known in advance. However, signed attributes
within the signed-data content type and authenticated attributes within the signed-data content type and authenticated attributes
within the authenticated-data content type require DER encoding. within the authenticated-data content type require DER encoding.
Signed attributes and authenticated attributes must be transmitted in Signed attributes and authenticated attributes must be transmitted in
DER form to ensure that recipients can validate a content that DER form to ensure that recipients can verify a content that contains
contains an unrecognized attribute. Signed attributes and one or more unrecognized attributes. Signed attributes and
authenticated attributes are the only CMS data types that require DER authenticated attributes are the only CMS data types that require DER
encoding. encoding.
3 General Syntax 3 General Syntax
The Cryptographic Message Syntax (CMS) associates a content type The Cryptographic Message Syntax (CMS) associates a content type
identifier with a content. The syntax shall have ASN.1 type identifier with a content. The syntax shall have ASN.1 type
ContentInfo: ContentInfo:
ContentInfo ::= SEQUENCE { ContentInfo ::= SEQUENCE {
skipping to change at page 6, line 28 skipping to change at page 6, line 28
revocation lists (CRLs). revocation lists (CRLs).
The process by which signed-data is constructed involves the The process by which signed-data is constructed involves the
following steps: following steps:
1. For each signer, a message digest, or hash value, is computed 1. For each signer, a message digest, or hash value, is computed
on the content with a signer-specific message-digest algorithm. on the content with a signer-specific message-digest algorithm.
If the signer is signing any information other than the content, If the signer is signing any information other than the content,
the message digest of the content and the other information are the message digest of the content and the other information are
digested with the signer's message digest algorithm (see Section digested with the signer's message digest algorithm (see Section
5.4), and the result becomes the 'message digest.' 5.4), and the result becomes the "message digest."
2. For each signer, the message digest is digitally signed using 2. For each signer, the message digest is digitally signed using
the signer's private key. the signer's private key.
3. For each signer, the signature value and other signer-specific 3. For each signer, the signature value and other signer-specific
information are collected into a SignerInfo value, as defined in information are collected into a SignerInfo value, as defined in
Section 5.3. Certificates and CRLs for each signer, and those not Section 5.3. Certificates and CRLs for each signer, and those not
corresponding to any signer, are collected in this step. corresponding to any signer, are collected in this step.
4. The message digest algorithms for all the signers and the 4. The message digest algorithms for all the signers and the
SignerInfo values for all the signers are collected together with SignerInfo values for all the signers are collected together with
the content into a SignedData value, as defined in Section 5.1. the content into a SignedData value, as defined in Section 5.1.
A recipient independently computes the message digest. This message A recipient independently computes the message digest. This message
digest and the signer's public key are used to validate the signature digest and the signer's public key are used to verify the signature
value. The signer's public key is referenced either by an issuer value. The signer's public key is referenced either by an issuer
distinguished name along with an issuer-specific serial number or by distinguished name along with an issuer-specific serial number or by
a subject key identifier that uniquely identifies the certificate a subject key identifier that uniquely identifies the certificate
containing the public key. The signer's certificate may be included containing the public key. The signer's certificate may be included
in the SignedData certificates field. in the SignedData certificates field.
This section is divided into six parts. The first part describes the This section is divided into six parts. The first part describes the
top-level type SignedData, the second part describes top-level type SignedData, the second part describes
EncapsulatedContentInfo, the third part describes the per-signer EncapsulatedContentInfo, the third part describes the per-signer
information type SignerInfo, and the fourth, fifth, and sixth parts information type SignerInfo, and the fourth, fifth, and sixth parts
describe the message digest calculation, signature generation, and describe the message digest calculation, signature generation, and
signature validation processes, respectively. signature verification processes, respectively.
5.1 SignedData Type 5.1 SignedData Type
The following object identifier identifies the signed-data content The following object identifier identifies the signed-data content
type: type:
id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 } us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 }
The signed-data content type shall have ASN.1 type SignedData: The signed-data content type shall have ASN.1 type SignedData:
skipping to change at page 8, line 8 skipping to change at page 8, line 8
message digest algorithms employed by all of the signers, in any message digest algorithms employed by all of the signers, in any
order, to facilitate one-pass signature verification. The message order, to facilitate one-pass signature verification. The message
digesting process is described in Section 5.4. digesting process is described in Section 5.4.
encapContentInfo is the signed content, consisting of a content encapContentInfo is the signed content, consisting of a content
type identifier and the content itself. Details of the type identifier and the content itself. Details of the
EncapsulatedContentInfo type are discussed in section 5.2. EncapsulatedContentInfo type are discussed in section 5.2.
certificates is a collection of certificates. It is intended that certificates is a collection of certificates. It is intended that
the set of certificates be sufficient to contain chains from a the set of certificates be sufficient to contain chains from a
recognized 'root' or 'top-level certification authority' to all of recognized "root" or "top-level certification authority" to all of
the signers in the signerInfos field. There may be more the signers in the signerInfos field. There may be more
certificates than necessary, and there may be certificates certificates than necessary, and there may be certificates
sufficient to contain chains from two or more independent top- sufficient to contain chains from two or more independent top-
level certification authorities. There may also be fewer level certification authorities. There may also be fewer
certificates than necessary, if it is expected that recipients certificates than necessary, if it is expected that recipients
have an alternate means of obtaining necessary certificates (e.g., have an alternate means of obtaining necessary certificates (e.g.,
from a previous set of certificates). As discussed above, if from a previous set of certificates). As discussed above, if
attribute certificates are present, then the value of version attribute certificates are present, then the value of version
shall be 3. shall be 3.
skipping to change at page 8, line 51 skipping to change at page 8, line 51
meanings: meanings:
eContentType is an object identifier that uniquely specifies the eContentType is an object identifier that uniquely specifies the
content type. content type.
eContent is the content itself, carried as an octet string. The eContent is the content itself, carried as an octet string. The
eContent need not be DER encoded. eContent need not be DER encoded.
The optional omission of the eContent within the The optional omission of the eContent within the
EncapsulatedContentInfo field makes it possible to construct EncapsulatedContentInfo field makes it possible to construct
'external signatures.' In the case of external signatures, the "external signatures." In the case of external signatures, the
content being signed is absent from the EncapsulatedContentInfo value content being signed is absent from the EncapsulatedContentInfo value
included in the signed-data content type. If the eContent value included in the signed-data content type. If the eContent value
within EncapsulatedContentInfo is absent, then the signatureValue is within EncapsulatedContentInfo is absent, then the signatureValue is
calculated and the eContentType is assigned as though the eContent calculated and the eContentType is assigned as though the eContent
value was present. value was present.
In the degenerate case where there are no signers, the In the degenerate case where there are no signers, the
EncapsulatedContentInfo value being 'signed' is irrelevant. In this EncapsulatedContentInfo value being "signed" is irrelevant. In this
case, the content type within the EncapsulatedContentInfo value being case, the content type within the EncapsulatedContentInfo value being
'signed' should be id-data (as defined in section 4), and the content "signed" should be id-data (as defined in section 4), and the content
field of the EncapsulatedContentInfo value should be omitted. field of the EncapsulatedContentInfo value should be omitted.
5.3 SignerInfo Type 5.3 SignerInfo Type
Per-signer information is represented in the type SignerInfo: Per-signer information is represented in the type SignerInfo:
SignerInfo ::= SEQUENCE { SignerInfo ::= SEQUENCE {
version CMSVersion, version CMSVersion,
sid SignerIdentifier, sid SignerIdentifier,
digestAlgorithm DigestAlgorithmIdentifier, digestAlgorithm DigestAlgorithmIdentifier,
skipping to change at page 10, line 7 skipping to change at page 10, line 7
The fields of type SignerInfo have the following meanings: The fields of type SignerInfo have the following meanings:
version is the syntax version number. If the SignerIdentifier is version is the syntax version number. If the SignerIdentifier is
the CHOICE issuerAndSerialNumber, then the version shall be 1. If the CHOICE issuerAndSerialNumber, then the version shall be 1. If
the SignerIdentifier is subjectKeyIdentifier, then the version the SignerIdentifier is subjectKeyIdentifier, then the version
shall be 3. shall be 3.
sid specifies the signer's certificate (and thereby the signer's sid specifies the signer's certificate (and thereby the signer's
public key). The signer's public key is needed by the recipient public key). The signer's public key is needed by the recipient
to validate the signature. SignerIdentifier provides two to verify the signature. SignerIdentifier provides two
alternatives for specifying the signer's public key. The alternatives for specifying the signer's public key. The
issuerAndSerialNumber alternative identifies the signer's issuerAndSerialNumber alternative identifies the signer's
certificate by the issuer's distinguished name and the certificate certificate by the issuer's distinguished name and the certificate
serial number; the subjectKeyIdentifier identifies the signer's serial number; the subjectKeyIdentifier identifies the signer's
certificate by the X.509 subjectKeyIdentifier extension value. certificate by the X.509 subjectKeyIdentifier extension value.
digestAlgorithm identifies the message digest algorithm, and any digestAlgorithm identifies the message digest algorithm, and any
associated parameters, used by the signer. The message digest is associated parameters, used by the signer. The message digest is
computed on either the content being signed or the content computed on either the content being signed or the content
together with the signed attributes using the process described in together with the signed attributes using the process described in
skipping to change at page 11, line 20 skipping to change at page 11, line 20
attrValues is a set of values that comprise the attribute. The attrValues is a set of values that comprise the attribute. The
type of each value in the set can be determined uniquely by type of each value in the set can be determined uniquely by
attrType. attrType.
5.4 Message Digest Calculation Process 5.4 Message Digest Calculation Process
The message digest calculation process computes a message digest on The message digest calculation process computes a message digest on
either the content being signed or the content together with the either the content being signed or the content together with the
signed attributes. In either case, the initial input to the message signed attributes. In either case, the initial input to the message
digest calculation process is the 'value' of the encapsulated content digest calculation process is the "value" of the encapsulated content
being signed. Specifically, the initial input is the being signed. Specifically, the initial input is the
encapContentInfo eContent OCTET STRING to which the signing process encapContentInfo eContent OCTET STRING to which the signing process
is applied. Only the octets comprising the value of the eContent is applied. Only the octets comprising the value of the eContent
OCTET STRING are input to the message digest algorithm, not the tag OCTET STRING are input to the message digest algorithm, not the tag
or the length octets. or the length octets.
The result of the message digest calculation process depends on The result of the message digest calculation process depends on
whether the signedAttributes field is present. When the field is whether the signedAttributes field is present. When the field is
absent, the result is just the message digest of the content as absent, the result is just the message digest of the content as
described above. When the field is present, however, the result is described above. When the field is present, however, the result is
skipping to change at page 12, line 23 skipping to change at page 12, line 23
The input to the signature generation process includes the result of The input to the signature generation process includes the result of
the message digest calculation process and the signer's private key. the message digest calculation process and the signer's private key.
The details of the signature generation depend on the signature The details of the signature generation depend on the signature
algorithm employed. The object identifier, along with any algorithm employed. The object identifier, along with any
parameters, that specifies the signature algorithm employed by the parameters, that specifies the signature algorithm employed by the
signer is carried in the signatureAlgorithm field. The signature signer is carried in the signatureAlgorithm field. The signature
value generated by the signer is encoded as an OCTET STRING and value generated by the signer is encoded as an OCTET STRING and
carried in the signature field. carried in the signature field.
5.6 Message Signature Validation Process 5.6 Message Signature Verification Process
The input to the signature validation process includes the result of The input to the signature verification process includes the result
the message digest calculation process and the signer's public key. of the message digest calculation process and the signer's public
The details of the signature validation depend on the signature key. The recipient may obtain the correct public key for the signer
algorithm employed. by any means, but the preferred method is from a certificate obtained
from the SignedData certificates field. The selection and validation
of the signer's public key may be based on certification path
validation (see [PROFILE]) as well as other external context, but is
beyond the scope of this document. The details of the signature
verification depend on the signature algorithm employed.
The recipient may not rely on any message digest values computed by The recipient may not rely on any message digest values computed by
the originator. If the signedData signerInfo includes the originator. If the signedData signerInfo includes
signedAttributes, then the content message digest must be calculated signedAttributes, then the content message digest must be calculated
as described in section 5.4. For the signature to be valid, the as described in section 5.4. For the signature to be valid, the
message digest value calculated by the recipient must be the same as message digest value calculated by the recipient must be the same as
the value of the messageDigest attribute included in the the value of the messageDigest attribute included in the
signedAttributes of the signedData signerInfo. signedAttributes of the signedData signerInfo.
6 Enveloped-data Content Type 6 Enveloped-data Content Type
The enveloped-data content type consists of an encrypted content of The enveloped-data content type consists of an encrypted content of
any type and encrypted content-encryption keys for one or more any type and encrypted content-encryption keys for one or more
recipients. The combination of the encrypted content and one recipients. The combination of the encrypted content and one
encrypted content-encryption key for a recipient is a 'digital encrypted content-encryption key for a recipient is a "digital
envelope' for that recipient. Any type of content can be enveloped envelope" for that recipient. Any type of content can be enveloped
for an arbitrary number of recipients using any of the three key for an arbitrary number of recipients using any of the three key
management techniques for each recipient. management techniques for each recipient.
The typical application of the enveloped-data content type will The typical application of the enveloped-data content type will
represent one or more recipients' digital envelopes on content of the represent one or more recipients' digital envelopes on content of the
data or signed-data content types. data or signed-data content types.
Enveloped-data is constructed by the following steps: Enveloped-data is constructed by the following steps:
1. A content-encryption key for a particular content-encryption 1. A content-encryption key for a particular content-encryption
skipping to change at page 15, line 7 skipping to change at page 15, line 7
originatorInfo optionally provides information about the originatorInfo optionally provides information about the
originator. It is present only if required by the key management originator. It is present only if required by the key management
algorithm. It may contain certificates and CRLs: algorithm. It may contain certificates and CRLs:
certs is a collection of certificates. certs may contain certs is a collection of certificates. certs may contain
originator certificates associated with several different key originator certificates associated with several different key
management algorithms. certs may also contain attribute management algorithms. certs may also contain attribute
certificates associated with the originator. The certificates certificates associated with the originator. The certificates
contained in certs are intended to be sufficient to make chains contained in certs are intended to be sufficient to make chains
from a recognized 'root' or 'top-level certification authority' from a recognized "root" or "top-level certification authority"
to all recipients. However, certs may contain more to all recipients. However, certs may contain more
certificates than necessary, and there may be certificates certificates than necessary, and there may be certificates
sufficient to make chains from two or more independent top- sufficient to make chains from two or more independent top-
level certification authorities. Alternatively, certs may level certification authorities. Alternatively, certs may
contain fewer certificates than necessary, if it is expected contain fewer certificates than necessary, if it is expected
that recipients have an alternate means of obtaining necessary that recipients have an alternate means of obtaining necessary
certificates (e.g., from a previous set of certificates). certificates (e.g., from a previous set of certificates).
crls is a collection of CRLs. It is intended that the set crls is a collection of CRLs. It is intended that the set
contain information sufficient to determine whether or not the contain information sufficient to determine whether or not the
skipping to change at page 20, line 20 skipping to change at page 20, line 20
The content-encryption key for the desired content-encryption The content-encryption key for the desired content-encryption
algorithm is randomly generated. The data to be protected is padded algorithm is randomly generated. The data to be protected is padded
as described below, then the padded data is encrypted using the as described below, then the padded data is encrypted using the
content-encryption key. The encryption operation maps an arbitrary content-encryption key. The encryption operation maps an arbitrary
string of octets (the data) to another string of octets (the string of octets (the data) to another string of octets (the
ciphertext) under control of a content-encryption key. The encrypted ciphertext) under control of a content-encryption key. The encrypted
data is included in the envelopedData encryptedContentInfo data is included in the envelopedData encryptedContentInfo
encryptedContent OCTET STRING. encryptedContent OCTET STRING.
The input to the content-encryption process is the 'value' of the The input to the content-encryption process is the "value" of the
content being enveloped. Only the value octets of the envelopedData content being enveloped. Only the value octets of the envelopedData
encryptedContentInfo encryptedContent OCTET STRING are encrypted; the encryptedContentInfo encryptedContent OCTET STRING are encrypted; the
OCTET STRING tag and length octets are not encrypted. OCTET STRING tag and length octets are not encrypted.
Some content-encryption algorithms assume the input length is a Some content-encryption algorithms assume the input length is a
multiple of k octets, where k is greater than one. For such multiple of k octets, where k is greater than one. For such
algorithms, the input shall be padded at the trailing end with algorithms, the input shall be padded at the trailing end with
k-(lth mod k) octets all having value k-(lth mod k), where lth is k-(lth mod k) octets all having value k-(lth mod k), where lth is
the length of the input. In other words, the input is padded at the length of the input. In other words, the input is padded at
the trailing end with one of the following strings: the trailing end with one of the following strings:
skipping to change at page 20, line 47 skipping to change at page 20, line 47
k k ... k k -- if lth mod k = 0 k k ... k k -- if lth mod k = 0
The padding can be removed unambiguously since all input is padded, The padding can be removed unambiguously since all input is padded,
including input values that are already a multiple of the block size, including input values that are already a multiple of the block size,
and no padding string is a suffix of another. This padding method is and no padding string is a suffix of another. This padding method is
well defined if and only if k is less than 256. well defined if and only if k is less than 256.
6.4 Key-encryption Process 6.4 Key-encryption Process
The input to the key-encryption process -- the value supplied to the The input to the key-encryption process -- the value supplied to the
recipient's key-encryption algorithm --is just the 'value' of the recipient's key-encryption algorithm --is just the "value" of the
content-encryption key. content-encryption key.
Any of the three key management techniques can be used for each Any of the three key management techniques can be used for each
recipient of the same encrypted content. recipient of the same encrypted content.
7 Digested-data Content Type 7 Digested-data Content Type
The digested-data content type consists of content of any type and a The digested-data content type consists of content of any type and a
message digest of the content. message digest of the content.
skipping to change at page 23, line 11 skipping to change at page 23, line 11
unprotectedAttrs is a collection of attributes that are not unprotectedAttrs is a collection of attributes that are not
encrypted. The field is optional. Useful attribute types are encrypted. The field is optional. Useful attribute types are
defined in Section 11. defined in Section 11.
9 Authenticated-data Content Type 9 Authenticated-data Content Type
The authenticated-data content type consists of content of any type, The authenticated-data content type consists of content of any type,
a message authentication code (MAC), and encrypted authentication a message authentication code (MAC), and encrypted authentication
keys for one or more recipients. The combination of the MAC and one keys for one or more recipients. The combination of the MAC and one
encrypted authentication key for a recipient is necessary for that encrypted authentication key for a recipient is necessary for that
recipient to validate the integrity of the content. Any type of recipient to verify the integrity of the content. Any type of
content can be integrity protected for an arbitrary number of content can be integrity protected for an arbitrary number of
recipients. recipients.
The process by which authenticated-data is constructed involves the The process by which authenticated-data is constructed involves the
following steps: following steps:
1. A message-authentication key for a particular message- 1. A message-authentication key for a particular message-
authentication algorithm is generated at random. authentication algorithm is generated at random.
2. The message-authentication key is encrypted for each 2. The message-authentication key is encrypted for each
skipping to change at page 23, line 34 skipping to change at page 23, line 34
3. For each recipient, the encrypted message-authentication key 3. For each recipient, the encrypted message-authentication key
and other recipient-specific information are collected into a and other recipient-specific information are collected into a
RecipientInfo value, defined in Section 6.2. RecipientInfo value, defined in Section 6.2.
4. Using the message-authentication key, the originator computes 4. Using the message-authentication key, the originator computes
a MAC value on the content. If the originator is authenticating a MAC value on the content. If the originator is authenticating
any information in addition to the content (see Section 9.2), a any information in addition to the content (see Section 9.2), a
message digest is calculated on the content, the message digest of message digest is calculated on the content, the message digest of
the content and the other information are authenticated using the the content and the other information are authenticated using the
message-authentication key, and the result becomes the 'MAC message-authentication key, and the result becomes the "MAC
value.' value."
9.1 AuthenticatedData Type 9.1 AuthenticatedData Type
The following object identifier identifies the authenticated-data The following object identifier identifies the authenticated-data
content type: content type:
id-ct-authData OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-ct-authData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16)
ct(1) 2 } ct(1) 2 }
The authenticated-data content type shall have ASN.1 type The authenticated-data content type shall have ASN.1 type
skipping to change at page 26, line 14 skipping to change at page 26, line 14
authenticatedAttributes field is performed for message digest authenticatedAttributes field is performed for message digest
calculation. The IMPLICIT [2] tag in the authenticatedAttributes calculation. The IMPLICIT [2] tag in the authenticatedAttributes
field is not used for the DER encoding, rather an EXPLICIT SET OF tag field is not used for the DER encoding, rather an EXPLICIT SET OF tag
is used. That is, the DER encoding of the SET OF tag, rather than of is used. That is, the DER encoding of the SET OF tag, rather than of
the IMPLICIT [2] tag, is to be included in the message digest the IMPLICIT [2] tag, is to be included in the message digest
calculation along with the length and content octets of the calculation along with the length and content octets of the
authenticatedAttributes value. authenticatedAttributes value.
The message digest calculation process computes a message digest on The message digest calculation process computes a message digest on
the content being authenticated. The initial input to the message the content being authenticated. The initial input to the message
digest calculation process is the 'value' of the encapsulated content digest calculation process is the "value" of the encapsulated content
being authenticated. Specifically, the input is the encapContentInfo being authenticated. Specifically, the input is the encapContentInfo
eContent OCTET STRING to which the authentication process is applied. eContent OCTET STRING to which the authentication process is applied.
Only the octets comprising the value of the encapContentInfo eContent Only the octets comprising the value of the encapContentInfo eContent
OCTET STRING are input to the message digest algorithm, not the tag OCTET STRING are input to the message digest algorithm, not the tag
or the length octets. This has the advantage that the length of the or the length octets. This has the advantage that the length of the
content being authenticated need not be known in advance. Although content being authenticated need not be known in advance. Although
the encapContentInfo eContent OCTET STRING tag and length octets are the encapContentInfo eContent OCTET STRING tag and length octets are
not included in the message digest calculation, they are still not included in the message digest calculation, they are still
protected by other means. The length octets are protected by the protected by other means. The length octets are protected by the
nature of the message digest algorithm since it is computationally nature of the message digest algorithm since it is computationally
skipping to change at page 26, line 37 skipping to change at page 26, line 37
The input to the MAC calculation process includes the MAC input data, The input to the MAC calculation process includes the MAC input data,
defined above, and an authentication key conveyed in a recipientInfo defined above, and an authentication key conveyed in a recipientInfo
structure. The details of MAC calculation depend on the MAC structure. The details of MAC calculation depend on the MAC
algorithm employed (e.g., HMAC). The object identifier, along with algorithm employed (e.g., HMAC). The object identifier, along with
any parameters, that specifies the MAC algorithm employed by the any parameters, that specifies the MAC algorithm employed by the
originator is carried in the macAlgorithm field. The MAC value originator is carried in the macAlgorithm field. The MAC value
generated by the originator is encoded as an OCTET STRING and carried generated by the originator is encoded as an OCTET STRING and carried
in the mac field. in the mac field.
9.3 MAC Validation 9.3 MAC Verification
The input to the MAC validation process includes the input data The input to the MAC verification process includes the input data
(determined based on the presence or absence of the (determined based on the presence or absence of the
authenticatedAttributes field, as defined in 9.2), and the authenticatedAttributes field, as defined in 9.2), and the
authentication key conveyed in recipientInfo. The details of the MAC authentication key conveyed in recipientInfo. The details of the MAC
validation process depend on the MAC algorithm employed. verification process depend on the MAC algorithm employed.
The recipient may not rely on any MAC values or message digest values The recipient may not rely on any MAC values or message digest values
computed by the originator. The content is authenticated as computed by the originator. The content is authenticated as
described in section 9.2. If the originator includes authenticated described in section 9.2. If the originator includes authenticated
attributes, then the content of the authenticatedAttributes is attributes, then the content of the authenticatedAttributes is
authenticated as described in section 9.2. For authentication to authenticated as described in section 9.2. For authentication to
succeed, the message MAC value calculated by the recipient must be succeed, the message MAC value calculated by the recipient must be
the same as the value of the mac field. Similarly, for the same as the value of the mac field. Similarly, for
authentication to succeed when the authenticatedAttributes field is authentication to succeed when the authenticatedAttributes field is
present, the content message digest value calculated by the recipient present, the content message digest value calculated by the recipient
skipping to change at page 29, line 8 skipping to change at page 29, line 8
information sufficient to determine whether the certificates and information sufficient to determine whether the certificates and
attribute certificates with which the set is associated are revoked attribute certificates with which the set is associated are revoked
or not. However, there may be more CRLs than necessary or there may or not. However, there may be more CRLs than necessary or there may
be fewer CRLs than necessary. be fewer CRLs than necessary.
The CertificateList may contain a CRL, an Authority Revocation List The CertificateList may contain a CRL, an Authority Revocation List
(ARL), a Delta Revocation List, or an Attribute Certificate (ARL), a Delta Revocation List, or an Attribute Certificate
Revocation List. All of these lists share a common syntax. Revocation List. All of these lists share a common syntax.
CRLs are specified in X.509, and they are profiled for use in the CRLs are specified in X.509, and they are profiled for use in the
Internet in RFC TBD [PROFILE]. Internet in RFC 2459 [PROFILE].
The definition of CertificateList is imported from X.509. The definition of CertificateList is imported from X.509.
CertificateRevocationLists ::= SET OF CertificateList CertificateRevocationLists ::= SET OF CertificateList
10.2.2 CertificateChoices 10.2.2 CertificateChoices
The CertificateChoices type gives either a PKCS #6 extended The CertificateChoices type gives either a PKCS #6 extended
certificate [PKCS#6], an X.509 certificate, or an X.509 attribute certificate [PKCS#6], an X.509 certificate, or an X.509 attribute
certificate. The PKCS #6 extended certificate is obsolete. PKCS #6 certificate. The PKCS #6 extended certificate is obsolete. PKCS #6
certificates are included for backward compatibility, and their use certificates are included for backward compatibility, and their use
should be avoided. The Internet profile of X.509 certificates is should be avoided. The Internet profile of X.509 certificates is
specified in the 'Internet X.509 Public Key Infrastructure: specified in the "Internet X.509 Public Key Infrastructure:
Certificate and CRL Profile' [PROFILE]. Certificate and CRL Profile" [PROFILE].
The definitions of Certificate and AttributeCertificate are imported The definitions of Certificate and AttributeCertificate are imported
from X.509. from X.509.
CertificateChoices ::= CHOICE { CertificateChoices ::= CHOICE {
certificate Certificate, -- See X.509 certificate Certificate, -- See X.509
extendedCertificate [0] IMPLICIT ExtendedCertificate, -- Obsolete extendedCertificate [0] IMPLICIT ExtendedCertificate, -- Obsolete
attrCert [1] IMPLICIT AttributeCertificate } -- See X.509 and X9.57 attrCert [1] IMPLICIT AttributeCertificate } -- See X.509 and X9.57
10.2.3 CertificateSet 10.2.3 CertificateSet
The CertificateSet type provides a set of certificates. It is The CertificateSet type provides a set of certificates. It is
intended that the set be sufficient to contain chains from a intended that the set be sufficient to contain chains from a
recognized 'root' or 'top-level certification authority' to all of recognized "root" or "top-level certification authority" to all of
the sender certificates with which the set is associated. However, the sender certificates with which the set is associated. However,
there may be more certificates than necessary, or there may be fewer there may be more certificates than necessary, or there may be fewer
than necessary. than necessary.
The precise meaning of a 'chain' is outside the scope of this The precise meaning of a "chain" is outside the scope of this
document. Some applications may impose upper limits on the length of document. Some applications may impose upper limits on the length of
a chain; others may enforce certain relationships between the a chain; others may enforce certain relationships between the
subjects and issuers of certificates within a chain. subjects and issuers of certificates within a chain.
CertificateSet ::= SET OF CertificateChoices CertificateSet ::= SET OF CertificateChoices
10.2.4 IssuerAndSerialNumber 10.2.4 IssuerAndSerialNumber
The IssuerAndSerialNumber type identifies a certificate, and thereby The IssuerAndSerialNumber type identifies a certificate, and thereby
an entity and a public key, by the distinguished name of the an entity and a public key, by the distinguished name of the
skipping to change at page 33, line 7 skipping to change at page 33, line 7
Signing-time attribute values have ASN.1 type SigningTime: Signing-time attribute values have ASN.1 type SigningTime:
SigningTime ::= Time SigningTime ::= Time
Time ::= CHOICE { Time ::= CHOICE {
utcTime UTCTime, utcTime UTCTime,
generalizedTime GeneralizedTime } generalizedTime GeneralizedTime }
Note: The definition of Time matches the one specified in the 1997 Note: The definition of Time matches the one specified in the 1997
version of X.509. version of X.509.
Dates through the year 2049 must be encoded as UTCTime, and dates in Dates between 1 January 1950 and 31 December 2049 (inclusive) must be
the year 2050 or later must be encoded as GeneralizedTime. encoded as UTCTime. Any dates with year values before 1950 or after
2049 must be encoded as GeneralizedTime.
UTCTime values must be expressed in Greenwich Mean Time (Zulu) and UTCTime values must be expressed in Greenwich Mean Time (Zulu) and
must include seconds (i.e., times are YYMMDDHHMMSSZ), even where the must include seconds (i.e., times are YYMMDDHHMMSSZ), even where the
number of seconds is zero. Midnight (GMT) must be represented as number of seconds is zero. Midnight (GMT) must be represented as
'YYMMDD000000Z'. Century information is implicit, and the century "YYMMDD000000Z". Century information is implicit, and the century
must be determined as follows: must be determined as follows:
Where YY is greater than or equal to 50, the year shall be Where YY is greater than or equal to 50, the year shall be
interpreted as 19YY; and interpreted as 19YY; and
Where YY is less than 50, the year shall be interpreted as 20YY. Where YY is less than 50, the year shall be interpreted as 20YY.
GeneralizedTime values shall be expressed in Greenwich Mean Time GeneralizedTime values shall be expressed in Greenwich Mean Time
(Zulu) and must include seconds (i.e., times are YYYYMMDDHHMMSSZ), (Zulu) and must include seconds (i.e., times are YYYYMMDDHHMMSSZ),
even where the number of seconds is zero. GeneralizedTime values even where the number of seconds is zero. GeneralizedTime values
skipping to change at page 37, line 8 skipping to change at page 37, line 8
encryption algorithms. For example, a 128-bit RC2 content-encryption encryption algorithms. For example, a 128-bit RC2 content-encryption
key may be wrapped with 168-bit Triple-DES key-encryption key. key may be wrapped with 168-bit Triple-DES key-encryption key.
Similarly, a 40-bit RC2 content-encryption key may be wrapped with Similarly, a 40-bit RC2 content-encryption key may be wrapped with
128-bit RC2 key-encryption key. 128-bit RC2 key-encryption key.
For key agreement of RC2 key-encryption keys, 128 bits must be For key agreement of RC2 key-encryption keys, 128 bits must be
generated as input to the key expansion process used to compute the generated as input to the key expansion process used to compute the
RC2 effective key [RC2]. RC2 effective key [RC2].
Key agreement algorithm identifiers are located in the EnvelopedData Key agreement algorithm identifiers are located in the EnvelopedData
RecipientInfo KeyAgreeRecipientInfo keyEncryptionAlgorithm field. RecipientInfo KeyAgreeRecipientInfo keyEncryptionAlgorithm and
AuthenticatedData RecipientInfo KeyAgreeRecipientInfo
keyEncryptionAlgorithm fields.
Key wrap algorithm identifiers are located in the KeyWrapAlgorithm Key wrap algorithm identifiers are located in the KeyWrapAlgorithm
parameters within the EnvelopedData RecipientInfo parameters within the EnvelopedData RecipientInfo
KeyAgreeRecipientInfo keyEncryptionAlgorithm field. KeyAgreeRecipientInfo keyEncryptionAlgorithm and AuthenticatedData
RecipientInfo KeyAgreeRecipientInfo keyEncryptionAlgorithm fields.
Wrapped content-encryption keys are located in the EnvelopedData Wrapped content-encryption keys are located in the EnvelopedData
RecipientInfo KeyAgreeRecipientInfo recipientEncryptedKeys RecipientInfo KeyAgreeRecipientInfo recipientEncryptedKeys
encryptedKey field. encryptedKey and AuthenticatedData RecipientInfo
KeyAgreeRecipientInfo recipientEncryptedKeys encryptedKey fields.
12.3.1.1 X9.42 Ephemeral-Static Diffie-Hellman 12.3.1.1 X9.42 Ephemeral-Static Diffie-Hellman
Ephemeral-Static Diffie-Hellman key agreement is defined in RFC TBD1 Ephemeral-Static Diffie-Hellman key agreement is defined in RFC TBD1
[DH-X9.42]. When using Ephemeral-Static Diffie-Hellman, the [DH-X9.42]. When using Ephemeral-Static Diffie-Hellman, the
EnvelopedData RecipientInfo KeyAgreeRecipientInfo fields are used as EnvelopedData RecipientInfo KeyAgreeRecipientInfo and
follows: AuthenticatedData RecipientInfo KeyAgreeRecipientInfo fields are used
as follows:
version must be 3. version must be 3.
originator must be the originatorKey alternative. The originator must be the originatorKey alternative. The
originatorKey algorithm fields must contain the dh-public-number originatorKey algorithm fields must contain the dh-public-number
object identifier with absent parameters. The originatorKey object identifier with absent parameters. The originatorKey
publicKey field must contain the sender's ephemeral public key. publicKey field must contain the sender's ephemeral public key.
The dh-public-number object identifier is: The dh-public-number object identifier is:
dh-public-number OBJECT IDENTIFIER ::= { iso(1) member-body(2) dh-public-number OBJECT IDENTIFIER ::= { iso(1) member-body(2)
skipping to change at page 38, line 31 skipping to change at page 38, line 32
specified by the KeyWrapAlgortihm. specified by the KeyWrapAlgortihm.
12.3.2 Key Transport Algorithms 12.3.2 Key Transport Algorithms
CMS implementations should include key transport using RSA. RSA CMS implementations should include key transport using RSA. RSA
implementations must include key transport of Triple-DES content- implementations must include key transport of Triple-DES content-
encryption keys. RSA implementations should include key transport of encryption keys. RSA implementations should include key transport of
RC2 content-encryption keys. RC2 content-encryption keys.
Key transport algorithm identifiers are located in the EnvelopedData Key transport algorithm identifiers are located in the EnvelopedData
RecipientInfo KeyTransRecipientInfo keyEncryptionAlgorithm field. RecipientInfo KeyTransRecipientInfo keyEncryptionAlgorithm and
AuthenticatedData RecipientInfo KeyTransRecipientInfo
keyEncryptionAlgorithm fields.
Key transport encrypted content-encryption keys are located in the Key transport encrypted content-encryption keys are located in the
EnvelopedData RecipientInfo KeyTransRecipientInfo EncryptedKey field. EnvelopedData RecipientInfo KeyTransRecipientInfo EncryptedKey and
AuthenticatedData RecipientInfo KeyTransRecipientInfo EncryptedKey
fields.
12.3.2.1 RSA 12.3.2.1 RSA
The RSA key transport algorithm is the RSA encryption scheme defined The RSA key transport algorithm is the RSA encryption scheme defined
in RFC 2313 [PKCS#1], block type is 02, where the message to be in RFC 2313 [PKCS#1], block type is 02, where the message to be
encrypted is the content-encryption key. The algorithm identifier encrypted is the content-encryption key. The algorithm identifier
for RSA is: for RSA is:
rsaEncryption OBJECT IDENTIFIER ::= { iso(1) member-body(2) rsaEncryption OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1 } us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1 }
skipping to change at page 39, line 28 skipping to change at page 39, line 33
CMS implementations may include symmetric key-encryption key CMS implementations may include symmetric key-encryption key
management. Such CMS implementations must include Triple-DES key- management. Such CMS implementations must include Triple-DES key-
encryption keys wrapping Triple-DES content-encryption keys, and such encryption keys wrapping Triple-DES content-encryption keys, and such
CMS implementations should include RC2 key-encryption keys wrapping CMS implementations should include RC2 key-encryption keys wrapping
RC2 content-encryption keys. A CMS implementation may support mixed RC2 content-encryption keys. A CMS implementation may support mixed
key-encryption and content-encryption algorithms. For example, a key-encryption and content-encryption algorithms. For example, a
40-bit RC2 content-encryption key may be wrapped with 168-bit Triple- 40-bit RC2 content-encryption key may be wrapped with 168-bit Triple-
DES key-encryption key or with a 128-bit RC2 key-encryption key. DES key-encryption key or with a 128-bit RC2 key-encryption key.
Key wrap algorithm identifiers are located in the EnvelopedData Key wrap algorithm identifiers are located in the EnvelopedData
RecipientInfo KEKRecipientInfo keyEncryptionAlgorithm field. RecipientInfo KEKRecipientInfo keyEncryptionAlgorithm and
AuthenticatedData RecipientInfo KEKRecipientInfo
keyEncryptionAlgorithm fields.
Wrapped content-encryption keys are located in the EnvelopedData Wrapped content-encryption keys are located in the EnvelopedData
RecipientInfo KEKRecipientInfo encryptedKey field. RecipientInfo KEKRecipientInfo encryptedKey and AuthenticatedData
RecipientInfo KEKRecipientInfo encryptedKey fields.
The output of a key agreement algorithm is a key-encryption key, and The output of a key agreement algorithm is a key-encryption key, and
this key-encryption key is used to encrypt the content-encryption this key-encryption key is used to encrypt the content-encryption
key. In conjunction with key agreement algorithms, CMS key. In conjunction with key agreement algorithms, CMS
implementations must include encryption of content-encryption keys implementations must include encryption of content-encryption keys
with the pairwise key-encryption key generated using a key agreement with the pairwise key-encryption key generated using a key agreement
algorithm. To support key agreement, key wrap algorithm identifiers algorithm. To support key agreement, key wrap algorithm identifiers
are located in the KeyWrapAlgorithm parameter of the EnvelopedData are located in the KeyWrapAlgorithm parameter of the EnvelopedData
RecipientInfo KeyAgreeRecipientInfo keyEncryptionAlgorithm field, and RecipientInfo KeyAgreeRecipientInfo keyEncryptionAlgorithm and
wrapped content-encryption keys are located in the EnvelopedData AuthenticatedData RecipientInfo KeyAgreeRecipientInfo
keyEncryptionAlgorithm fields, and wrapped content-encryption keys
are located in the EnvelopedData RecipientInfo KeyAgreeRecipientInfo
recipientEncryptedKeys encryptedKey and AuthenticatedData
RecipientInfo KeyAgreeRecipientInfo recipientEncryptedKeys RecipientInfo KeyAgreeRecipientInfo recipientEncryptedKeys
encryptedKey field. encryptedKey fields.
12.3.3.1 Triple-DES Key Wrap 12.3.3.1 Triple-DES Key Wrap
Triple-DES key encryption has the algorithm identifier: Triple-DES key encryption has the algorithm identifier:
id-alg-CMS3DESwrap OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-alg-CMS3DESwrap OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) alg(3) 6 } us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) alg(3) 6 }
The AlgorithmIdentifier parameter field must be NULL. The AlgorithmIdentifier parameter field must be NULL.
skipping to change at page 40, line 46 skipping to change at page 41, line 11
Out-of-band distribution of the RC2 key-encryption key used to Out-of-band distribution of the RC2 key-encryption key used to
encrypt the RC2 content-encryption key is beyond of the scope of this encrypt the RC2 content-encryption key is beyond of the scope of this
document. document.
12.4 Content Encryption Algorithms 12.4 Content Encryption Algorithms
CMS implementations must include Triple-DES in CBC mode. CMS CMS implementations must include Triple-DES in CBC mode. CMS
implementations should include RC2 in CBC mode. implementations should include RC2 in CBC mode.
Content encryption algorithms identifiers are located in the Content encryption algorithms identifiers are located in the
EnvelopedData EncryptedContentInfo contentEncryptionAlgorithm field EnvelopedData EncryptedContentInfo contentEncryptionAlgorithm and the
and the EncryptedData EncryptedContentInfo contentEncryptionAlgorithm EncryptedData EncryptedContentInfo contentEncryptionAlgorithm fields.
field.
Content encryption algorithms are used to encipher the content Content encryption algorithms are used to encipher the content
located in the EnvelopedData EncryptedContentInfo encryptedContent located in the EnvelopedData EncryptedContentInfo encryptedContent
field and the EncryptedData EncryptedContentInfo encryptedContent field and the EncryptedData EncryptedContentInfo encryptedContent
field. field.
12.4.1 Triple-DES CBC 12.4.1 Triple-DES CBC
The Triple-DES algorithm is described in ANSI X9.52 [3DES]. The The Triple-DES algorithm is described in ANSI X9.52 [3DES]. The
algorithm identifier for Triple-DES is: algorithm identifier for Triple-DES is:
skipping to change at page 44, line 40 skipping to change at page 44, line 40
8. Check for odd parity each of the DES key octets comprising CEK. 8. Check for odd parity each of the DES key octets comprising CEK.
If parity is incorrect, then there is an error. If parity is incorrect, then there is an error.
9. Use CEK as the content-encryption key. 9. Use CEK as the content-encryption key.
12.6.4 RC2 Key Wrap 12.6.4 RC2 Key Wrap
The RC2 key wrap algorithm encrypts a RC2 content-encryption key with The RC2 key wrap algorithm encrypts a RC2 content-encryption key with
a RC2 key-encryption key. The RC2 key wrap algorithm is: a RC2 key-encryption key. The RC2 key wrap algorithm is:
1. Let the content-encryption key be called CEK, and let the length 1. Let the content-encryption key be called CEK, and let the length
of the content-encryption key in octets be called LENGTH. of the content-encryption key in octets be called LENGTH. LENGTH
2. Compute an 8 octet key checksum value on CEK as described above is a single octet.
in Section 12.6.1, call the result ICV. 2. Let LCEK = LENGTH || CEK.
3. Let CEKICV = LENGTH || CEK || ICV. LENGTH is a single octet. 3. Let LCEKPAD = LCEK || PAD. If the length of LCEK is a multiple
4. Let CEKICVPAD = CEKICV || PAD. If the length of CEKICV is a of 8, the PAD has a length of zero. If the length of LCEK is
multiple of 8, the PAD has a length of zero. If the length of not a multiple of 8, then PAD contains the fewest number of
CEKICV is not a multiple of 8, then PAD contains the fewest random octets to make the length of LCEKPAD a multiple of 8.
number of random octets to make CEKICVPAD a multiple of 8. 4. Compute an 8 octet key checksum value on LCEKPAD as described
5. Generate 8 octets at random, call the result IV. above in Section 12.6.1, call the result ICV.
5. Encrypt CEKICVPAD in CBC mode using the key-encryption key. 5. Let LCEKPADICV = LCEKPAD || ICV.
6. Generate 8 octets at random, call the result IV.
7. Encrypt LCEKPADICV in CBC mode using the key-encryption key.
Use the random value generated in the previous step as the Use the random value generated in the previous step as the
initialization vector (IV). Call the ciphertext TEMP1. initialization vector (IV). Call the ciphertext TEMP1.
6. Let TEMP2 = IV || TEMP1. 8. Let TEMP2 = IV || TEMP1.
9. Reverse the order of the octets in TEMP2. That is, the most
7. Reverse the order of the octets in TEMP2. That is, the most
significant (first) octet is swapped with the least significant significant (first) octet is swapped with the least significant
(last) octet, and so on. Call the result TEMP3. (last) octet, and so on. Call the result TEMP3.
8. Encrypt TEMP3 in CBC mode using the key-encryption key. Use 10. Encrypt TEMP3 in CBC mode using the key-encryption key. Use
an initialization vector (IV) of 0x4adda22c79e82105. an initialization vector (IV) of 0x4adda22c79e82105.
Note: When the same content-encryption key is wrapped in different Note: When the same content-encryption key is wrapped in different
key-encryption keys, a fresh initialization vector (IV) must be key-encryption keys, a fresh initialization vector (IV) must be
generated for each invocation of the key wrap algorithm. generated for each invocation of the key wrap algorithm.
12.6.5 RC2 Key Unwrap 12.6.5 RC2 Key Unwrap
The RC2 key unwrap algorithm decrypts a RC2 content-encryption key The RC2 key unwrap algorithm decrypts a RC2 content-encryption key
using a RC2 key-encryption key. The RC2 key unwrap algorithm is: using a RC2 key-encryption key. The RC2 key unwrap algorithm is:
skipping to change at page 45, line 32 skipping to change at page 45, line 33
2. Decrypt the wrapped content-encryption key in CBC mode using 2. Decrypt the wrapped content-encryption key in CBC mode using
the key-encryption key. Use an initialization vector (IV) the key-encryption key. Use an initialization vector (IV)
of 0x4adda22c79e82105. Call the output TEMP3. of 0x4adda22c79e82105. Call the output TEMP3.
3. Reverse the order of the octets in TEMP3. That is, the most 3. Reverse the order of the octets in TEMP3. That is, the most
significant (first) octet is swapped with the least significant significant (first) octet is swapped with the least significant
(last) octet, and so on. Call the result TEMP2. (last) octet, and so on. Call the result TEMP2.
4. Decompose the TEMP2 into IV and TEMP1. IV is the most 4. Decompose the TEMP2 into IV and TEMP1. IV is the most
significant (first) 8 octets, and TEMP1 is the remaining octets. significant (first) 8 octets, and TEMP1 is the remaining octets.
5. Decrypt TEMP1 in CBC mode using the key-encryption key. Use 5. Decrypt TEMP1 in CBC mode using the key-encryption key. Use
the IV value from the previous step as the initialization vector. the IV value from the previous step as the initialization vector.
Call the ciphertext CEKICVPAD. Call the plaintext LCEKPADICV.
6. Decompose the CEKICVPAD into LENGTH, CEK, ICV, and PAD. LENGTH is 6. Decompose the LCEKPADICV into LCEKPAD, and ICV. ICV is the
the most significant (first) octet. CEK is the following LENGTH least significant (last) octet 8 octets. LCEKPAD is the
octets. ICV is the following 8 octets. PAD is the remaining remaining octets.
octets, if any. 7. Compute an 8 octet key checksum value on LCEKPAD as described
7. If PAD is more than 7 octets, then error. above in Section 12.6.1. If the computed key checksum value
8. Compute an 8 octet key checksum value on CEK as described above does not match the decrypted key checksum value, ICV, then error.
in Section 12.6.1. If the computed key checksum value does not 8. Decompose the LCEKPAD into LENGTH, CEK, and PAD. LENGTH is the
match the decrypted key checksum value, ICV, then error. most significant (first) octet. CEK is the following LENGTH
9. Use CEK as the content-encryption key. octets. PAD is the remaining octets, if any.
9. If the length of PAD is more than 7 octets, then error.
10. Use CEK as the content-encryption key.
Appendix A: ASN.1 Module Appendix A: ASN.1 Module
CryptographicMessageSyntax CryptographicMessageSyntax
{ iso(1) member-body(2) us(840) rsadsi(113549) { iso(1) member-body(2) us(840) rsadsi(113549)
pkcs(1) pkcs-9(9) smime(16) modules(0) cms(1) } pkcs(1) pkcs-9(9) smime(16) modules(0) cms(1) }
DEFINITIONS IMPLICIT TAGS ::= DEFINITIONS IMPLICIT TAGS ::=
BEGIN BEGIN
skipping to change at page 46, line 36 skipping to change at page 46, line 36
-- Directory Authentication Framework (X.509) -- Directory Authentication Framework (X.509)
AlgorithmIdentifier, AttributeCertificate, Certificate, AlgorithmIdentifier, AttributeCertificate, Certificate,
CertificateList, CertificateSerialNumber CertificateList, CertificateSerialNumber
FROM AuthenticationFramework { joint-iso-itu-t ds(5) FROM AuthenticationFramework { joint-iso-itu-t ds(5)
module(1) authenticationFramework(7) 3 } ; module(1) authenticationFramework(7) 3 } ;
-- Cryptographic Message Syntax -- Cryptographic Message Syntax
ContentInfo ::= SEQUENCE { ContentInfo ::= SEQUENCE {
contentType ContentType, contentType ContentType,
content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL } content [0] EXPLICIT ANY DEFINED BY contentType }
ContentType ::= OBJECT IDENTIFIER ContentType ::= OBJECT IDENTIFIER
SignedData ::= SEQUENCE { SignedData ::= SEQUENCE {
version CMSVersion, version CMSVersion,
digestAlgorithms DigestAlgorithmIdentifiers, digestAlgorithms DigestAlgorithmIdentifiers,
encapContentInfo EncapsulatedContentInfo, encapContentInfo EncapsulatedContentInfo,
certificates [0] IMPLICIT CertificateSet OPTIONAL, certificates [0] IMPLICIT CertificateSet OPTIONAL,
crls [1] IMPLICIT CertificateRevocationLists OPTIONAL, crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,
signerInfos SignerInfos } signerInfos SignerInfos }
skipping to change at page 53, line 30 skipping to change at page 54, line 11
Signature ::= BIT STRING Signature ::= BIT STRING
END -- of CryptographicMessageSyntax END -- of CryptographicMessageSyntax
References References
3DES American National Standards Institute. ANSI X9.52-1998, 3DES American National Standards Institute. ANSI X9.52-1998,
Triple Data Encryption Algorithm Modes of Operation. 1998. Triple Data Encryption Algorithm Modes of Operation. 1998.
DES American National Standards Institute. ANSI X3.106, DES American National Standards Institute. ANSI X3.106,
'American National Standard for Information Systems - Data "American National Standard for Information Systems - Data
Link Encryption'. 1983. Link Encryption". 1983.
DH-X9.42 Rescorla, E. Diffie-Hellman Key Agreement Method. DH-X9.42 Rescorla, E. Diffie-Hellman Key Agreement Method.
(currently draft-ietf-smime-x942-*.txt) (currently draft-ietf-smime-x942-*.txt)
DSS National Institute of Standards and Technology. DSS National Institute of Standards and Technology.
FIPS Pub 186: Digital Signature Standard. 19 May 1994. FIPS Pub 186: Digital Signature Standard. 19 May 1994.
ESS Hoffman, P. Enhanced Security Services for S/MIME. ESS Hoffman, P. Enhanced Security Services for S/MIME.
(currently draft-ietf-smime-ess-*.txt) (currently draft-ietf-smime-ess-*.txt)
skipping to change at page 56, line 16 skipping to change at page 56, line 35
DES [3DES] content-encryption key with a Triple-DES key-encryption DES [3DES] content-encryption key with a Triple-DES key-encryption
key or to encrypt a RC2 [RC2] content-encryption key with a RC2 key- key or to encrypt a RC2 [RC2] content-encryption key with a RC2 key-
encryption key. The key wrap algorithms make use of CBC mode encryption key. The key wrap algorithms make use of CBC mode
[MODES]. These key wrap algorithms have been reviewed for use with [MODES]. These key wrap algorithms have been reviewed for use with
Triple and RC2. They have not been reviewed for use with other Triple and RC2. They have not been reviewed for use with other
cryptographic modes or other encryption algorithms. Therefore, if a cryptographic modes or other encryption algorithms. Therefore, if a
CMS implementation wishes to support ciphers in addition to Triple- CMS implementation wishes to support ciphers in addition to Triple-
DES or RC2, then additional key wrap algorithms need to be defined to DES or RC2, then additional key wrap algorithms need to be defined to
support the additional ciphers. support the additional ciphers.
Implementers should be aware that cryptographic algorithms become
weaker with time. As new cryptoanalysis techniques are developed and
computing performance improves, the work factor to break a particular
cryptographic algorithm will reduce. Therefore, cryptographic
algorithm implementations should be modular allowing new algorithms
to be readily inserted. That is, implementers should be prepared for
the set of mandatory to implement algorithms to change over time.
The countersignature unauthenticated attribute includes a digital The countersignature unauthenticated attribute includes a digital
signature that is computed on the content signature value, thus the signature that is computed on the content signature value, thus the
countersigning process need not know the original signed content. countersigning process need not know the original signed content.
This structure permits implementation efficiency advantages; however, This structure permits implementation efficiency advantages; however,
this structure may also permit the countersigning of an inappropriate this structure may also permit the countersigning of an inappropriate
signature value. Therefore, implementations that perform signature value. Therefore, implementations that perform
countersignatures should either validate the original signature value countersignatures should either verify the original signature value
prior to countersigning it (this validation requires processing of prior to countersigning it (this verification requires processing of
the original content), or implementations should perform the original content), or implementations should perform
countersigning in a context that ensures that only appropriate countersigning in a context that ensures that only appropriate
signature values are countersigned. signature values are countersigned.
Users of CMS, particularly those employing CMS to support interactive Users of CMS, particularly those employing CMS to support interactive
applications, should be aware that PKCS #1 Version 1.5 as specified applications, should be aware that PKCS #1 Version 1.5 as specified
in RFC 2313 [PKCS#1] is vulnerable to adaptive chosen ciphertext in RFC 2313 [PKCS#1] is vulnerable to adaptive chosen ciphertext
attacks when applied for encryption purposes. Exploitation of this attacks when applied for encryption purposes. Exploitation of this
identified vulnerability, revealing the result of a particular RSA identified vulnerability, revealing the result of a particular RSA
decryption, requires access to an oracle which will respond to a decryption, requires access to an oracle which will respond to a
skipping to change at page 58, line 4 skipping to change at page 58, line 38
itself may not be modified in any way, such as by removing the itself may not be modified in any way, such as by removing the
copyright notice or references to the Internet Society or other copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process shall be copyrights defined in the Internet Standards process shall be
followed, or as required to translate it into languages other than followed, or as required to translate it into languages other than
English. English.
The limited permissions granted above are perpetual and will not be The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns. This revoked by the Internet Society or its successors or assigns. This
document and the information contained herein is provided on an 'AS document and the information contained herein is provided on an "AS
IS' basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK
FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL
NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY
OR FITNESS FOR A PARTICULAR PURPOSE. OR FITNESS FOR A PARTICULAR PURPOSE.
 End of changes. 

This html diff was produced by rfcdiff 1.23, available from http://www.levkowetz.com/ietf/tools/rfcdiff/