draft-ietf-smime-cms-10.txt   draft-ietf-smime-cms-11.txt 
S/MIME Working Group R. Housley S/MIME Working Group R. Housley
Internet Draft SPYRUS Internet Draft SPYRUS
expires in six months December 1998 expires in six months February 1999
Cryptographic Message Syntax Cryptographic Message Syntax
<draft-ietf-smime-cms-10.txt> <draft-ietf-smime-cms-11.txt>
Status of this Memo Status of this Memo
This document is an Internet-Draft. Internet-Drafts are working This document is an Internet-Draft and is in full conformance with
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.
skipping to change at page 2, line 22 skipping to change at page 2, line 22
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 Validation Process ........................ 12
6 Enveloped-data Content Type ...................................... 12 6 Enveloped-data Content Type ...................................... 12
6.1 EnvelopedData Type .......................................... 13 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 ....................................... 20 7 Digested-data Content Type ....................................... 21
8 Encrypted-data Content Type ...................................... 22 8 Encrypted-data Content Type ...................................... 22
9 Authenticated-data Content Type .................................. 22 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 Validation .............................................. 26
10 Useful Types ..................................................... 26 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
10.2.3 CertificateSet ..................................... 29 10.2.3 CertificateSet ..................................... 29
10.2.4 IssuerAndSerialNumber .............................. 29 10.2.4 IssuerAndSerialNumber .............................. 29
10.2.5 CMSVersion ......................................... 30 10.2.5 CMSVersion ......................................... 30
10.2.6 UserKeyingMaterial ................................. 30 10.2.6 UserKeyingMaterial ................................. 30
10.2.7 OtherKeyAttribute .................................. 30 10.2.7 OtherKeyAttribute .................................. 30
11 Useful Attributes ................................................ 30 11 Useful Attributes ................................................ 30
11.1 Content Type ............................................... 30 11.1 Content Type ............................................... 31
11.2 Message Digest ............................................. 31 11.2 Message Digest ............................................. 31
11.3 Signing Time ............................................... 32 11.3 Signing Time ............................................... 32
11.4 Countersignature ........................................... 33 11.4 Countersignature ........................................... 33
12 Supported Algorithms ............................................. 34 12 Supported Algorithms ............................................. 34
12.1 Digest Algorithms .......................................... 34 12.1 Digest Algorithms .......................................... 34
12.1.1 SHA-1 .............................................. 35 12.1.1 SHA-1 .............................................. 35
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
skipping to change at page 3, line 29 skipping to change at page 3, line 29
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 ...................... 39
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 ............................... 40
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 ...................... 41
12.5.1 HMAC with SHA-1 ..................................... 42 12.5.1 HMAC with SHA-1 ..................................... 42
12.6 Triple-DES and RC2 Key Wrap Algorithm ....................... 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 Key Wrap ............................................ 43 12.6.2 Triple-DES Key Wrap ................................. 43
12.6.3 Key Unwrap .......................................... 43 12.6.3 Triple-DES Key Unwrap ............................... 44
Appendix A: ASN.1 Module ............................................ 44 12.6.4 RC2 Key Wrap ........................................ 44
References ........................................................... 50 12.6.5 RC2 Key Unwrap ...................................... 45
Security Considerations .............................................. 51 Appendix A: ASN.1 Module ............................................ 46
Acknowledgments ...................................................... 53 References ........................................................... 53
Author Address ....................................................... 54 Security Considerations .............................................. 55
Full Copyright Statement ............................................. 54 Acknowledgments ...................................................... 57
Author Address ....................................................... 57
Full Copyright Statement ............................................. 57
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 or encrypt arbitrary messages. syntax is used to digitally sign, digest, authenticate, or encrypt
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
envelope can be nested inside another. Likewise, one party can envelope can be nested inside another. Likewise, one party can
digitally sign some previously encapsulated data. It also allows digitally sign some previously encapsulated data. It also allows
arbitrary attributes, such as signing time, to be signed along with arbitrary attributes, such as signing time, to be signed along with
the message content, and provides for other attributes such as the message content, and provides for other attributes such as
countersignatures to be associated with a signature. countersignatures to be associated with a signature.
skipping to change at page 4, line 50 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 validate a content that
contains an unrecognized attribute. contains an unrecognized attribute. Signed attributes and
authenticated attributes are the only CMS data types that require DER
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 {
contentType ContentType, contentType ContentType,
content [0] EXPLICIT ANY DEFINED BY contentType } content [0] EXPLICIT ANY DEFINED BY contentType }
skipping to change at page 6, line 25 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 validate the signature
value. The signer's public key is referenced by an issuer value. The signer's public key is referenced either by an issuer
distinguished name and an issuer-specific serial number that uniquely distinguished name along with an issuer-specific serial number or by
identify the certificate containing the public key. The signer's a subject key identifier that uniquely identifies the certificate
certificate may be included in the SignedData certificates field. containing the public key. The signer's certificate may be included
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 validation processes, respectively.
5.1 SignedData Type 5.1 SignedData Type
skipping to change at page 7, line 30 skipping to change at page 7, line 33
crls [1] IMPLICIT CertificateRevocationLists OPTIONAL, crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,
signerInfos SignerInfos } signerInfos SignerInfos }
DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier
SignerInfos ::= SET OF SignerInfo SignerInfos ::= SET OF SignerInfo
The fields of type SignedData have the following meanings: The fields of type SignedData have the following meanings:
version is the syntax version number. If no attribute version is the syntax version number. If no attribute
certificates are present in the certificates field and the certificates are present in the certificates field, the
encapsulated content type is id-data, then the value of version encapsulated content type is id-data, and all of the elements of
shall be 1; however, if attribute certificates are present or the SignerInfos are version 1, then the value of version shall be 1.
encapsulated content type is other than id-data, then the value of Alternatively, if attribute certificates are present, the
version shall be 3. encapsulated content type is other than id-data, or any of the
elements of SignerInfos are version 3, then the value of version
shall be 3.
digestAlgorithms is a collection of message digest algorithm digestAlgorithms is a collection of message digest algorithm
identifiers. There may be any number of elements in the identifiers. There may be any number of elements in the
collection, including zero. Each element identifies the message collection, including zero. Each element identifies the message
digest algorithm, along with any associated parameters, used by digest algorithm, along with any associated parameters, used by
one or more signer. The collection is intended to list the one or more signer. The collection is intended to list the
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 24 skipping to change at page 8, line 30
is intended that the set contain information sufficient to is intended that the set contain information sufficient to
determine whether or not the certificates in the certificates determine whether or not the certificates in the certificates
field are valid, but such correspondence is not necessary. There field are valid, but such correspondence is not necessary. There
may be more CRLs than necessary, and there may also be fewer CRLs may be more CRLs than necessary, and there may also be fewer CRLs
than necessary. than necessary.
signerInfos is a collection of per-signer information. There may signerInfos is a collection of per-signer information. There may
be any number of elements in the collection, including zero. The be any number of elements in the collection, including zero. The
details of the SignerInfo type are discussed in section 5.3. details of the SignerInfo type are discussed in section 5.3.
The optional omission of the eContent within the
EncapsulatedContentInfo field makes it possible to construct
"external signatures." In the case of external signatures, the
content being signed is absent from the EncapsulatedContentInfo value
included in the signed-data content type. If the eContent value
within EncapsulatedContentInfo is absent, then the signatureValue is
calculated and the eContentType is assigned as though the eContent
value was present.
In the degenerate case where there are no signers, the
EncapsulatedContentInfo value being "signed" is irrelevant. In this
case, the content type within the EncapsulatedContentInfo value being
"signed" should be id-data (as defined in section 4), and the content
field of the EncapsulatedContentInfo value should be omitted.
5.2 EncapsulatedContentInfo Type 5.2 EncapsulatedContentInfo Type
The content is represented in the type EncapsulatedContentInfo: The content is represented in the type EncapsulatedContentInfo:
EncapsulatedContentInfo ::= SEQUENCE { EncapsulatedContentInfo ::= SEQUENCE {
eContentType ContentType, eContentType ContentType,
eContent [0] EXPLICIT OCTET STRING OPTIONAL } eContent [0] EXPLICIT OCTET STRING OPTIONAL }
ContentType ::= OBJECT IDENTIFIER ContentType ::= OBJECT IDENTIFIER
The fields of type EncapsulatedContentInfo have the following The fields of type EncapsulatedContentInfo have the following
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
EncapsulatedContentInfo field makes it possible to construct
'external signatures.' In the case of external signatures, the
content being signed is absent from the EncapsulatedContentInfo value
included in the signed-data content type. If the eContent value
within EncapsulatedContentInfo is absent, then the signatureValue is
calculated and the eContentType is assigned as though the eContent
value was present.
In the degenerate case where there are no signers, the
EncapsulatedContentInfo value being 'signed' is irrelevant. In this
case, the content type within the EncapsulatedContentInfo value being
'signed' should be id-data (as defined in section 4), and the content
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,
signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL, signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL,
signatureAlgorithm SignatureAlgorithmIdentifier, signatureAlgorithm SignatureAlgorithmIdentifier,
skipping to change at page 11, line 14 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 36 skipping to change at page 12, line 43
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 14, line 47 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 17, line 10 skipping to change at page 17, line 17
encryption key for the recipient. The key-encryption process is encryption key for the recipient. The key-encryption process is
described in Section 6.4. described in Section 6.4.
encryptedKey is the result of encrypting the content-encryption encryptedKey is the result of encrypting the content-encryption
key for the recipient. key for the recipient.
6.2.2 KeyAgreeRecipientInfo Type 6.2.2 KeyAgreeRecipientInfo Type
Recipient information using key agreement is represented in the type Recipient information using key agreement is represented in the type
KeyAgreeRecipientInfo. Each instance of KeyAgreeRecipientInfo will KeyAgreeRecipientInfo. Each instance of KeyAgreeRecipientInfo will
transfer the content-encryption key to one or more recipient. transfer the content-encryption key to one or more recipient that
uses the same key agreement algorithm and domain parameters for that
algorithm.
KeyAgreeRecipientInfo ::= SEQUENCE { KeyAgreeRecipientInfo ::= SEQUENCE {
version CMSVersion, -- always set to 3 version CMSVersion, -- always set to 3
originator [0] EXPLICIT OriginatorIdentifierOrKey, originator [0] EXPLICIT OriginatorIdentifierOrKey,
ukm [1] EXPLICIT UserKeyingMaterial OPTIONAL, ukm [1] EXPLICIT UserKeyingMaterial OPTIONAL,
keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
recipientEncryptedKeys RecipientEncryptedKeys } recipientEncryptedKeys RecipientEncryptedKeys }
OriginatorIdentifierOrKey ::= CHOICE { OriginatorIdentifierOrKey ::= CHOICE {
issuerAndSerialNumber IssuerAndSerialNumber, issuerAndSerialNumber IssuerAndSerialNumber,
skipping to change at page 20, line 16 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-(l mod k) octets all having value k-(l mod k), where l is the k-(lth mod k) octets all having value k-(lth mod k), where lth is
length of the input. In other words, the input is padded at the the length of the input. In other words, the input is padded at
trailing end with one of the following strings: the trailing end with one of the following strings:
01 -- if l mod k = k-1 01 -- if lth mod k = k-1
02 02 -- if l mod k = k-2 02 02 -- if lth mod k = k-2
. .
. .
. .
k k ... k k -- if l 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 26 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
AuthenticatedData: AuthenticatedData:
AuthenticatedData ::= SEQUENCE { AuthenticatedData ::= SEQUENCE {
version CMSVersion, version CMSVersion,
originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
recipientInfos RecipientInfos, recipientInfos RecipientInfos,
macAlgorithm MessageAuthenticationCodeAlgorithm, macAlgorithm MessageAuthenticationCodeAlgorithm,
digestAlgorithm [1] DigestAlgorithm OPTIONAL, digestAlgorithm [1] DigestAlgorithmIdentifier OPTIONAL,
encapContentInfo EncapsulatedContentInfo, encapContentInfo EncapsulatedContentInfo,
authenctiatedAttributes [2] IMPLICIT AuthAttributes OPTIONAL, authenticatedAttributes [2] IMPLICIT AuthAttributes OPTIONAL,
mac MessageAuthenticationCode, mac MessageAuthenticationCode,
unauthenticatedAttributes [3] IMPLICIT UnauthAttributes OPTIONAL } unauthenticatedAttributes [3] IMPLICIT UnauthAttributes OPTIONAL }
AuthAttributes ::= SET SIZE (1..MAX) OF Attribute AuthAttributes ::= SET SIZE (1..MAX) OF Attribute
UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute
MessageAuthenticationCode ::= OCTET STRING MessageAuthenticationCode ::= OCTET STRING
The fields of type AuthenticatedData have the following meanings: The fields of type AuthenticatedData have the following meanings:
version is the syntax version number. It shall be 0. version is the syntax version number. It shall be 0.
skipping to change at page 24, line 35 skipping to change at page 24, line 49
associated parameters, used by the originator. Placement of the associated parameters, used by the originator. Placement of the
macAlgorithm field facilitates one-pass processing by the macAlgorithm field facilitates one-pass processing by the
recipient. recipient.
digestAlgorithm identifies the message digest algorithm, and any digestAlgorithm identifies the message digest algorithm, and any
associated parameters, used to compute a message digest on the associated parameters, used to compute a message digest on the
encapsulated content if authenticated attributes are present. The encapsulated content if authenticated attributes are present. The
message digesting process is described in Section 9.2. Placement message digesting process is described in Section 9.2. Placement
of the digestAlgorithm field facilitates one-pass processing by of the digestAlgorithm field facilitates one-pass processing by
the recipient. If the digestAlgorithm field is present, then the the recipient. If the digestAlgorithm field is present, then the
authenctiatedAttributes field must also be present. authenticatedAttributes field must also be present.
encapContentInfo is the content that is authenticated, as defined encapContentInfo is the content that is authenticated, as defined
in section 5.2. in section 5.2.
authenctiatedAttributes is a collection of authenticated authenticatedAttributes is a collection of authenticated
attributes. The authenctiatedAttributes structure is optional, attributes. The authenticatedAttributes structure is optional,
but it must be present if the content type of the but it must be present if the content type of the
EncapsulatedContentInfo value being authenticated is not id-data. EncapsulatedContentInfo value being authenticated is not id-data.
If the authenctiatedAttributes field is present, then the If the authenticatedAttributes field is present, then the
digestAlgorithm field must also be present. Each digestAlgorithm field must also be present. Each
AuthenticatedAttribute in the SET must be DER encoded. Useful AuthenticatedAttribute in the SET must be DER encoded. Useful
attribute types are defined in Section 11. If the attribute types are defined in Section 11. If the
authenctiatedAttributes field is present, it must contain, authenticatedAttributes field is present, it must contain, at a
at a minimum, the following two attributes: minimum, the following two attributes:
A content-type attribute having as its value the content type A content-type attribute having as its value the content type
of the EncapsulatedContentInfo value being authenticated. of the EncapsulatedContentInfo value being authenticated.
Section 11.1 defines the content-type attribute. Section 11.1 defines the content-type attribute.
A message-digest attribute, having as its value the message A message-digest attribute, having as its value the message
digest of the content. Section 11.2 defines the message-digest digest of the content. Section 11.2 defines the message-digest
attribute. attribute.
mac is the message authentication code. mac is the message authentication code.
skipping to change at page 25, line 28 skipping to change at page 25, line 39
have been defined for use as unauthenticated attributes, but other have been defined for use as unauthenticated attributes, but other
useful attribute types are defined in Section 11. useful attribute types are defined in Section 11.
9.2 MAC Generation 9.2 MAC Generation
The MAC calculation process computes a message authentication code The MAC calculation process computes a message authentication code
(MAC) on either the message being authenticated or a message digest (MAC) on either the message being authenticated or a message digest
of message being authenticated together with the originator's of message being authenticated together with the originator's
authenticated attributes. authenticated attributes.
If authenctiatedAttributes field is absent, the input to the MAC If authenticatedAttributes field is absent, the input to the MAC
calculation process is the value of the encapContentInfo eContent calculation process is the value of the encapContentInfo eContent
OCTET STRING. Only the octets comprising the value of the eContent OCTET STRING. Only the octets comprising the value of the eContent
OCTET STRING are input to the MAC algorithm; the tag and the length OCTET STRING are input to the MAC algorithm; the tag and the length
octets are omitted. This has the advantage that the length of the octets are omitted. This has the advantage that the length of the
content being authenticated need not be known in advance of the MAC content being authenticated need not be known in advance of the MAC
generation process. generation process.
If authenctiatedAttributes field is present, the content-type If authenticatedAttributes field is present, the content-type
attribute (as described in Section 11.1) and the message-digest attribute (as described in Section 11.1) and the message-digest
attribute (as described in section 11.2) must be included, and the attribute (as described in section 11.2) must be included, and the
input to the MAC calculation process is the DER encoding of input to the MAC calculation process is the DER encoding of
authenticatedAttributes. A separate encoding of the authenticatedAttributes. A separate encoding of the
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 29, line 12 skipping to change at page 29, line 21
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 30, line 14 skipping to change at page 30, line 24
10.2.5 CMSVersion 10.2.5 CMSVersion
The Version type gives a syntax version number, for compatibility The Version type gives a syntax version number, for compatibility
with future revisions of this document. with future revisions of this document.
CMSVersion ::= INTEGER { v0(0), v1(1), v2(2), v3(3), v4(4) } CMSVersion ::= INTEGER { v0(0), v1(1), v2(2), v3(3), v4(4) }
10.2.6 UserKeyingMaterial 10.2.6 UserKeyingMaterial
The UserKeyingMaterial type gives a syntax user keying material The UserKeyingMaterial type gives a syntax for user keying material
(UKM). Some key agreement algorithms require UKMs to ensure that a (UKM). Some key agreement algorithms require UKMs to ensure that a
different key is generated each time the same two parties generate a different key is generated each time the same two parties generate a
pairwise key. The sender provides a UKM for use with a specific key pairwise key. The sender provides a UKM for use with a specific key
agreement algorithm. agreement algorithm.
UserKeyingMaterial ::= OCTET STRING UserKeyingMaterial ::= OCTET STRING
10.2.7 OtherKeyAttribute 10.2.7 OtherKeyAttribute
The OtherKeyAttribute type gives a syntax for the inclusion of other The OtherKeyAttribute type gives a syntax for the inclusion of other
skipping to change at page 30, line 36 skipping to change at page 30, line 46
the sender. The attribute object identifier must be registered along the sender. The attribute object identifier must be registered along
with the syntax of the attribute itself. Use of this structure with the syntax of the attribute itself. Use of this structure
should be avoided since it may impede interoperability. should be avoided since it may impede interoperability.
OtherKeyAttribute ::= SEQUENCE { OtherKeyAttribute ::= SEQUENCE {
keyAttrId OBJECT IDENTIFIER, keyAttrId OBJECT IDENTIFIER,
keyAttr ANY DEFINED BY keyAttrId OPTIONAL } keyAttr ANY DEFINED BY keyAttrId OPTIONAL }
11 Useful Attributes 11 Useful Attributes
This section defines attributes that may used with signed-data or This section defines attributes that may used with signed-data,
authenticated-data. Some of the attributes defined in this section enveloped-data, encrypted-data, or authenticated-data. Some of the
were originally defined in PKCS #9 [PKCS#9], others were not attributes defined in this section were originally defined in PKCS #9
previously defined. The attributes are not listed in any particular [PKCS#9], others were not previously defined. The attributes are not
order. listed in any particular order.
Additional attributes are defined in many places, notably the S/MIME Additional attributes are defined in many places, notably the S/MIME
Version 3 Message Specification [MSG] and the Enhanced Security Version 3 Message Specification [MSG] and the Enhanced Security
Services for S/MIME [ESS], which also include recommendations on the Services for S/MIME [ESS], which also include recommendations on the
placement of these attributes. placement of these attributes.
11.1 Content Type 11.1 Content Type
The content-type attribute type specifies the content type of the The content-type attribute type specifies the content type of the
ContentInfo value being signed in signed-data. The content-type ContentInfo value being signed in signed-data. The content-type
skipping to change at page 32, line 39 skipping to change at page 33, line 4
id-signingTime OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-signingTime OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs9(9) 5 } us(840) rsadsi(113549) pkcs(1) pkcs9(9) 5 }
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 through the year 2049 must be encoded as UTCTime, and dates in
the year 2050 or later must be encoded as GeneralizedTime. the year 2050 or later 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 36, line 18 skipping to change at page 36, line 18
always used with the SHA-1 message digest algorithm. The algorithm always used with the SHA-1 message digest algorithm. The algorithm
identifier for DSA is: identifier for DSA is:
id-dsa-with-sha1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-dsa-with-sha1 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) x9-57 (10040) x9cm(4) 3 } us(840) x9-57 (10040) x9cm(4) 3 }
The AlgorithmIdentifier parameters field must not be present. The AlgorithmIdentifier parameters field must not be present.
12.2.2 RSA 12.2.2 RSA
The RSA signature algorithm is defined in RFC 2313 [PKCS#1]. RFC The RSA signature algorithm is defined in RFC 2347 [NEWPKCS#1]. RFC
2313 specifies the use of the RSA signature algorithm with the MD5 2347 specifies the use of the RSA signature algorithm with the SHA-1
message digest algorithm. That definition is extended here to and MD5 message digest algorithms. The algorithm identifier for RSA
include support for the SHA-1 message digest algorithm as well. The is:
algorithm identifier 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 }
The AlgorithmIdentifier parameters field must be present, and the
parameters field must contain NULL.
This specification modifies RFC 2313 [PKCS#1] to include SHA-1 as an
additional message digest algorithm. Section 10.1.2 of RFC 2313 is
modified to list SHA-1 in the bullet item about digestAlgorithm. The
following object identifier is added to the list in section 10.1.2 of
RFC 2313:
sha-1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
oiw(14) secsig(3) algorithm(2) 26 }
12.3 Key Management Algorithms 12.3 Key Management Algorithms
CMS accommodates three general key management techniques: key CMS accommodates three general key management techniques: key
agreement, key transport, and previously distributed symmetric key- agreement, key transport, and previously distributed symmetric key-
encryption keys. encryption keys.
12.3.1 Key Agreement Algorithms 12.3.1 Key Agreement Algorithms
CMS implementations must include key agreement using X9.42 Ephemeral- CMS implementations must include key agreement using X9.42 Ephemeral-
Static Diffie-Hellman. Static Diffie-Hellman.
skipping to change at page 38, line 47 skipping to change at page 38, line 38
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 field.
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 field.
12.3.2.1 RSA 12.3.2.1 RSA
The RSA key transport algorithm is defined in RFC 2313 [PKCS#1]. RFC The RSA key transport algorithm is the RSA encryption scheme defined
2313 specifies the transport of content-encryption keys, including in RFC 2313 [PKCS#1], block type is 02, where the message to be
Triple-DES and RC2 keys. The algorithm identifier for RSA is: encrypted is the content-encryption key. The algorithm identifier
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 }
The AlgorithmIdentifier parameters field must be present, and the The AlgorithmIdentifier parameters field must be present, and the
parameters field must contain NULL. parameters field must contain NULL.
When using a Triple-DES content-encryption key, adjust the parity
bits for each DES key comprising the Triple-DES key prior to RSA
encryption.
The use of RSA encryption, as defined in RFC 2313 [PKCS#1], to The use of RSA encryption, as defined in RFC 2313 [PKCS#1], to
provide confidentiality has a known vulnerability concerns. The provide confidentiality has a known vulnerability concerns. The
vulnerability is primarily relevant to usage in interactive vulnerability is primarily relevant to usage in interactive
applications rather than to store-and-forward environments. Further applications rather than to store-and-forward environments. Further
information and proposed countermeasures are discussed in the information and proposed countermeasures are discussed in the
Security Considerations section of this document. Security Considerations section of this document.
Note that the same encryption scheme is also defined in RFC 2437
[NEWPKCS#1]. Within RFC 2437, this scheme is called RSAES-
PKCS1-v1_5.
12.3.3 Symmetric Key-Encryption Key Algorithms 12.3.3 Symmetric Key-Encryption Key Algorithms
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.
skipping to change at page 39, line 47 skipping to change at page 39, line 49
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 field, and
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 field.
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-3DESwrap 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) 3 } 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.
The key wrap algorithm used to encrypt a Triple-DES content- The key wrap algorithm used to encrypt a Triple-DES content-
encryption key with a Triple-DES key-encryption key is specified in encryption key with a Triple-DES key-encryption key is specified in
section 12.6. section 12.6.
Out-of-band distribution of the Triple-DES key-encryption key used to Out-of-band distribution of the Triple-DES key-encryption key used to
encrypt the Triple-DES content-encryption key is beyond of the scope encrypt the Triple-DES content-encryption key is beyond of the scope
of this document. of this document.
12.3.3.2 RC2 Key Wrap 12.3.3.2 RC2 Key Wrap
RC2 key encryption has the algorithm identifier: RC2 key encryption has the algorithm identifier:
id-alg-RC2wrap OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-alg-CMSRC2wrap OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) alg(3) 4 } us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) alg(3) 7 }
The AlgorithmIdentifier parameter field must be RC2wrapParameter: The AlgorithmIdentifier parameter field must be RC2wrapParameter:
RC2wrapParameter ::= RC2ParameterVersion RC2wrapParameter ::= RC2ParameterVersion
RC2ParameterVersion ::= INTEGER RC2ParameterVersion ::= INTEGER
The RC2 effective-key-bits (key size) greater than 32 and less than The RC2 effective-key-bits (key size) greater than 32 and less than
256 is encoded in the RC2ParameterVersion. For the effective-key- 256 is encoded in the RC2ParameterVersion. For the effective-key-
bits of 40, 64, and 128, the rc2ParameterVersion values are 160, 120, bits of 40, 64, and 128, the rc2ParameterVersion values are 160, 120,
skipping to change at page 42, line 15 skipping to change at page 42, line 15
12.5.1 HMAC with SHA-1 12.5.1 HMAC with SHA-1
The HMAC with SHA-1 algorithm is described in RFC 2104 [HMAC]. The The HMAC with SHA-1 algorithm is described in RFC 2104 [HMAC]. The
algorithm identifier for HMAC with SHA-1 is: algorithm identifier for HMAC with SHA-1 is:
HMAC-SHA1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) HMAC-SHA1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
dod(6) internet(1) security(5) mechanisms(5) 8 1 2 } dod(6) internet(1) security(5) mechanisms(5) 8 1 2 }
The AlgorithmIdentifier parameters field must be absent. The AlgorithmIdentifier parameters field must be absent.
12.6 Triple-DES and RC2 Key Wrap Algorithm 12.6 Triple-DES and RC2 Key Wrap Algorithms
CMS implementations must include encryption of a Triple-DES content- CMS implementations must include encryption of a Triple-DES content-
encryption key with a Triple-DES key-encryption key using the encryption key with a Triple-DES key-encryption key using the
algorithm specified in this section. CMS implementations should algorithm specified in Sections 12.6.2 and 12.6.3. CMS
include encryption of a RC2 content-encryption key with a RC2 key- implementations should include encryption of a RC2 content-encryption
encryption key. Triple-DES and RC2 content-encryption keys are key with a RC2 key-encryption key using the algorithm specified in
encrypted in Cipher Block Chaining (CBC) mode [MODES]. Sections 12.6.4 and 12.6.5. Triple-DES and RC2 content-encryption
keys are encrypted in Cipher Block Chaining (CBC) mode [MODES].
Key Transport algorithms allow for the content-encryption key to be Key Transport algorithms allow for the content-encryption key to be
directly encrypted; however, key agreement and symmetric key- directly encrypted; however, key agreement and symmetric key-
encryption key algorithms encrypt the content-encryption key with a encryption key algorithms encrypt the content-encryption key with a
second symmetric encryption algorithm. This section describes how second symmetric encryption algorithm. This section describes how
the Triple-DES or RC2 content-encryption key is formatted and the Triple-DES or RC2 content-encryption key is formatted and
encrypted. encrypted.
Key agreement algorithms generate a pairwise key-encryption key, and Key agreement algorithms generate a pairwise key-encryption key, and
a key wrap algorithm is used to encrypt the content-encryption key a key wrap algorithm is used to encrypt the content-encryption key
with the pairwise key-encryption key. Similarly, a key wrap with the pairwise key-encryption key. Similarly, a key wrap
algorithm is used to encrypt the content-encryption key in a algorithm is used to encrypt the content-encryption key in a
previously distributed key-encryption key. previously distributed key-encryption key.
The key-encryption key is generated by the key agreement algorithm or The key-encryption key is generated by the key agreement algorithm or
distributed out of band. For key agreement of RC2 key-encryption distributed out of band. For key agreement of RC2 key-encryption
keys, 128 bits must be generated as input to the key expansion keys, 128 bits must be generated as input to the key expansion
process used to compute the RC2 effective key [RC2]. process used to compute the RC2 effective key [RC2].
The block size of the key-encryption algorithm must be implicitly
determined from the KeyEncryptionAlgorithmIdentifier field; however,
both Triple-DES and RC2 have a block size of eight octets.
The same algorithm identifier is used for both 2-key and 3-key The same algorithm identifier is used for both 2-key and 3-key
Triple-DES. When the length of the wrapped content-encryption key is Triple-DES. When the length of the content-encryption key to be
16 octets, 2-key Triple-DES is used for the content-encryption wrapped is a 2-key Triple-DES key, a third key with the same value as
algorithm. Similarly, when the length of the wrapped content- the first key is created. Thus, all Triple-DES content-encryption
encryption key is 24 octets, 3-key Triple-DES is used for the keys are wrapped like 3-key Triple-DES keys.
content-encryption algorithm.
12.6.1 Key Checksum 12.6.1 Key Checksum
The CMS Checksum Algorithm is used to provide an content-encryption The CMS Checksum Algorithm is used to provide a content-encryption
key integrity check value. The algorithm is: key integrity check value. The algorithm is:
1. Compute a 20 octet SHA-1 [SHA1] message digest on the 1. Compute a 20 octet SHA-1 [SHA1] message digest on the
content-encryption key. content-encryption key.
2. Use the most significant (first) eight octets of the message 2. Use the most significant (first) eight octets of the message
digest value as the checksum value. digest value as the checksum value.
12.6.2 Key Wrap 12.6.2 Triple-DES Key Wrap
1. Modify the content-encryption key to meet any restrictions on the key. The Triple-DES key wrap algorithm encrypts a Triple-DES content-
For example, adjust the parity bits for each DES key comprising a encryption key with a Triple-DES key-encryption key. The Triple-DES
Triple-DES key. key wrap algorithm is:
2. Compute a 8 octet key checksum value on the content-encryption key as
described Section 12.6.1 above.
3. Generate a 4 octet random salt value.
4. Concatenate the salt, content-encryption key, and key checksum value.
5. Pad the result, using the technique specified in Section 6.3, so
that the padded result is a multiple of eight octets (the Triple-DES
and RC2 block size). Append the pad to the result.
6. Encrypt in CBC mode the padded result using the key-encryption key.
Use an IV with each octet equal to 'A5' hexadecimal.
12.6.3 Key Unwrap 1. Set odd parity for each of the DES key octets comprising
the content-encryption key, call the result CEK.
2. Compute an 8 octet key checksum value on CEK as described above
in Section 12.6.1, call the result ICV.
3. Let CEKICV = CEK || ICV.
4. Generate 8 octets at random, call the result IV.
5. Encrypt CEKICV in CBC mode using the key-encryption key. Use
the random value generated in the previous step as the
initialization vector (IV). Call the ciphertext TEMP1.
6. Let TEMP2 = IV || TEMP1.
7. Reverse the order of the octets in TEMP2. That is, the most
significant (first) octet is swapped with the least significant
(last) octet, and so on. Call the result TEMP3.
8. Encrypt TEMP3 in CBC mode using the key-encryption key. Use
an initialization vector (IV) of 0x4adda22c79e82105.
The ciphertext is 40 octets long.
The key unwrap algorithm is: Note: When the same content-encryption key is wrapped in different
key-encryption keys, a fresh initialization vector (IV) must be
generated for each invocation of the key wrap algorithm.
1. Decrypt in CBC mode the ciphertext using the key-encryption key. Use 12.6.3 Triple-DES Key Unwrap
an IV with each octet equal to 'A5' hexadecimal.
2. Decompose the result into the content-encryption key and key checksum The Triple-DES key unwrap algorithm decrypts a Triple-DES content-
values. The salt and pad values are discarded. encryption key using a Triple-DES key-encryption key. The Triple-DES
3. Compute a 8 octet key checksum value on the content-encryption key key unwrap algorithm is:
as described in Section 12.6.1 above.
4. If the computed key checksum value does not match the decrypted key 1. If the wrapped content-encryption key is not 40 octets, then
checksum value, then there is an error. error.
5. If there are restrictions on keys, then check if the content- 2. Decrypt the wrapped content-encryption key in CBC mode using
encryption key meets these restrictions. For example, check for odd the key-encryption key. Use an initialization vector (IV)
parity of each octet in each DES key that makes up a Triple-DES key. of 0x4adda22c79e82105. Call the output TEMP3.
If any restriction is incorrect, then there is an error. 3. Reverse the order of the octets in TEMP3. That is, the most
significant (first) octet is swapped with the least significant
(last) octet, and so on. Call the result TEMP2.
4. Decompose the TEMP2 into IV and TEMP1. IV is the most
significant (first) 8 octets, and TEMP1 is the least significant
(last) 32 octets.
5. Decrypt TEMP1 in CBC mode using the key-encryption key. Use
the IV value from the previous step as the initialization vector.
Call the ciphertext CEKICV.
6. Decompose the CEKICV into CEK and ICV. CEK is the most significant
(first) 24 octets, and ICV is the least significant (last) 8 octets.
7. Compute an 8 octet key checksum value on CEK as described above
in Section 12.6.1. If the computed key checksum value does not
match the decrypted key checksum value, ICV, then error.
8. Check for odd parity each of the DES key octets comprising CEK.
If parity is incorrect, then there is an error.
9. Use CEK as the content-encryption key.
12.6.4 RC2 Key Wrap
The RC2 key wrap algorithm encrypts a RC2 content-encryption key with
a RC2 key-encryption key. The RC2 key wrap algorithm is:
1. Let the content-encryption key be called CEK, and let the length
of the content-encryption key in octets be called LENGTH.
2. Compute an 8 octet key checksum value on CEK as described above
in Section 12.6.1, call the result ICV.
3. Let CEKICV = LENGTH || CEK || ICV. LENGTH is a single octet.
4. Let CEKICVPAD = CEKICV || PAD. If the length of CEKICV is a
multiple of 8, the PAD has a length of zero. If the length of
CEKICV is not a multiple of 8, then PAD contains the fewest
number of random octets to make CEKICVPAD a multiple of 8.
5. Generate 8 octets at random, call the result IV.
5. Encrypt CEKICVPAD in CBC mode using the key-encryption key.
Use the random value generated in the previous step as the
initialization vector (IV). Call the ciphertext TEMP1.
6. Let TEMP2 = IV || TEMP1.
7. Reverse the order of the octets in TEMP2. That is, the most
significant (first) octet is swapped with the least significant
(last) octet, and so on. Call the result TEMP3.
8. Encrypt TEMP3 in CBC mode using the key-encryption key. Use
an initialization vector (IV) of 0x4adda22c79e82105.
Note: When the same content-encryption key is wrapped in different
key-encryption keys, a fresh initialization vector (IV) must be
generated for each invocation of the key wrap algorithm.
12.6.5 RC2 Key Unwrap
The RC2 key unwrap algorithm decrypts a RC2 content-encryption key
using a RC2 key-encryption key. The RC2 key unwrap algorithm is:
1. If the wrapped content-encryption key is not a multiple of 8
octets, then error.
2. Decrypt the wrapped content-encryption key in CBC mode using
the key-encryption key. Use an initialization vector (IV)
of 0x4adda22c79e82105. Call the output TEMP3.
3. Reverse the order of the octets in TEMP3. That is, the most
significant (first) octet is swapped with the least significant
(last) octet, and so on. Call the result TEMP2.
4. Decompose the TEMP2 into IV and TEMP1. IV is the most
significant (first) 8 octets, and TEMP1 is the remaining octets.
5. Decrypt TEMP1 in CBC mode using the key-encryption key. Use
the IV value from the previous step as the initialization vector.
Call the ciphertext CEKICVPAD.
6. Decompose the CEKICVPAD into LENGTH, CEK, ICV, and PAD. LENGTH is
the most significant (first) octet. CEK is the following LENGTH
octets. ICV is the following 8 octets. PAD is the remaining
octets, if any.
7. If PAD is more than 7 octets, then error.
8. Compute an 8 octet key checksum value on CEK as described above
in Section 12.6.1. If the computed key checksum value does not
match the decrypted key checksum value, ICV, then error.
9. 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 47, line 39 skipping to change at page 49, line 39
EncryptedData ::= SEQUENCE { EncryptedData ::= SEQUENCE {
version CMSVersion, version CMSVersion,
encryptedContentInfo EncryptedContentInfo } encryptedContentInfo EncryptedContentInfo }
AuthenticatedData ::= SEQUENCE { AuthenticatedData ::= SEQUENCE {
version CMSVersion, version CMSVersion,
originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
recipientInfos RecipientInfos, recipientInfos RecipientInfos,
macAlgorithm MessageAuthenticationCodeAlgorithm, macAlgorithm MessageAuthenticationCodeAlgorithm,
digestAlgorithm [1] DigestAlgorithm OPTIONAL, digestAlgorithm [1] DigestAlgorithmIdentifier OPTIONAL,
encapContentInfo EncapsulatedContentInfo, encapContentInfo EncapsulatedContentInfo,
authenctiatedAttributes [2] IMPLICIT AuthAttributes OPTIONAL, authenticatedAttributes [2] IMPLICIT AuthAttributes OPTIONAL,
mac MessageAuthenticationCode, mac MessageAuthenticationCode,
unauthenticatedAttributes [3] IMPLICIT UnauthAttributes OPTIONAL } unauthenticatedAttributes [3] IMPLICIT UnauthAttributes OPTIONAL }
AuthAttributes ::= SET SIZE (1..MAX) OF Attribute AuthAttributes ::= SET SIZE (1..MAX) OF Attribute
UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute UnauthAttributes ::= SET SIZE (1..MAX) OF Attribute
MessageAuthenticationCode ::= OCTET STRING MessageAuthenticationCode ::= OCTET STRING
DigestAlgorithmIdentifier ::= AlgorithmIdentifier DigestAlgorithmIdentifier ::= AlgorithmIdentifier
skipping to change at page 48, line 46 skipping to change at page 51, line 4
MessageDigest ::= OCTET STRING MessageDigest ::= OCTET STRING
SigningTime ::= Time SigningTime ::= Time
Time ::= CHOICE { Time ::= CHOICE {
utcTime UTCTime, utcTime UTCTime,
generalTime GeneralizedTime } generalTime GeneralizedTime }
Countersignature ::= SignerInfo Countersignature ::= SignerInfo
-- Algorithm Identifiers
MACValue ::= OCTET STRING sha-1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
-- Object Identifiers oiw(14) secsig(3) algorithm(2) 26 }
md5 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840)
rsadsi(113549) digestAlgorithm(2) 5 }
id-dsa-with-sha1 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) x9-57 (10040) x9cm(4) 3 }
rsaEncryption OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1 }
sha-1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
oiw(14) secsig(3) algorithm(2) 26 }
dh-public-number OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) ansi-x942(10046) number-type(2) 1 }
id-alg-ESDH OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840)
rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) alg(3) 5 }
rsaEncryption OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1 }
id-alg-CMS3DESwrap OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) alg(3) 6 }
id-alg-CMSRC2wrap OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) alg(3) 7 }
des-ede3-cbc OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) encryptionAlgorithm(3) 7 }
rc2-cbc OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840)
rsadsi(113549) encryptionAlgorithm(3) 2 }
HMAC-SHA1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
dod(6) internet(1) security(5) mechanisms(5) 8 1 2 }
-- Algorithm Parameters
KeyWrapAlgorithm ::= AlgorithmIdentifier
RC2wrapParameter ::= RC2ParameterVersion
RC2ParameterVersion ::= INTEGER
CBCParameter ::= IV
IV ::= OCTET STRING -- exactly 8 octets
RC2CBCParameter ::= SEQUENCE {
rc2ParameterVersion INTEGER,
iv OCTET STRING } -- exactly 8 octets
-- Content Type Object Identifiers
id-data OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-data OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs7(7) 1 } us(840) rsadsi(113549) pkcs(1) pkcs7(7) 1 }
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 }
id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-envelopedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 } us(840) rsadsi(113549) pkcs(1) pkcs7(7) 3 }
id-digestedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-digestedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs7(7) 5 } us(840) rsadsi(113549) pkcs(1) pkcs7(7) 5 }
id-encryptedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-encryptedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs7(7) 6 } us(840) rsadsi(113549) pkcs(1) pkcs7(7) 6 }
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 }
-- Attribute Object Identifiers
id-contentType OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-contentType OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs9(9) 3 } us(840) rsadsi(113549) pkcs(1) pkcs9(9) 3 }
id-messageDigest OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-messageDigest OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs9(9) 4 } us(840) rsadsi(113549) pkcs(1) pkcs9(9) 4 }
id-signingTime OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-signingTime OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs9(9) 5 } us(840) rsadsi(113549) pkcs(1) pkcs9(9) 5 }
id-countersignature OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-countersignature OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs9(9) 6 } us(840) rsadsi(113549) pkcs(1) pkcs9(9) 6 }
id-macValue OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs9(9) smime(16) aa(2) 8 }
-- Obsolete Extended Certificate syntax from PKCS#6 -- Obsolete Extended Certificate syntax from PKCS#6
ExtendedCertificateOrCertificate ::= CHOICE { ExtendedCertificateOrCertificate ::= CHOICE {
certificate Certificate, certificate Certificate,
extendedCertificate [0] IMPLICIT ExtendedCertificate } extendedCertificate [0] IMPLICIT ExtendedCertificate }
ExtendedCertificate ::= SEQUENCE { ExtendedCertificate ::= SEQUENCE {
extendedCertificateInfo ExtendedCertificateInfo, extendedCertificateInfo ExtendedCertificateInfo,
signatureAlgorithm SignatureAlgorithmIdentifier, signatureAlgorithm SignatureAlgorithmIdentifier,
signature Signature } signature Signature }
skipping to change at page 50, line 19 skipping to change at page 53, line 30
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)
HMAC Krawczyk, H. HMAC: Keyed-Hashing for Message Authentication. HMAC Krawczyk, H. HMAC: Keyed-Hashing for Message Authentication.
February 1997. RFC 2104. February 1997.
MD5 Rivest, R. The MD5 Message-Digest Algorithm. April 1992. MD5 Rivest, R. The MD5 Message-Digest Algorithm. RFC 1321.
April 1992.
MODES National Institute of Standards and Technology. MODES National Institute of Standards and Technology.
FIPS Pub 81: DES Modes of Operation. 2 December 1980. FIPS Pub 81: DES Modes of Operation. 2 December 1980.
MSG Ramsdell, B. S/MIME Version 3 Message Specification. MSG Ramsdell, B. S/MIME Version 3 Message Specification.
(currently draft-ietf-smime-msg-*.txt) (currently draft-ietf-smime-msg-*.txt)
NEWPKCS#1 Kaliski, B. PKCS #1: RSA Encryption, Version 2.0. NEWPKCS#1 Kaliski, B. PKCS #1: RSA Encryption, Version 2.0.
October 1998. RFC 2347. October 1998.
PROFILE Housley, R., W. Ford, W. Polk, D. Solo. Internet PROFILE Housley, R., W. Ford, W. Polk, D. Solo. Internet
X.509 Public Key Infrastructure: Certificate and CRL X.509 Public Key Infrastructure: Certificate and CRL
Profile. (currently draft-ietf-pkix-ipki-part1-*.txt) Profile. RFC 2459. January 1999.
PKCS#1 Kaliski, B. PKCS #1: RSA Encryption, Version 1.5. PKCS#1 Kaliski, B. PKCS #1: RSA Encryption, Version 1.5.
March 1998. RFC 2313. March 1998.
PKCS#6 RSA Laboratories. PKCS #6: Extended-Certificate Syntax PKCS#6 RSA Laboratories. PKCS #6: Extended-Certificate Syntax
Standard, Version 1.5. November 1993. Standard, Version 1.5. November 1993.
PKCS#7 Kaliski, B. PKCS #7: Cryptographic Message Syntax, PKCS#7 Kaliski, B. PKCS #7: Cryptographic Message Syntax,
Version 1.5. March 1998. Version 1.5. RFC 2315. March 1998.
PKCS#9 RSA Laboratories. PKCS #9: Selected Attribute Types, PKCS#9 RSA Laboratories. PKCS #9: Selected Attribute Types,
Version 1.1. November 1993. Version 1.1. November 1993.
RANDOM Eastlake, D.; S. Crocker; J. Schiller. Randomness RANDOM Eastlake, D.; S. Crocker; J. Schiller. Randomness
Recommendations for Security. December 1994. Recommendations for Security. RFC 1750. December 1994.
RC2 Rivest, R. A Description of the RC2 (r) Encryption Algorithm. RC2 Rivest, R. A Description of the RC2 (r) Encryption Algorithm.
March 1998. RFC 2268. March 1998.
SHA1 National Institute of Standards and Technology. SHA1 National Institute of Standards and Technology.
FIPS Pub 180-1: Secure Hash Standard. 17 April 1995. FIPS Pub 180-1: Secure Hash Standard. 17 April 1995.
X.208 CCITT. Recommendation X.208: Specification of Abstract X.208 CCITT. Recommendation X.208: Specification of Abstract
Syntax Notation One (ASN.1). 1988. Syntax Notation One (ASN.1). 1988.
X.209 CCITT. Recommendation X.209: Specification of Basic Encoding X.209 CCITT. Recommendation X.209: Specification of Basic Encoding
Rules for Abstract Syntax Notation One (ASN.1). 1988. Rules for Abstract Syntax Notation One (ASN.1). 1988.
skipping to change at page 52, line 37 skipping to change at page 56, line 5
content-encryption algorithms are different, the effective security content-encryption algorithms are different, the effective security
is determined by the weaker of the two algorithms. If, for example, is determined by the weaker of the two algorithms. If, for example,
a message content is encrypted with 168-bit Triple-DES and the a message content is encrypted with 168-bit Triple-DES and the
Triple-DES content-encryption key is wrapped with a 40-bit RC2 key, Triple-DES content-encryption key is wrapped with a 40-bit RC2 key,
then at most 40 bits of protection is provided. A trivial search to then at most 40 bits of protection is provided. A trivial search to
determine the value of the 40-bit RC2 key can recover Triple-DES key, determine the value of the 40-bit RC2 key can recover Triple-DES key,
and then the Triple-DES key can be used to decrypt the content. and then the Triple-DES key can be used to decrypt the content.
Therefore, implementers must ensure that key-encryption algorithms Therefore, implementers must ensure that key-encryption algorithms
are as strong or stronger than content-encryption algorithms. are as strong or stronger than content-encryption algorithms.
Section 12.6 specifies a key wrap algorithm used to encrypt a Triple- Section 12.6 specifies key wrap algorithms used to encrypt a Triple-
DES [3DES] or RC2 [RC2] content-encryption key with a Triple-DES or DES [3DES] content-encryption key with a Triple-DES key-encryption
RC2 key-encryption key using CBC mode [MODES]. This key wrap key or to encrypt a RC2 [RC2] content-encryption key with a RC2 key-
algorithm has been reviewed for use with Triple-DES in CBC mode and encryption key. The key wrap algorithms make use of CBC mode
RC2 in CBC mode; it has not been reviewed for use with other [MODES]. These key wrap algorithms have been reviewed for use with
algorithms or other modes. Analysis has discovered concerns with Triple and RC2. They have not been reviewed for use with other
using this key wrap algorithm with stream ciphers or block ciphers in cryptographic modes or other encryption algorithms. Therefore, if a
OFB mode [MODES]. Therefore, if a CMS implementation wises to CMS implementation wishes to support ciphers in addition to Triple-
support ciphers in addition to Triple-DES in CBC mode or RC2 in CBC DES or RC2, then additional key wrap algorithms need to be defined to
mode, then additional key wrap algorithms may need to be defined to
support the additional ciphers. support the additional ciphers.
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 validate the original signature value
prior to countersigning it (this validation requires processing of prior to countersigning it (this validation requires processing of
skipping to change at page 53, line 47 skipping to change at page 57, line 14
consider usage of OAEP, or should ensure that information which could consider usage of OAEP, or should ensure that information which could
reveal the success or failure of attempted PKCS #1 Version 1.5 reveal the success or failure of attempted PKCS #1 Version 1.5
decryption operations is not provided. Support for OAEP will likely decryption operations is not provided. Support for OAEP will likely
be added to a future version of the CMS specification. be added to a future version of the CMS specification.
Acknowledgments Acknowledgments
This document is the result of contributions from many professionals. This document is the result of contributions from many professionals.
I appreciate the hard work of all members of the IETF S/MIME Working I appreciate the hard work of all members of the IETF S/MIME Working
Group. I extend a special thanks to Rich Ankney, Tim Dean, Steve Group. I extend a special thanks to Rich Ankney, Tim Dean, Steve
Dusse, Stephen Henson, Paul Hoffman, Scott Hollenbeck, Burt Kaliski, Dusse, Carl Ellison, Peter Gutmann, Bob Jueneman, Stephen Henson,
John Linn, John Pawling, Blake Ramsdell, Jim Schaad, and Dave Solo Paul Hoffman, Scott Hollenbeck, Don Johnson, Burt Kaliski, John Linn,
for their efforts and support. John Pawling, Blake Ramsdell, Jim Schaad, and Dave Solo for their
efforts and support.
Author Address Author Address
Russell Housley Russell Housley
SPYRUS SPYRUS
381 Elden Street 381 Elden Street
Suite 1120 Suite 1120
Herndon, VA 20170 Herndon, VA 20170
USA USA
skipping to change at page 54, line 38 skipping to change at page 58, line 4
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/