draft-ietf-smime-cms-06.txt   draft-ietf-smime-cms-07.txt 
S/MIME Working Group R. Housley S/MIME Working Group R. Housley
Internet Draft SPYRUS Internet Draft SPYRUS
expires in six months June 1998 expires in six months October 1998
Cryptographic Message Syntax Cryptographic Message Syntax
<draft-ietf-smime-cms-06.txt> <draft-ietf-smime-cms-07.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. 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
skipping to change at page 2, line 51 skipping to change at page 2, line 51
The Cryptographic Message Syntax (CMS) is general enough to support The Cryptographic Message Syntax (CMS) is general enough to support
many different content types. This document defines one protection many different content types. This document defines one protection
content, ContentInfo. ContentInfo encapsulates one or more content, ContentInfo. ContentInfo encapsulates one or more
protection content type. This document defines six content types: protection content type. This document defines six content types:
data, signed-data, enveloped-data, digested-data, encrypted-data, and data, signed-data, enveloped-data, digested-data, encrypted-data, and
authenticated-data. Additional content types can be defined outside authenticated-data. Additional content types can be defined outside
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 type and the data, signed-data, and enveloped- the protection content type and the data, signed-data, and
data content types. The other content types may be implemented if enveloped-data
content types. The other content types may be implemented if
desired. desired.
As a general design philosophy, content types permit single pass As a general design philosophy, content types permit 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
skipping to change at page 5, line 8 skipping to change at page 5, line 4
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 by an issuer
distinguished name and an issuer-specific serial number that uniquely distinguished name and an issuer-specific serial number that uniquely
identify the certificate containing the public key. The signer's identify the certificate containing the public key. The signer's
certificate may be included in the SignedData certificates field. 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
skipping to change at page 5, line 35 skipping to change at page 5, line 32
The following object identifier identifies the signed-data content The following object identifier identifies the signed-data content
type: type:
id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 } us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 }
The signed-data content type shall have ASN.1 type SignedData: The signed-data content type shall have ASN.1 type SignedData:
SignedData ::= SEQUENCE { SignedData ::= SEQUENCE {
version Version, version CMSVersion,
digestAlgorithms DigestAlgorithmIdentifiers, digestAlgorithms DigestAlgorithmIdentifiers,
encapContentInfo EncapsulatedContentInfo, encapContentInfo EncapsulatedContentInfo,
certificates [0] IMPLICIT CertificateSet OPTIONAL, certificates [0] IMPLICIT CertificateSet OPTIONAL,
crls [1] IMPLICIT CertificateRevocationLists OPTIONAL, crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,
signerInfos SignerInfos } signerInfos SignerInfos }
DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier
SignerInfos ::= SET OF SignerInfo SignerInfos ::= SET OF SignerInfo
skipping to change at page 7, line 7 skipping to change at page 7, line 4
The optional omission of the eContent within the The optional omission of the eContent within the
EncapsulatedContentInfo field makes it possible to construct EncapsulatedContentInfo field makes it possible to construct
"external signatures." In the case of external signatures, the "external signatures." In the case of external signatures, the
content being signed is absent from the EncapsulatedContentInfo value content being signed is absent from the EncapsulatedContentInfo value
included in the signed-data content type. If the eContent value included in the signed-data content type. If the eContent value
within EncapsulatedContentInfo is absent, then the signatureValue is within EncapsulatedContentInfo is absent, then the signatureValue is
calculated and the eContentType is assigned as though the eContent calculated and the eContentType is assigned as though the eContent
value was present. value was present.
In the degenerate case where there are no signers, the In the degenerate case where there are no signers, the
EncapsulatedContentInfo value being "signed" is irrelevant. In this EncapsulatedContentInfo
case, the content type within the EncapsulatedContentInfo value being value being "signed" is irrelevant. In this case, the content type
"signed" should be id-data (as defined in section 4), and the content within the EncapsulatedContentInfo value being "signed" should be
field of the EncapsulatedContentInfo value should be omitted. 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 uniquely specifies the eContentType is an object identifier that uniquely specifies the
content type. content type.
eContent in 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.
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 Version, version CMSVersion,
issuerAndSerialNumber IssuerAndSerialNumber, issuerAndSerialNumber IssuerAndSerialNumber,
digestAlgorithm DigestAlgorithmIdentifier, digestAlgorithm DigestAlgorithmIdentifier,
signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL, signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL,
signatureAlgorithm SignatureAlgorithmIdentifier, signatureAlgorithm SignatureAlgorithmIdentifier,
signature SignatureValue, signature SignatureValue,
unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL } unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL }
SignedAttributes ::= SET SIZE (1..MAX) OF Attribute SignedAttributes ::= SET SIZE (1..MAX) OF Attribute
UnsignedAttributes ::= SET SIZE (1..MAX) OF Attribute UnsignedAttributes ::= SET SIZE (1..MAX) OF Attribute
Attribute ::= SEQUENCE { Attribute ::= SEQUENCE {
attrType OBJECT IDENTIFIER, attrType OBJECT IDENTIFIER,
attrValues SET OF AttributeValue } attrValues SET OF AttributeValue }
AttributeValue ::= ANY
AttributeValue ::= ANY
SignatureValue ::= OCTET STRING SignatureValue ::= OCTET STRING
The fields of type SignerInfo have the following meanings: The fields of type SignerInfo have the following meanings:
version is the syntax version number; it shall be 1. version is the syntax version number; it shall be 1.
issuerAndSerialNumber specifies the signer's certificate (and issuerAndSerialNumber specifies the signer's certificate (and
thereby the signer's public key) by issuer distinguished name and thereby the signer's public key) by issuer distinguished name and
issuer-specific serial number. issuer-specific serial number.
skipping to change at page 10, line 38 skipping to change at page 10, line 38
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. for an arbitrary number of recipients using any of the three key
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
algorithm is generated at random. algorithm is generated at random.
skipping to change at page 11, line 48 skipping to change at page 11, line 48
The following object identifier identifies the enveloped-data content The following object identifier identifies the enveloped-data content
type: type:
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 }
The enveloped-data content type shall have ASN.1 type EnvelopedData: The enveloped-data content type shall have ASN.1 type EnvelopedData:
EnvelopedData ::= SEQUENCE { EnvelopedData ::= SEQUENCE {
version Version, version CMSVersion,
originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
recipientInfos RecipientInfos, recipientInfos RecipientInfos,
encryptedContentInfo EncryptedContentInfo } encryptedContentInfo EncryptedContentInfo }
OriginatorInfo ::= SEQUENCE { OriginatorInfo ::= SEQUENCE {
certs [0] IMPLICIT CertificateSet OPTIONAL, certs [0] IMPLICIT CertificateSet OPTIONAL,
crls [1] IMPLICIT CertificateRevocationLists OPTIONAL } crls [1] IMPLICIT CertificateRevocationLists OPTIONAL }
RecipientInfos ::= SET OF RecipientInfo RecipientInfos ::= SET OF RecipientInfo
EncryptedContentInfo ::= SEQUENCE { EncryptedContentInfo ::= SEQUENCE {
skipping to change at page 12, line 31 skipping to change at page 12, line 31
structures included have a version other than 0, then the version structures included have a version other than 0, then the version
shall be 2. If originatorInfo is absent and all of the shall be 2. If originatorInfo is absent and all of the
RecipientInfo structures are version 0, then version shall be 0. RecipientInfo structures are version 0, then version shall be 0.
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. The certificates contained in certs are management algorithms. certs may also contain attribute
intended to be sufficient to make chains from a recognized certificates associated with the originator. The certificates
"root" or "top-level certification authority" to all contained in certs are intended to be sufficient to make chains
recipients. However, certs may contain more certificates than from a recognized "root" or "top-level certification authority"
necessary, and there may be certificates sufficient to make to all recipients. However, certs may contain more
chains from two or more independent top-level certification certificates than necessary, and there may be certificates
authorities. Alternatively, certs may contain fewer sufficient to make chains from two or more independent top-
certificates than necessary, if it is expected that recipients level certification authorities. Alternatively, certs may
have an alternate means of obtaining necessary certificates contain fewer certificates than necessary, if it is expected
(e.g., from a previous set of certificates). that recipients have an alternate means of obtaining necessary
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
certificates in the certs field are valid, but such certificates in the certs field are valid, but such
correspondence is not necessary. There may be more CRLs than correspondence is not necessary. There may be more CRLs than
necessary, and there may also be fewer CRLs than necessary. necessary, and there may also be fewer CRLs than necessary.
recipientInfos is a collection of per-recipient information. recipientInfos is a collection of per-recipient information.
There must be at least one element in the collection. There must be at least one element in the collection.
encryptedContentInfo is the encrypted content information. encryptedContentInfo is the encrypted content information.
The fields of type EncryptedContentInfo have the following meanings: The fields of type EncryptedContentInfo have the following meanings:
contentType indicates the type of content. contentType indicates the type of content.
contentEncryptionAlgorithm identifies the content-encryption contentEncryptionAlgorithm identifies the content-encryption
algorithm, and any associated parameters, used to encrypt the algorithm, and any associated parameters, used to encrypt the
content. The content-encryption process is described in Section content. The content-encryption process is described in Section
6.3. The same algorithm is used for all recipients. 6.3. The same content-encryption algorithm and content-encryption
key is used for all recipients.
encryptedContent is the result of encrypting the content. The encryptedContent is the result of encrypting the content. The
field is optional, and if the field is not present, its intended field is optional, and if the field is not present, its intended
value must be supplied by other means. value must be supplied by other means.
The recipientInfos field comes before the encryptedContentInfo field The recipientInfos field comes before the encryptedContentInfo field
so that an EnvelopedData value may be processed in a single pass. so that an EnvelopedData value may be processed in a single pass.
6.2 RecipientInfo Type 6.2 RecipientInfo Type
Per-recipient information is represented in the type RecipientInfo. Per-recipient information is represented in the type RecipientInfo.
RecipientInfo has a different format for the three key management RecipientInfo has a different format for the three key management
techniques that are supported: key transport, key agreement, and techniques that are supported: key transport, key agreement, and
previously distributed mail list keys. In all cases, the content- previously distributed mail list keys. Any of the three key
encryption key is transferred to one or more recipient in encrypted management techniques can be used for each recipient of the same
form. encrypted content. In all cases, the content-encryption key is
transferred to one or more recipient in encrypted form.
RecipientInfo ::= CHOICE { RecipientInfo ::= CHOICE {
ktri KeyTransRecipientInfo, ktri KeyTransRecipientInfo,
kari [1] KeyAgreeRecipientInfo, kari [1] KeyAgreeRecipientInfo,
mlri [2] MailListRecipientInfo } mlri [2] MailListRecipientInfo }
EncryptedKey ::= OCTET STRING EncryptedKey ::= OCTET STRING
6.2.1 KeyTransRecipientInfo Type 6.2.1 KeyTransRecipientInfo Type
Per-recipient information using key transport is represented in the Per-recipient information using key transport is represented in the
type KeyTransRecipientInfo. Each instance of KeyTransRecipientInfo type KeyTransRecipientInfo. Each instance of KeyTransRecipientInfo
transfers the content-encryption key to one recipient. transfers the content-encryption key to one recipient.
KeyTransRecipientInfo ::= SEQUENCE { KeyTransRecipientInfo ::= SEQUENCE {
version Version, -- always set to 0 or 2 version CMSVersion, -- always set to 0 or 2
rid RecipientIdentifier, rid RecipientIdentifier,
keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
encryptedKey EncryptedKey } encryptedKey EncryptedKey }
RecipientIdentifier ::= CHOICE { RecipientIdentifier ::= CHOICE {
issuerAndSerialNumber IssuerAndSerialNumber, issuerAndSerialNumber IssuerAndSerialNumber,
subjectKeyIdentifier [0] SubjectKeyIdentifier } subjectKeyIdentifier [0] SubjectKeyIdentifier }
The fields of type KeyTransRecipientInfo have the following meanings: The fields of type KeyTransRecipientInfo have the following meanings:
version is the syntax version number. If the RecipientIdentifier version is the syntax version number. If the RecipientIdentifier
is the CHOICE issuerAndSerialNumber, then the version shall be 0. is the CHOICE issuerAndSerialNumber, then the version shall be 0.
If the RecipientIdentifier is subjectKeyIdentifier, then the If the RecipientIdentifier is subjectKeyIdentifier, then the
version shall be 2. version shall be 2.
rid specifies the recipient's certificate or key that was used by rid specifies the recipient's certificate or key that was used by
the sender to protect the content-encryption key. The the sender to protect the content-encryption key. The
RecipientIdentifier provides two alternatives for specifying the RecipientIdentifier provides two alternatives for specifying the
skipping to change at page 14, line 38 skipping to change at page 14, line 42
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.
KeyAgreeRecipientInfo ::= SEQUENCE { KeyAgreeRecipientInfo ::= SEQUENCE {
version Version, -- 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,
subjectKeyIdentifier [0] SubjectKeyIdentifier, subjectKeyIdentifier [0] SubjectKeyIdentifier,
originatorKey [1] OriginatorPublicKey } originatorKey [1] OriginatorPublicKey }
OriginatorPublicKey ::= SEQUENCE { OriginatorPublicKey ::= SEQUENCE {
algorithm AlgorithmIdentifier, algorithm AlgorithmIdentifier,
publicKey BIT STRING } publicKey BIT STRING }
RecipientEncryptedKeys ::= SEQUENCE OF RecipientEncryptedKey RecipientEncryptedKeys ::= SEQUENCE OF RecipientEncryptedKey
RecipientEncryptedKey ::= SEQUENCE { RecipientEncryptedKey ::= SEQUENCE {
rid RecipientIdentifier, rid KeyAgreeRecipientIdentifier,
encryptedKey EncryptedKey } encryptedKey EncryptedKey }
RecipientIdentifier ::= CHOICE { KeyAgreeRecipientIdentifier ::= CHOICE {
issuerAndSerialNumber IssuerAndSerialNumber, issuerAndSerialNumber IssuerAndSerialNumber,
rKeyId [0] IMPLICIT RecipientKeyIdentifier } rKeyId [0] IMPLICIT RecipientKeyIdentifier }
RecipientKeyIdentifier ::= SEQUENCE { RecipientKeyIdentifier ::= SEQUENCE {
subjectKeyIdentifier SubjectKeyIdentifier, subjectKeyIdentifier SubjectKeyIdentifier,
date GeneralizedTime OPTIONAL, date GeneralizedTime OPTIONAL,
other OtherKeyAttribute OPTIONAL } other OtherKeyAttribute OPTIONAL }
SubjectKeyIdentifier ::= OCTET STRING SubjectKeyIdentifier ::= OCTET STRING
skipping to change at page 15, line 50 skipping to change at page 16, line 6
provides a User Keying Material (UKM) to ensure that a different provides a User Keying Material (UKM) to ensure that a different
key is generated each time the same two parties generate a key is generated each time the same two parties generate a
pairwise key. pairwise key.
keyEncryptionAlgorithm identifies the key-encryption algorithm, keyEncryptionAlgorithm identifies the key-encryption algorithm,
and any associated parameters, used to encrypt the content- and any associated parameters, used to encrypt the content-
encryption key in the key-encryption key. The key-encryption encryption key in the key-encryption key. The key-encryption
process is described in Section 6.4. process is described in Section 6.4.
recipientEncryptedKeys includes a recipient identifier and the recipientEncryptedKeys includes a recipient identifier and the
encrypted key for one or more recipients. The RecipientIdentifier encrypted key for one or more recipients. The
is a CHOICE with two alternatives specifying the recipient's KeyAgreeRecipientIdentifier is a CHOICE with two alternatives
certificate, and thereby the recipient's public key, that was used specifying the recipient's certificate, and thereby the
by the sender to generate a pairwise key. The recipient's recipient's public key, that was used by the sender to generate a
certificate must contain a key agreement public key. The content- pairwise key. The recipient's certificate must contain a key
encryption key is encrypted in the pairwise key. The agreement public key. The content-encryption key is encrypted in
issuerAndSerialNumber alternative identifies the recipient's the pairwise key. The issuerAndSerialNumber alternative
certificate by the issuer's distinguished name and the certificate identifies the recipient's certificate by the issuer's
serial number; the RecipientKeyIdentifier is described below. The distinguished name and the certificate serial number; the
encryptedKey is the result of encrypting the content-encryption RecipientKeyIdentifier is described below. The encryptedKey is
key in the pairwise key generated using the key agreement the result of encrypting the content-encryption key in the
algorithm. pairwise key generated using the key agreement algorithm.
The fields of type RecipientKeyIdentifier have the following The fields of type RecipientKeyIdentifier have the following
meanings: meanings:
subjectKeyIdentifier identifies the recipient's certificate by the subjectKeyIdentifier identifies the recipient's certificate by the
X.509 subjectKeyIdentifier extension value. X.509 subjectKeyIdentifier extension value.
date is optional. When present, the date specifies which of the date is optional. When present, the date specifies which of the
recipient's previously distributed UKMs was used by the sender. recipient's previously distributed UKMs was used by the sender.
skipping to change at page 16, line 37 skipping to change at page 16, line 41
6.2.3 MailListRecipientInfo Type 6.2.3 MailListRecipientInfo Type
Recipient information using previously distributed symmetric keys is Recipient information using previously distributed symmetric keys is
represented in the type MailListRecipientInfo. Each instance of represented in the type MailListRecipientInfo. Each instance of
MailListRecipientInfo will transfer the content-encryption key to one MailListRecipientInfo will transfer the content-encryption key to one
or more recipients who have the previously distributed key-encryption or more recipients who have the previously distributed key-encryption
key. key.
MailListRecipientInfo ::= SEQUENCE { MailListRecipientInfo ::= SEQUENCE {
version Version, -- always set to 4 version CMSVersion, -- always set to 4
mlkid MailListKeyIdentifier, mlkid MailListKeyIdentifier,
keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
encryptedKey EncryptedKey } encryptedKey EncryptedKey }
MailListKeyIdentifier ::= SEQUENCE { MailListKeyIdentifier ::= SEQUENCE {
kekIdentifier OCTET STRING, kekIdentifier OCTET STRING,
date GeneralizedTime OPTIONAL, date GeneralizedTime OPTIONAL,
other OtherKeyAttribute OPTIONAL } other OtherKeyAttribute OPTIONAL }
The fields of type MailListRecipientInfo have the following meanings: The fields of type MailListRecipientInfo have the following meanings:
skipping to change at page 18, line 23 skipping to change at page 18, line 23
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
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.
Typically, the digested-data content type is used to provide content Typically, the digested-data content type is used to provide content
integrity, and the result generally becomes an input to the integrity, and the result generally becomes an input to the
enveloped-data content type. enveloped-data content type.
The following steps construct digested-data: The following steps construct digested-data:
skipping to change at page 19, line 4 skipping to change at page 18, line 51
collected together with the content into a DigestedData value. collected together with the content into a DigestedData value.
A recipient verifies the message digest by comparing the message A recipient verifies the message digest by comparing the message
digest to an independently computed message digest. digest to an independently computed message digest.
The following object identifier identifies the digested-data content The following object identifier identifies the digested-data content
type: type:
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 }
The digested-data content type shall have ASN.1 type DigestedData: The digested-data content type shall have ASN.1 type DigestedData:
DigestedData ::= SEQUENCE { DigestedData ::= SEQUENCE {
version Version, version CMSVersion,
digestAlgorithm DigestAlgorithmIdentifier, digestAlgorithm DigestAlgorithmIdentifier,
encapContentInfo EncapsulatedContentInfo, encapContentInfo EncapsulatedContentInfo,
digest Digest } digest Digest }
Digest ::= OCTET STRING Digest ::= OCTET STRING
The fields of type DigestedData have the following meanings: The fields of type DigestedData have the following meanings:
version is the syntax version number. If the encapsulated content version is the syntax version number. If the encapsulated content
type is id-data, then the value of version shall be 0; however, if type is id-data, then the value of version shall be 0; however, if
skipping to change at page 20, line 4 skipping to change at page 19, line 50
The typical application of the encrypted-data content type will be to The typical application of the encrypted-data content type will be to
encrypt the content of the data content type for local storage, encrypt the content of the data content type for local storage,
perhaps where the encryption key is a password. perhaps where the encryption key is a password.
The following object identifier identifies the encrypted-data content The following object identifier identifies the encrypted-data content
type: type:
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 }
The encrypted-data content type shall have ASN.1 type EncryptedData: The encrypted-data content type shall have ASN.1 type EncryptedData:
EncryptedData ::= SEQUENCE { EncryptedData ::= SEQUENCE {
version Version, version CMSVersion,
encryptedContentInfo EncryptedContentInfo } encryptedContentInfo EncryptedContentInfo }
The fields of type EncryptedData have the following meanings: The fields of type EncryptedData have the following meanings:
version is the syntax version number. It shall be 0. version is the syntax version number. It shall be 0.
encryptedContentInfo is the encrypted content information, as encryptedContentInfo is the encrypted content information, as
defined in Section 6.1. defined in Section 6.1.
9 Authenticated-data Content Type 9 Authenticated-data Content Type
skipping to change at page 21, line 13 skipping to change at page 21, line 11
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 Version, version CMSVersion,
originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
recipientInfos RecipientInfos, recipientInfos RecipientInfos,
macAlgorithm MessageAuthenticationCodeAlgorithm, macAlgorithm MessageAuthenticationCodeAlgorithm,
encapContentInfo EncapsulatedContentInfo, encapContentInfo EncapsulatedContentInfo,
authenticatedAttributes [1] IMPLICIT AuthAttributes OPTIONAL, authenticatedAttributes [1] IMPLICIT AuthAttributes OPTIONAL,
mac MessageAuthenticationCode, mac MessageAuthenticationCode,
unauthenticatedAttributes [2] IMPLICIT UnauthAttributes OPTIONAL } unauthenticatedAttributes [2] 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.
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, as defined in algorithm. It may contain certificates, attribute certificates,
Section 6.1. and CRLs, as defined in Section 6.1.
recipientInfos is a collection of per-recipient information, as recipientInfos is a collection of per-recipient information, as
defined in Section 6.1. There must be at least one element in the defined in Section 6.1. There must be at least one element in the
collection. collection.
macAlgorithm is a message authentication code algorithm macAlgorithm is a message authentication code algorithm
identifier. It identifies the message authentication code identifier. It identifies the message authentication code
algorithm, along with any associated parameters, used by the algorithm, along with any associated parameters, used by the
originator. Placement of the macAlgorithm field facilitates one- originator. Placement of the macAlgorithm field facilitates one-
pass processing by the recipient. pass processing by the recipient.
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.
authenticatedAttributes is a collection of attributes that are authenticatedAttributes is a collection of attributes that are
authenticated. The field is optional, but it must be present if authenticated. The field is optional, but it must be present if
the content type of the EncapsulatedContentInfo value being the content type of the EncapsulatedContentInfo value being
authenticated is not id-data. Each AuthenticatedAttribute in the authenticated is not id-data. Each AuthenticatedAttribute in the
SET must be DER encoded. Useful attribute types are defined in SET
must be DER encoded. Useful attribute types are defined in
Section 11. If the field is present, it must contain, at a Section 11. If the field is present, it must contain, 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 signed. Section of the EncapsulatedContentInfo value being signed. Section
11.1 defines the content-type attribute. 11.1 defines the content-type attribute.
A mac-value attribute, having as its value the message A mac-value attribute, having as its value the message
authentication code of the content. Section 11.5 defines the authentication code of the content. Section 11.5 defines the
mac-value attribute. mac-value attribute.
mac is the message authentication code. mac is the message authentication code.
unauthenticatedAttributes is a collection of attributes that are unauthenticatedAttributes is a collection of attributes that are
not authenticated. The field is optional. To date, no attributes not authenticated. The field is optional. To date, no attributes
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 on The MAC calculation process computes a message authentication code
either the message content or the content together with the (MAC) on either the message being authenticated or the message being
originator's authenticated attributes. authenticated together with the originator's authenticated
attributes.
If there are no authenticated attributes, the MAC input data is the
content octets of the DER encoding of the content field of the
ContentInfo value to which the MAC process is applied. Only the
contents octets of the DER encoding of that field are input to the
MAC algorithm, not the identifier octets or the length octets.
If authenticated attributes are present, they must include the If authenticatedAttributes field is absent, the input to the MAC
content-type attribute (as described in Section 11.1) and mac-value calculation process is the value of the encapContentInfo eContent
attribute (as described in section 11.5). The MAC input data is the OCTET STRING. Only the octets comprising the value of the eContent
complete DER encoding of the Attributes value contained in the OCTET STRING are input to the MAC algorithm; the tag and the length
authenticatedAttributes field. Since the Attributes value, when the octets are omitted. This has the advantage that the length of the
field is present, must contain as attributes the content type and the content being authenticated need not be known in advance of the MAC
mac value of the content, those values are indirectly included in the generation process. Although the encapContentInfo eContent OCTET
result. A separate encoding of the authenticatedAttributes field is STRING tag and length octets are not included in the MAC calculation,
performed for MAC calculation. The IMPLICIT [0] tag in the they are still protected by other means. The length octets are
authenticatedAttributes field is not used for the DER encoding, protected by the nature of the MAC algorithm since it is
rather an EXPLICIT SET OF tag is used. That is, the DER encoding of computationally infeasible to find any two distinct messages of any
the SET OF tag, rather than of the IMPLICIT [0] tag, is to be length that have the same MAC.
included in the MAC calculation along with the length and contents
octets of the AuthAttributes value.
If the content has content type id-data and the If authenticatedAttributes field is present, the content-type
authenticatedAttributes field is absent, then just the value of the attribute (as described in Section 11.1) and the mac-value attribute
data (e.g., the contents of a file) is input to the MAC calculation. (as described in section 11.5) must be included, and the input to the
This has the advantage that the length of the content need not be MAC calculation process is the DER encoding of
known in advance of the MAC calculation process. Although the tag authenticatedAttributes. A separate encoding of the
and length octets are not included in the MAC calculation, they are authenticatedAttributes field is performed for MAC calculation. The
still protected by other means. The length octets are protected by IMPLICIT [0] tag in the authenticatedAttributes field is not used for
the nature of the MAC algorithm since it is computationally the
infeasible to find any two distinct messages of any length that have DER encoding, rather an EXPLICIT SET OF tag is used. The DER
the same MAC. encoding of the SET OF tag, rather than of the IMPLICIT [0] tag, is
to be included in the MAC calculation along with the length and
content octets of the authenticatedAttributes value.
The fact that the MAC is computed on part of a DER encoding does not The fact that the MAC is computed on part of a DER encoding does not
mean that DER is the required method of representing that part for mean that DER is the required method of representing that part for
data transfer. Indeed, it is expected that some implementations will data transfer. Indeed, it is expected that some implementations will
store objects in forms other than their DER encodings, but such store objects in forms other than their DER encodings, but such
practices do not affect MAC computation. practices do not affect MAC computation.
The input to the MAC calculation process includes the MAC input data, The input to the MAC calculation process includes the MAC input data,
defined above, and an authentication key conveyed in a recipientInfo defined above, and an authentication key conveyed in a recipientInfo
structure. The details of MAC calculation depend on the MAC structure. The details of MAC calculation depend on the MAC
skipping to change at page 25, line 8 skipping to change at page 25, line 8
The details of encryption and decryption depend on the key management The details of encryption and decryption depend on the key management
algorithm used. Key transport, key agreement, and previously algorithm used. Key transport, key agreement, and previously
distributed symmetric key-encrypting keys are supported. distributed symmetric key-encrypting keys are supported.
KeyEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier KeyEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
10.1.4 ContentEncryptionAlgorithmIdentifier 10.1.4 ContentEncryptionAlgorithmIdentifier
The ContentEncryptionAlgorithmIdentifier type identifies a content- The ContentEncryptionAlgorithmIdentifier type identifies a content-
encryption algorithm. Examples include DES, Triple-DES, and RC2. A encryption algorithm. Examples include Triple-DES and RC2. A
content-encryption algorithm supports encryption and decryption content-encryption algorithm supports encryption and decryption
operations. The encryption operation maps an octet string (the operations. The encryption operation maps an octet string (the
message) to another octet string (the ciphertext) under control of a message) to another octet string (the ciphertext) under control of a
content-encryption key. The decryption operation is the inverse of content-encryption key. The decryption operation is the inverse of
the encryption operation. Context determines which operation is the encryption operation. Context determines which operation is
intended. intended.
ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
10.1.5 MessageAuthenticationCodeAlgorithm 10.1.5 MessageAuthenticationCodeAlgorithm
The MessageAuthenticationCodeAlgorithm type identifies a message The MessageAuthenticationCodeAlgorithm type identifies a message
authentication code (MAC) algorithm. Examples include DES MAC and authentication code (MAC) algorithm. Examples include DES-MAC and
HMAC. A MAC algorithm supports generation and verification HMAC. A MAC algorithm supports generation and verification
operations. The MAC generation and verification operations use the operations. The MAC generation and verification operations use the
same symmetric key. Context determines which operation is intended. same symmetric key. Context determines which operation is intended.
MessageAuthenticationCodeAlgorithm ::= AlgorithmIdentifier MessageAuthenticationCodeAlgorithm ::= AlgorithmIdentifier
10.2 Other Useful Types 10.2 Other Useful Types
This section defines types that are used other places in the This section defines types that are used other places in the
document. The types are not listed in any particular order. document. The types are not listed in any particular order.
10.2.1 CertificateRevocationLists 10.2.1 CertificateRevocationLists
The CertificateRevocationLists type gives a set of certificate The CertificateRevocationLists type gives a set of certificate
revocation lists (CRLs). It is intended that the set contain revocation lists (CRLs). It is intended that the set contain
information sufficient to determine whether the certificates with information sufficient to determine whether the certificates and
which the set is associated are revoked or not. However, there may attribute certificates with which the set is associated are revoked
be more CRLs than necessary or there may be fewer CRLs than or not. However, there may be more CRLs than necessary or there may
necessary. be fewer CRLs than necessary.
The CertificateList may contain a CRL, an Authority Revocation List
(ARL), a Delta Revocation List, or an Attribute Certificate
Revocation List. All of these lists share a common syntax.
The definition of CertificateList is imported from X.509. The definition of CertificateList is imported from X.509.
CertificateRevocationLists ::= SET OF CertificateList CertificateRevocationLists ::= SET OF CertificateList
10.2.2 CertificateChoices 10.2.2 CertificateChoices
The CertificateChoices type gives either a PKCS #6 extended The CertificateChoices type gives either a PKCS #6 extended
certificate [PKCS #6], an X.509 certificate, or an X.509 attribute certificate [PKCS #6], an X.509 certificate, or an X.509 attribute
certificate. The PKCS #6 extended certificate is obsolete. It is certificate. The PKCS #6 extended certificate is obsolete. It is
skipping to change at page 26, line 44 skipping to change at page 27, line 5
The definition of Name is imported from X.501, and the definition of The definition of Name is imported from X.501, and the definition of
CertificateSerialNumber is imported from X.509. CertificateSerialNumber is imported from X.509.
IssuerAndSerialNumber ::= SEQUENCE { IssuerAndSerialNumber ::= SEQUENCE {
issuer Name, issuer Name,
serialNumber CertificateSerialNumber } serialNumber CertificateSerialNumber }
CertificateSerialNumber ::= INTEGER CertificateSerialNumber ::= INTEGER
10.2.5 Version 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.
Version ::= 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 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
skipping to change at page 27, line 30 skipping to change at page 27, line 37
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 or
authenticated-data. Some of these attributes were originally defined authenticated-data. Some of the attributes defined in this section
in PKCS #9 [PKCS #9], others are defined and specified here. The were originally defined in PKCS #9 [PKCS #9], others were not
attributes are not listed in any particular order. previously defined. The attributes are not listed in any particular
order.
Additional attributes are defined in many places, notably the S/MIME
Version 3 Message Specification [MSG] and the Enhanced Security
Services for S/MIME [ESS], which also include recommendations on the
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
attribute type is required if there are any authenticated attributes attribute type is required if there are any authenticated attributes
present. present.
The content-type attribute must be a signed attribute or an The content-type attribute must be a signed attribute or an
authenticated attribute; it cannot be an unsigned attribute or authenticated attribute; it cannot be an unsigned attribute or
skipping to change at page 28, line 7 skipping to change at page 28, line 19
The following object identifier identifies the content-type The following object identifier identifies the content-type
attribute: attribute:
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 }
Content-type attribute values have ASN.1 type ContentType: Content-type attribute values have ASN.1 type ContentType:
ContentType ::= OBJECT IDENTIFIER ContentType ::= OBJECT IDENTIFIER
A content-type attribute must have a single attribute value. A content-type attribute must have a single attribute value, even
though the syntax is defined as a SET OF AttributeValue. There must
not be zero or multiple instances of AttributeValue present.
The SignedAttributes and AuthAttributes syntaxes are each defined as
a SET OF Attributes. The SignedAttributes in a signerInfo must not
include multiple instances of the content-type attribute. Similarly,
the AuthAttributes in an AuthenticatedData must not include multiple
instances of the content-type attribute.
11.2 Message Digest 11.2 Message Digest
The message-digest attribute type specifies the message digest of the The message-digest attribute type specifies the message digest of the
encapContentInfo eContent OCTET STRING being signed in signed-data encapContentInfo eContent OCTET STRING being signed in signed-data
(see section 5.4), where the message digest is computed using the (see section 5.4), where the message digest is computed using the
signer's message digest algorithm. signer's message digest algorithm.
Within signed-data, the message-digest signed attribute type is Within signed-data, the message-digest signed attribute type is
required if there are any attributes present. required if there are any attributes present.
skipping to change at page 28, line 32 skipping to change at page 29, line 4
The following object identifier identifies the message-digest The following object identifier identifies the message-digest
attribute: attribute:
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 }
Message-digest attribute values have ASN.1 type MessageDigest: Message-digest attribute values have ASN.1 type MessageDigest:
MessageDigest ::= OCTET STRING MessageDigest ::= OCTET STRING
A message-digest attribute must have a single attribute value, even
though the syntax is defined as a SET OF AttributeValue. There must
not be zero or multiple instances of AttributeValue present.
A message-digest attribute must have a single attribute value. The SignedAttributes syntax is defined as a SET OF Attributes. The
SignedAttributes in a signerInfo must not include multiple instances
of the message-digest attribute.
11.3 Signing Time 11.3 Signing Time
The signing-time attribute type specifies the time at which the The signing-time attribute type specifies the time at which the
signer (purportedly) performed the signing process. The signing-time signer (purportedly) performed the signing process. The signing-time
attribute type is intended for use in signed-data. attribute type is intended for use in signed-data.
The signing-time attribute may be a signed attribute; it cannot be an The signing-time attribute may be a signed attribute; it cannot be an
unsigned attribute, an authenticated attribute, or an unauthenticated unsigned attribute, an authenticated attribute, or an unauthenticated
attribute. attribute.
skipping to change at page 29, line 17 skipping to change at page 29, line 42
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.
A signing-time attribute must have a single attribute value. UTCTime values must be expressed in Greenwich Mean Time (Zulu) and
must include seconds (i.e., times are YYMMDDHHMMSSZ), even where the
number of seconds is zero. Midnight (GMT) must be represented as
"YYMMDD000000Z". Century information is implicit, and the century
must be determined as follows:
Where YY is greater than or equal to 50, the year shall be
interpreted as 19YY; and
Where YY is less than 50, the year shall be interpreted as 20YY.
GeneralizedTime values shall be expressed in Greenwich Mean Time
(Zulu) and must include seconds (i.e., times are YYYYMMDDHHMMSSZ),
even where the number of seconds is zero. GeneralizedTime values
must not include fractional seconds.
A signing-time attribute must have a single attribute value, even
though the syntax is defined as a SET OF AttributeValue. There must
not be zero or multiple instances of AttributeValue present.
The SignedAttributes syntax is defined as a SET OF Attributes. The
SignedAttributes in a signerInfo must not include multiple instances
of the signing-time attribute.
No requirement is imposed concerning the correctness of the signing No requirement is imposed concerning the correctness of the signing
time, and acceptance of a purported signing time is a matter of a time, and acceptance of a purported signing time is a matter of a
recipient's discretion. It is expected, however, that some signers, recipient's discretion. It is expected, however, that some signers,
such as time-stamp servers, will be trusted implicitly. such as time-stamp servers, will be trusted implicitly.
11.4 Countersignature 11.4 Countersignature
The countersignature attribute type specifies one or more signatures The countersignature attribute type specifies one or more signatures
on the contents octets of the DER encoding of the signatureValue on the contents octets of the DER encoding of the signatureValue
skipping to change at page 30, line 9 skipping to change at page 31, line 9
1. The signedAttributes field must contain a message-digest 1. The signedAttributes field must contain a message-digest
attribute if it contains any other attributes, but need not attribute if it contains any other attributes, but need not
contain a content-type attribute, as there is no content type for contain a content-type attribute, as there is no content type for
countersignatures. countersignatures.
2. The input to the message-digesting process is the contents 2. The input to the message-digesting process is the contents
octets of the DER encoding of the signatureValue field of the octets of the DER encoding of the signatureValue field of the
SignerInfo value with which the attribute is associated. SignerInfo value with which the attribute is associated.
A countersignature attribute can have multiple attribute values. A countersignature attribute can have multiple attribute values. The
syntax is defined as a SET OF AttributeValue, and there must be one
or more instances of AttributeValue present.
The fact that a countersignature is computed on a signature value The UnsignedAttributes syntax is defined as a SET OF Attributes. The
means that the countersigning process need not know the original UnsignedAttributes in a signerInfo may include multiple instances of
content input to the signing process. This has advantages both in the countersignature attribute.
efficiency and in confidentiality. A countersignature, since it has
type SignerInfo, can itself contain a countersignature attribute. A countersignature, since it has type SignerInfo, can itself contain
Thus it is possible to construct arbitrarily long series of a countersignature attribute. Thus it is possible to construct
countersignatures. arbitrarily long series of countersignatures.
11.5 Message Authentication Code (MAC) Value 11.5 Message Authentication Code (MAC) Value
The MAC-value attribute type specifies the MAC of the The MAC-value attribute type specifies the MAC of the
encapContentInfo eContent OCTET STRING being authenticated in encapContentInfo eContent OCTET STRING being authenticated in
authenticated-data (see section 9), where the MAC value is computed authenticated-data (see section 9), where the MAC value is computed
using the originator's MAC algorithm and the data-authentication key. using the originator's MAC algorithm and the data-authentication key.
Within authenticated-data, the MAC-value attribute type is required Within authenticated-data, the MAC-value attribute type is required
if there are any authenticated attributes present. if there are any authenticated attributes present.
skipping to change at page 30, line 42 skipping to change at page 31, line 44
The following object identifier identifies the MAC-value attribute: The following object identifier identifies the MAC-value attribute:
id-macValue OBJECT IDENTIFIER ::= { iso(1) member-body(2) id-macValue OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs9(9) smime(16) aa(2) 8 } us(840) rsadsi(113549) pkcs(1) pkcs9(9) smime(16) aa(2) 8 }
MAC-value attribute values have ASN.1 type MACValue: MAC-value attribute values have ASN.1 type MACValue:
MACValue ::= OCTET STRING MACValue ::= OCTET STRING
A MAC-value attribute must have a single attribute value. A MAC-value attribute must have a single attribute value, even though
the syntax is defined as a SET OF AttributeValue. There must not be
zero or multiple instances of AttributeValue present.
The AuthAttributes syntax is defined as a SET OF Attributes. The
AuthAttributes in an AuthenticatedData must not include multiple
instances of the MAC-value attribute.
12 Supported Algorithms 12 Supported Algorithms
This section lists the algorithms that must be implemented. This section lists the algorithms that must be implemented.
Additional algorithms that may be implemented are also included. Additional algorithms that should be implemented are also included.
12.1 Digest Algorithms 12.1 Digest Algorithms
CMS implementations must include SHA-1. CMS implementations may CMS implementations must include SHA-1. CMS implementations may
include MD5. include MD5.
Digest algorithm identifiers are located in the SignedData
digestAlgorithms field, the SignerInfo digestAlgorithm field, and the
DigestedData digestAlgorithm field.
Digest values are located in the DigestedData digest field, and
digest values are located in the Message Digest authenticated
attribute. In addition, digest values are input to signature
algorithms.
12.1.1 SHA-1 12.1.1 SHA-1
[*** Add pointer to algorithm specification. Provide OID. ***] The SHA-1 digest algorithm is defined in FIPS Pub 180-1 [SHA1]. The
algorithm identifier for SHA-1 is:
sha-1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
oiw(14) secsig(3) algorithm(2) 26 }
The AlgorithmIdentifier parameters field is optional. If present,
the parameters field must contain an ASN.1 NULL. Implementations
should accept SHA-1 AlgorithmIdentifiers with absent parameters as
well as NULL parameters. Implementations should generate SHA-1
AlgorithmIdentifiers with NULL parameters.
12.1.2 MD5 12.1.2 MD5
[*** Add pointer to algorithm specification. Provide OID. ***] The MD5 digest algorithm is defined in RFC 1321 [RFC 1321]. The
algorithm identifier for MD5 is:
md5 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840)
rsadsi(113549) digestAlgorithm(2) 5 }
The AlgorithmIdentifier parameters field must be present, and the
parameters field must contain NULL. Implementations may accept the
MD5 AlgorithmIdentifiers with absent parameters as well as NULL
parameters.
12.2 Signature Algorithms 12.2 Signature Algorithms
CMS implementations must include DSA. CMS implementations may CMS implementations must include DSA. CMS implementations may
include RSA. include RSA.
Signature algorithm identifiers are located in the SignerInfo
signatureAlgorithm field. Also, signature algorithm identifiers are
located in the SignerInfo signatureAlgorithm field of
countersignature attributes.
Signature values are located in the SignerInfo signature field.
Also, signature values are located in the SignerInfo signature field
of countersignature attributes.
12.2.1 DSA 12.2.1 DSA
[*** Add pointer to algorithm specification. Provide OID. Provide The DSA signature algorithm is defined in FIPS Pub 186 [DSS]. DSA is
ASN.1 for parameters and signature value. ***] always used with the SHA-1 message digest algorithm. The algorithm
identifier for DSA is:
id-dsa-with-sha1 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) x9-57 (10040) x9cm(4) 3 }
The AlgorithmIdentifier parameters field must not be present.
12.2.2 RSA 12.2.2 RSA
[*** Add pointer to algorithm specification. Provide OID. Provide The RSA signature algorithm is defined in RFC 2313 [RFC 2313]. RFC
ASN.1 for parameters and signature value. ***] 2313 specifies the use of the RSA signature algorithm with the MD5
message digest algorithm. That definition is extended here to
include support for the SHA-1 message digest algorithm as well. The
algorithm identifier for RSA is:
12.3 Key Encryption Algorithms rsaEncryption OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1 }
CMS implementations must include X9.42 Static Diffie-Hellman. CMS The AlgorithmIdentifier parameters field must be present, and the
implementations may include RSA and Triple-DES. parameters field must contain NULL.
12.3.1 X9.42 Static Diffie-Hellman This specification modifies RFC 2313 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:
[*** Add pointer to algorithm specification. Provide OID. Provide sha-1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
ASN.1 for parameters. ***] oiw(14) secsig(3) algorithm(2) 26 }
12.3.2 RSA 12.3 Key Management Algorithms
[*** Add pointer to algorithm specification. Provide OID. Provide CMS accommodates three general key management techniques: key
ASN.1 for parameters. ***] agreement, key transport, and mail list keys.
12.3.3 Triple-DES Key Wrap 12.3.1 Key Agreement Algorithms
[*** Add pointer to algorithm specification. Provide OID. ***] CMS implementations must include key agreement using X9.42
Ephemeral-Static Diffie-Hellman. CMS implementations must include
key agreement of Triple-DES pairwise key-encryption keys and Triple-
DES wrapping Triple-DES content-encryption keys. CMS implementations
should include key agreement of RC2 pairwise key-encryption keys and
RC2 wrapping RC2 content-encryption keys. The key wrap algorithm is
described in section 12.6.
Key agreement algorithm identifiers are located in the EnvelopedData
RecipientInfo KeyAgreeRecipientInfo keyEncryptionAlgorithm field.
Wrapped content-encryption keys are located in the EnvelopedData
RecipientInfo KeyAgreeRecipientInfo recipientEncryptedKeys
encryptedKey field.
12.3.1.1 X9.42 Ephemeral-Static Diffie-Hellman with Triple-DES
Ephemeral-Static Diffie-Hellman key agreement is defined in RFC TBD1
[RFC TBD1]. When using Ephemeral-Static Diffie-Hellman with Triple-
DES, the EnvelopedData RecipientInfo KeyAgreeRecipientInfo fields are
used as follows:
version must be 3.
originator must be the originatorKey alternative. The
originatorKey algorithm fields must contain the dh-public-number
object identifier with absent parameters. The originatorKey
publicKey field must contain the sender's ephemeral public key.
The dh-public-number object identifier is:
dh-public-number OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) ansi-x942(10046) number-type(2) 1 }
ukm must be absent.
keyEncryptionAlgorithm must be the id-alg-ESDHwith3DES algorithm
identifier with absent parameters. The id-alg-ESDHwith3DES
algorithm identifier is:
id-alg-ESDHwith3DES OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) alg(3) 1 }
recipientEncryptedKeys contains an identifier and an encrypted key
for each recipient. The RecipientEncryptedKey
KeyAgreeRecipientIdentifier must contain either the
issuerAndSerialNumber identifying the recipient's certificate or
the RecipientKeyIdentifier containing the subject key identifier
from the recipient's certificate. In both cases, the recipient's
certificate contains the recipient's static public key.
RecipientEncryptedKey EncryptedKey must contain the content-
encryption Triple-DES key wrapped in the pairwise key agreement
Triple-DES key.
12.3.1.1 X9.42 Ephemeral-Static Diffie-Hellman with RC2
Ephemeral-Static Diffie-Hellman key agreement is defined in RFC TBD1
[RFC TBD1]. When using Ephemeral-Static Diffie-Hellman with RC2, the
EnvelopedData RecipientInfo KeyAgreeRecipientInfo fields are used as
follows:
version must be 3.
originator must be the originatorKey alternative. The
originatorKey algorithm fields must contain the dh-public-number
object identifier with absent parameters. The originatorKey
publicKey field must contain the sender's ephemeral public key.
The dh-public-number object identifier is:
dh-public-number OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) ansi-x942(10046) number-type(2) 1 }
ukm must be absent.
keyEncryptionAlgorithm must be the id-alg-ESDHwithRC2 algorithm
identifier with absent parameters. The id-alg-ESDHwithRC2
algorithm identifier is:
id-alg-ESDHwithRC2 OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) alg(3) 2 }
recipientEncryptedKeys contains an identifier and an encrypted key
for each recipient. The RecipientEncryptedKey
KeyAgreeRecipientIdentifier must contain either the
issuerAndSerialNumber identifying the recipient's certificate or
the RecipientKeyIdentifier containing the subject key identifier
from the recipient's certificate. In both cases, the recipient's
certificate contains the recipient's static public key.
RecipientEncryptedKey EncryptedKey must contain the content-
encryption RC2 key wrapped in the pairwise key agreement RC2 key.
12.3.2 Key Transport Algorithms
CMS implementations should include key transport using RSA. RSA
implementations must include key transport of Triple-DES content-
encryption keys. RSA implementations should include key transport of
RC2 content-encryption keys.
Key transport algorithm identifiers are located in the EnvelopedData
RecipientInfo KeyTransRecipientInfo keyEncryptionAlgorithm field.
Key transport encrypted content-encryption keys are located in the
EnvelopedData RecipientInfo KeyTransRecipientInfo EncryptedKey field.
12.3.2.1 RSA
The RSA key transport algorithm is defined in RFC 2313 [RFC 2313].
RFC 2313 specifies the transport of content-encryption keys,
including Triple-DES and RC2 keys. The algorithm identifier for RSA
is:
rsaEncryption OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1 }
The AlgorithmIdentifier parameters field must be present, and the
parameters field must contain NULL.
12.3.3 Mail List Key Algorithms
CMS implementations may include mail list key management. Mail list
key management implementations must include Triple-DES mail list keys
wrapping Triple-DES content-encryption keys. Mail list key
management implementations should include key transport of RC2
content-encryption keys. The key wrap algorithm is specified in
section 12.6.
Key mail list key algorithm identifiers are located in the
EnvelopedData RecipientInfo MailListRecipientInfo
keyEncryptionAlgorithm field.
Wrapped content-encryption keys are located in the EnvelopedData
RecipientInfo MailListRecipientInfo encryptedKey field.
12.3.3.1 Triple-DES Key Wrap
Mail list key encryption with Triple-DES has the algorithm
identifier:
id-alg-3DESwrap OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) alg(3) 3 }
The AlgorithmIdentifier parameter field must be NULL.
Distribution of the Triple-DES mail list keying material used to
encrypt the content-encryption key is out of the scope of this
document.
12.3.3.2 RC2 Key Wrap
Mail list key encryption with RC2 has the algorithm identifier:
id-alg-RC2wrap OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) alg(3) 4 }
The AlgorithmIdentifier parameter field must be RC2wrapParameter:
RC2wrapParameter ::= RC2ParameterVersion
RC2ParameterVersion ::= INTEGER
The RC2 effective-key-bits (key size) greater than 32 and less than
256 is encoded in the RC2ParameterVersion. For the effective-key-
bits of 40, 64, and 128, the rc2ParameterVersion values are 160, 120,
and 58 respectively. These values are not simply the RC2 key length.
Note that the value 160 must be encoded as two octets (00 A0),
because the one octet (A0) encoding represents a negative number.
Distribution of the RC2 mail list keying material used to encrypt the
content-encryption key is out of the scope of this document.
12.4 Content Encryption Algorithms 12.4 Content Encryption Algorithms
CMS implementations must include Triple-DES in CBC mode. CMS CMS implementations must include Triple-DES in CBC mode. CMS
implementations may include DES in CBC mode and RC2 in CBC mode. implementations should include RC2 in CBC mode.
Content encryption algorithms identifiers are located in the
EnvelopedData EncryptedContentInfo contentEncryptionAlgorithm field
and the EncryptedData EncryptedContentInfo contentEncryptionAlgorithm
field.
Content encryption algorithms are used to encipher the content
located in the EnvelopedData EncryptedContentInfo encryptedContent
field and the EncryptedData EncryptedContentInfo encryptedContent
field.
12.4.1 Triple-DES CBC 12.4.1 Triple-DES CBC
[*** Add pointer to algorithm specification. Provide OID. ***] The Triple-DES algorithm is described in [3DES]. The algorithm
identifier for Triple-DES is:
12.4.2 DES CBC des-ede3-cbc OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) encryptionAlgorithm(3) 7 }
[*** Add pointer to algorithm specification. Provide OID. ***] The AlgorithmIdentifier parameters field must be present and contain
a CBCParameter:
12.4.3 RC2 CBC CBCParameter ::= IV
[*** Add pointer to algorithm specification. Provide OID. ***] IV ::= OCTET STRING -- exactly 8 octets
12.4.2 RC2 CBC
The RC2 algorithm is described in RFC 2268 [RFC 2268]. The algorithm
identifier for RC2 in CBC mode is:
RC2-CBC OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840)
rsadsi(113549) encryptionAlgorithm(3) 2 }
The AlgorithmIdentifier parameters field must be present and contain
a RC2-CBC:
RC2-CBC parameter ::= SEQUENCE {
rc2ParameterVersion INTEGER,
iv OCTET STRING -- exactly 8 octets -- }
The RC2 effective-key-bits (key size) greater than 32 and less than
256 is encoded in the rc2ParameterVersion. For the effective-key-
bits of 40, 64, and 128, the rc2ParameterVersion values are 160, 120,
and 58 respectively. These values are not simply the RC2 key length.
Note that the value 160 must be encoded as two octets (00 A0), since
the one octet (A0) encoding represents a negative number.
12.5 Message Authentication Code Algorithms 12.5 Message Authentication Code Algorithms
No MAC algorithms are mandatory. CMS implementations may include DES CMS implementations that support authenticatedData must include HMAC
MAC and HMAC. with SHA-1. CMS implementations may also include DES MAC.
12.5.1 DES MAC MAC algorithm identifiers are located in the AuthenticatedData
macAlgorithm field.
[*** Add pointer to algorithm specification. Provide OID. ***] MAC values are located in the AuthenticatedData mac field. MAC
values are also located in the mac-value authenticated attribute.
12.5.2 HMAC 12.5.1 HMAC with SHA-1
[*** Add pointer to algorithm specification. Provide OID. ***] The HMAC with SHA-1 algorithm is described in RFC 2104 [RFC 2104].
The algorithm identifier for HMAC with SHA-1 is:
HMAC-SHA1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
dod(6) internet(1) security(5) mechanisms(5) 8 1 2 }
The AlgorithmIdentifier parameters field must be absent.
12.5.2 DES MAC
The DES MAC algorithm is described in FIPS Pub 113 [DES MAC]. CMS
implementations choosing to implement DES MAC must support 32 bit MAC
values. CMS implementations should also support 64 bit MAC values.
The algorithm identifier for DES MAC is:
DES-MAC OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
oiw(14) secsig(3) algorithm(2) 10 }
The AlgorithmIdentifier parameters field must be present. The
parameters contain an INTEGER identifying the length in bits of the
MAC value, constrained to multiples of eight between 16 and 64:
DESMACLength ::= INTEGER -- may be 16, 24, 32, 40, 48, 56, or 64
12.6 CMS Key Wrap Algorithm
CMS implementations must implement the key wrap algorithm specified
in this section.
Key Transport algorithms allow for the content-encryption key to be
directly encrypted; however, key agreement and mail list key
algorithms encrypt the content-encryption key with a second (possibly
different) symmetric encryption algorithm. This section describes
how the content-encryption key is formatted and encrypted.
Key agreement algorithms generate a pairwise key-encryption key, and
this key wrap algorithm is used to encrypt the content-encryption key
in that pairwise key-encryption key. Similarly, this key wrap
algorithm is used to encrypt the content-encryption key in a mail
list key.
The key-encryption key is generated by the key agreement algorithm or
distributed as a mail list key. With key agreement, the minimum
number of bits needed to form the key-encryption key must be used.
As an example, only the first 40 bits of Diffie-Hellman generated
keying material are used for a RC2/40 key-encryption key.
The block size of the key-encryption algorithm must be implicitly
determined from the KeyEncryptionAlgorithmIdentifier field.
Likewise, the size of the content-encryption key must be implicitly
determined from the ContentEncryptionAlgorithmIdentifier field.
Since the same algorithm identifier is used for both 2-key and 3-key
Triple DES, three keys are always wrapped for Triple-DES. Thus, 2-
key Triple-DES provides three keys where the first and third keys are
the same.
12.6.1 Sum of Sums Key Checksum
The Sum of Sums [SUM] key checksum algorithm is:
1. Initialize two 16 bit integers, sum1 and sum2, to zero.
2. Loop through the octets of the content-encryption key, most
significant octet to least significant octet.
2a. Create a 16 bit integer, called temp, by concatenating
eight zero bits and the key octet.
2b. sum1 = sum1 + temp.
2c. sum2 = sum2 + sum1.
3. Use sum2 as the checksum value.
12.6.2 Key Wrap
1. Modify the content-encryption key to meet any restrictions on the key.
For example, adjust the parity bits for DES and Triple-DES keys.
2. Compute a 16-bit key checksum value on the content-encryption key as
described above.
3. Generate a 32-bit random salt value.
4. Concatenate the salt, content-encryption key, and key checksum value.
5. Randomly generate the number of pad octets necessary to make the result
a multiple of block size of the key-encryption algorithm (the Triple-DES
block size is 8 bytes), then append them to the result.
6. Encrypt the result with the key-encryption algorithm key. Use an IV
with each octet equal to 'A5' hexadecimal.
Some key-encryption algorithm identifiers include an IV as part of
the parameters. The IV must still be the constant above.
12.6.3 Key Unwrap
The key unwrap algorithm is:
1. Decrypt the ciphertext using the key-encryption key. Use an IV
with each octet equal to 'A5' hexadecimal.
2. Decompose the result into the content-encryption key and key checksum
values. The salt and pad values are discarded.
3. Compute a 16-bit key checksum value on the content-encryption key
as
described above. 4. If computed key checksum value does not
match the decrypted key checksum
value, then there is an error. 5. If there are restrictions on
keys, then check if the content-encryption
key meets these restrictions. For example, check for odd parity
of each
octet in a DES or Triple-DES key. If any restriction is
incorrect then
there is an error.
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
-- EXPORTS All -- -- EXPORTS All
-- The types and values defined in this module are exported for use in -- The types and values defined in this module are exported for use in
-- the other ASN.1 modules. Other applications may use them for their -- the other ASN.1 modules. Other applications may use them for their
-- own purposes. -- own purposes.
IMPORTS IMPORTS
-- Directory Information Framework (X.501) -- Directory Information Framework (X.501)
Name Name
FROM InformationFramework { joint-iso-itu-t ds(5) modules(1) FROM InformationFramework { joint-iso-itu-t ds(5) modules(1)
informationFramework(1) 3 } informationFramework(1) 3 }
skipping to change at page 33, line 41 skipping to change at page 42, line 41
-- Cryptographic Message Syntax -- Cryptographic Message Syntax
ContentInfo ::= SEQUENCE { ContentInfo ::= SEQUENCE {
contentType ContentType, contentType ContentType,
content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL } content [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
ContentType ::= OBJECT IDENTIFIER ContentType ::= OBJECT IDENTIFIER
SignedData ::= SEQUENCE { SignedData ::= SEQUENCE {
version Version, version CMSVersion,
digestAlgorithms DigestAlgorithmIdentifiers, digestAlgorithms DigestAlgorithmIdentifiers,
encapContentInfo EncapsulatedContentInfo, encapContentInfo EncapsulatedContentInfo,
certificates [0] IMPLICIT CertificateSet OPTIONAL, certificates [0] IMPLICIT CertificateSet OPTIONAL,
crls [1] IMPLICIT CertificateRevocationLists OPTIONAL, crls [1] IMPLICIT CertificateRevocationLists OPTIONAL,
signerInfos SignerInfos } signerInfos SignerInfos }
DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier
SignerInfos ::= SET OF SignerInfo SignerInfos ::= SET OF SignerInfo
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
SignerInfo ::= SEQUENCE { SignerInfo ::= SEQUENCE {
version Version, version CMSVersion,
issuerAndSerialNumber IssuerAndSerialNumber, issuerAndSerialNumber IssuerAndSerialNumber,
digestAlgorithm DigestAlgorithmIdentifier, digestAlgorithm DigestAlgorithmIdentifier,
signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL, signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL,
signatureAlgorithm SignatureAlgorithmIdentifier, signatureAlgorithm SignatureAlgorithmIdentifier,
signature SignatureValue, signature SignatureValue,
unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL } unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL }
SignedAttributes ::= SET SIZE (1..MAX) OF Attribute SignedAttributes ::= SET SIZE (1..MAX) OF Attribute
UnsignedAttributes ::= SET SIZE (1..MAX) OF Attribute UnsignedAttributes ::= SET SIZE (1..MAX) OF Attribute
Attribute ::= SEQUENCE { Attribute ::= SEQUENCE {
attrType OBJECT IDENTIFIER, attrType OBJECT IDENTIFIER,
attrValues SET OF AttributeValue } attrValues SET OF AttributeValue }
AttributeValue ::= ANY AttributeValue ::= ANY
SignatureValue ::= OCTET STRING SignatureValue ::= OCTET STRING
EnvelopedData ::= SEQUENCE { EnvelopedData ::= SEQUENCE {
version Version, version CMSVersion,
originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
recipientInfos RecipientInfos, recipientInfos RecipientInfos,
encryptedContentInfo EncryptedContentInfo } encryptedContentInfo EncryptedContentInfo }
OriginatorInfo ::= SEQUENCE { OriginatorInfo ::= SEQUENCE {
certs [0] IMPLICIT CertificateSet OPTIONAL, certs [0] IMPLICIT CertificateSet OPTIONAL,
crls [1] IMPLICIT CertificateRevocationLists OPTIONAL } crls [1] IMPLICIT CertificateRevocationLists OPTIONAL }
RecipientInfos ::= SET OF RecipientInfo RecipientInfos ::= SET OF RecipientInfo
EncryptedContentInfo ::= SEQUENCE { EncryptedContentInfo ::= SEQUENCE {
contentType ContentType, contentType ContentType,
contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier, contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier,
encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL } encryptedContent [0] IMPLICIT EncryptedContent OPTIONAL }
EncryptedContent ::= OCTET STRING EncryptedContent ::= OCTET STRING
RecipientInfo ::= CHOICE { RecipientInfo ::= CHOICE {
skipping to change at page 35, line 21 skipping to change at page 44, line 10
EncryptedContent ::= OCTET STRING EncryptedContent ::= OCTET STRING
RecipientInfo ::= CHOICE { RecipientInfo ::= CHOICE {
ktri KeyTransRecipientInfo, ktri KeyTransRecipientInfo,
kari [1] KeyAgreeRecipientInfo, kari [1] KeyAgreeRecipientInfo,
mlri [2] MailListRecipientInfo } mlri [2] MailListRecipientInfo }
EncryptedKey ::= OCTET STRING EncryptedKey ::= OCTET STRING
KeyTransRecipientInfo ::= SEQUENCE { KeyTransRecipientInfo ::= SEQUENCE {
version Version, -- always set to 0 or 2 version CMSVersion, -- always set to 0 or 2
rid RecipientIdentifier, rid RecipientIdentifier,
keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
encryptedKey EncryptedKey } encryptedKey EncryptedKey }
RecipientIdentifier ::= CHOICE { RecipientIdentifier ::= CHOICE {
issuerAndSerialNumber IssuerAndSerialNumber, issuerAndSerialNumber IssuerAndSerialNumber,
subjectKeyIdentifier [0] SubjectKeyIdentifier } subjectKeyIdentifier [0] SubjectKeyIdentifier }
KeyAgreeRecipientInfo ::= SEQUENCE { KeyAgreeRecipientInfo ::= SEQUENCE {
version Version, -- 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,
subjectKeyIdentifier [0] SubjectKeyIdentifier, subjectKeyIdentifier [0] SubjectKeyIdentifier,
originatorKey [1] OriginatorPublicKey } originatorKey [1] OriginatorPublicKey }
OriginatorPublicKey ::= SEQUENCE { OriginatorPublicKey ::= SEQUENCE {
algorithm AlgorithmIdentifier, algorithm AlgorithmIdentifier,
publicKey BIT STRING } publicKey BIT STRING }
RecipientEncryptedKeys ::= SEQUENCE OF RecipientEncryptedKey RecipientEncryptedKeys ::= SEQUENCE OF RecipientEncryptedKey
RecipientEncryptedKey ::= SEQUENCE { RecipientEncryptedKey ::= SEQUENCE {
rid RecipientIdentifier, rid KeyAgreeRecipientIdentifier,
encryptedKey EncryptedKey } encryptedKey EncryptedKey }
RecipientIdentifier ::= CHOICE {
KeyAgreeRecipientIdentifier ::= CHOICE {
issuerAndSerialNumber IssuerAndSerialNumber, issuerAndSerialNumber IssuerAndSerialNumber,
rKeyId [0] IMPLICIT RecipientKeyIdentifier } rKeyId [0] IMPLICIT RecipientKeyIdentifier }
RecipientKeyIdentifier ::= SEQUENCE { RecipientKeyIdentifier ::= SEQUENCE {
subjectKeyIdentifier SubjectKeyIdentifier, subjectKeyIdentifier SubjectKeyIdentifier,
date GeneralizedTime OPTIONAL, date GeneralizedTime OPTIONAL,
other OtherKeyAttribute OPTIONAL } other OtherKeyAttribute OPTIONAL }
SubjectKeyIdentifier ::= OCTET STRING SubjectKeyIdentifier ::= OCTET STRING
MailListRecipientInfo ::= SEQUENCE { MailListRecipientInfo ::= SEQUENCE {
version Version, -- always set to 4 version CMSVersion, -- always set to 4
mlkid MailListKeyIdentifier, mlkid MailListKeyIdentifier,
keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier, keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier,
encryptedKey EncryptedKey } encryptedKey EncryptedKey }
MailListKeyIdentifier ::= SEQUENCE { MailListKeyIdentifier ::= SEQUENCE {
kekIdentifier OCTET STRING, kekIdentifier OCTET STRING,
date GeneralizedTime OPTIONAL, date GeneralizedTime OPTIONAL,
other OtherKeyAttribute OPTIONAL } other OtherKeyAttribute OPTIONAL }
DigestedData ::= SEQUENCE { DigestedData ::= SEQUENCE {
version Version, version CMSVersion,
digestAlgorithm DigestAlgorithmIdentifier, digestAlgorithm DigestAlgorithmIdentifier,
encapContentInfo EncapsulatedContentInfo, encapContentInfo EncapsulatedContentInfo,
digest Digest } digest Digest }
Digest ::= OCTET STRING Digest ::= OCTET STRING
EncryptedData ::= SEQUENCE { EncryptedData ::= SEQUENCE {
version Version, version CMSVersion,
encryptedContentInfo EncryptedContentInfo } encryptedContentInfo EncryptedContentInfo }
AuthenticatedData ::= SEQUENCE { AuthenticatedData ::= SEQUENCE {
version Version, version CMSVersion,
originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL, originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
recipientInfos RecipientInfos, recipientInfos RecipientInfos,
macAlgorithm MessageAuthenticationCodeAlgorithm, macAlgorithm MessageAuthenticationCodeAlgorithm,
encapContentInfo EncapsulatedContentInfo, encapContentInfo EncapsulatedContentInfo,
authenticatedAttributes [1] IMPLICIT AuthAttributes OPTIONAL, authenticatedAttributes [1] IMPLICIT AuthAttributes OPTIONAL,
mac MessageAuthenticationCode, mac MessageAuthenticationCode,
unauthenticatedAttributes [2] IMPLICIT UnauthAttributes OPTIONAL } unauthenticatedAttributes [2] IMPLICIT UnauthAttributes OPTIONAL }
AuthAttributes ::= SET SIZE (1..MAX) OF Attribute AuthAttributes ::= SET SIZE (1..MAX) OF Attribute
skipping to change at page 37, line 29 skipping to change at page 46, line 17
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 & X9.57 attrCert [1] IMPLICIT AttributeCertificate } -- See X.509 & X9.57
CertificateSet ::= SET OF CertificateChoices CertificateSet ::= SET OF CertificateChoices
IssuerAndSerialNumber ::= SEQUENCE { IssuerAndSerialNumber ::= SEQUENCE {
issuer Name, issuer Name,
serialNumber CertificateSerialNumber } serialNumber CertificateSerialNumber }
KeyEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier CMSVersion ::= INTEGER { v0(0), v1(1), v2(2), v3(3), v4(4) }
Version ::= INTEGER { v0(0), v1(1), v2(2), v3(3), v4(4) }
UserKeyingMaterial ::= OCTET STRING UserKeyingMaterial ::= OCTET STRING
UserKeyingMaterials ::= SET SIZE (1..MAX) OF UserKeyingMaterial UserKeyingMaterials ::= SET SIZE (1..MAX) OF UserKeyingMaterial
OtherKeyAttribute ::= SEQUENCE { OtherKeyAttribute ::= SEQUENCE {
keyAttrId OBJECT IDENTIFIER, keyAttrId OBJECT IDENTIFIER,
keyAttr ANY DEFINED BY keyAttrId OPTIONAL } keyAttr ANY DEFINED BY keyAttrId OPTIONAL }
-- CMS Attributes -- CMS Attributes
skipping to change at page 39, line 4 skipping to change at page 47, line 36
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) id-macValue OBJECT IDENTIFIER ::= { iso(1) member-body(2)
us(840) rsadsi(113549) pkcs(1) pkcs9(9) smime(16) aa(2) 8 } 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 }
ExtendedCertificateInfo ::= SEQUENCE { ExtendedCertificateInfo ::= SEQUENCE {
version Version, version CMSVersion,
certificate Certificate, certificate Certificate,
attributes UnauthAttributes } attributes UnauthAttributes }
Signature ::= BIT STRING Signature ::= BIT STRING
-- Algorithm Identifiers and Parameters
sha-1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
oiw(14) secsig(3) algorithm(2) 26 }
END -- of CryptographicMessageSyntax END -- of CryptographicMessageSyntax
References References
RFC 2313 Kaliski, B. PKCS #1: RSA Encryption, Version 1.5. 3DES Tuchman, W. "Hellman Presents No Shortcut Solutions To DES".
March 1998. IEEE Spectrum, v. 16, n. 7, pp40-41. July 1979.
RFC 2315 Kaliski, B. PKCS #7: Cryptographic Message Syntax, DES American National Standards Institute. ANSI X3.106,
Version 1.5. March 1998. "American National Standard for Information Systems - Data
Link Encryption". 1983.
DES MAC National Institute of Standards and Technology. FIPS Pub 113:
Computer Data Authentication. May 1985.
DSS National Institute of Standards and Technology.
FIPS Pub 186: Digital Signature Standard. 19 May 1994.
ESS Hoffman, P. Enhanced Security Services for S/MIME.
Internet draft, draft-ietf-smime-ess-*.txt.
MSG Ramsdell, B. S/MIME Version 3 Message Specification.
Internet Draft, draft-ietf-smime-msg-*.txt.
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 #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.
RFC 1321 Rivest, R. The MD5 Message-Digest Algorithm. April 1992.
RFC 1750 Eastlake, D.; S. Crocker; J. Schiller. Randomness
Recommendations for Security. December 1994.
RFC 2104 Krawczyk, H. HMAC: Keyed-Hashing for Message Authentication.
February 1997.
RFC 2268 Rivest, R. A Description of the RC2 (r) Encryption Algorithm.
March 1998.
RFC 2313 Kaliski, B. PKCS #1: RSA Encryption, Version 1.5.
March 1998.
RFC 2315 Kaliski, B. PKCS #7: Cryptographic Message Syntax,
Version 1.5. March 1998.
RFC TBD1 Rescorla, E. Ephemeral-Static Diffie-Hellman Key
Agreement Method. (currently draft-ietf-smime-x942).
SHA1 National Institute of Standards and Technology.
FIPS Pub 180-1: Secure Hash Standard. 17 April 1995.
SUM Fletcher, J. An Arithmetic Checksum for Serial
Transmissions. Reprint UCRL-82569, Lawrence Livermore
Laboraory, University of California. May 1979.
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.
X.501 CCITT. Recommendation X.501: The Directory - Models. 1988. X.501 CCITT. Recommendation X.501: The Directory - Models.
1988.
X.509 CCITT. Recommendation X.509: The Directory - Authentication X.509 CCITT. Recommendation X.509: The Directory -
Authentication
Framework. 1988. Framework. 1988.
Security Considerations Security Considerations
The Cryptographic Message Syntax provides a method for digitally The Cryptographic Message Syntax provides a method for digitally
signing data, digesting data, encrypting data, and authenticating signing data, digesting data, encrypting data, and authenticating
data. data.
Implementations must protect the signer's private key. Compromise of Implementations must protect the signer's private key. Compromise of
the signer's private key permits masquerade. the signer's private key permits masquerade.
Implementations must protect the key management private key, the mail
list key, and the content-encryption key. Compromise of the key
management private key or the mail list key may result in the
disclosure of all messages protected with that key. Similarly,
compromise of the content-encryption key may result in disclosure of
the associated encrypted content.
Implementations must protect the key management private key and the Implementations must protect the key management private key and the
content-encryption key. Compromise of the key management private key message-authentication key. Compromise of the key management private
may result in the disclosure of all messages protected with that key. key permits masquerade of authenticated data. Similarly, compromise
Similarly, compromise of the content-encryption key may result in of the message-authentication key may result in undetectable
disclosure of the encrypted content. modification of the authenticated content.
Implementations must randomly generate content-encryption keys,
message-authentication keys, initialization vectors (Ivs), salt
values, and padding. Also, the generation of public/private key
pairs relies on a random numbers. The use of inadequate pseudo-
random number generators (PRNGs) to generate cryptographic keys can
result in little or no security. An attacker may find it much easier
to
reproduce the PRNG environment that produced the keys, searching the
resulting small set of possibilities, rather than brute force
searching the whole key space. The generation of quality random
numbers is difficult. RFC 1750 offers important guidance in this
area, and Appendix 3 of FIPS Pub 186 [DSS] provides one quality PRNG
technique.
The countersignature unauthenticated attribute includes a digital
signature that is computed on the content signature value, thus the
countersigning process need not know the original signed content.
This structure permits implementation efficiency advantages; however,
this structure may also permit the countersigning of an inappropriate
signature value. Therefore, implementations that perform
countersignatures should either validate the original signature value
prior to countersigning it (this validation requires processing of
the original content), or implementations should perform
countersigning in a context that ensures that only appropriate
signature values are countersigned.
Users of CMS, particularly those employing CMS to support interactive
applications, should be aware that PKCS #1 [RFC 2313] is vulnerable
to adaptive chosen ciphertext attacks when applied for encryption
purposes. Exploitation of this identified vulnerability, revealing
the result of a particular RSA decryption, requires access to an
oracle which will respond to a large number of ciphertexts (based on
currently available results, hundreds of thousands or more), which
are constructed adaptively in response to previously-received replies
providing information on the successes or failures of attempted
decryption operations. As a result, the attack appears significantly
less feasible to perpetrate for store-and-forward S/MIME environments
than for directly interactive protocols. Where CMS constructs are
applied as an intermediate encryption layer within an interactive
request-response communications environment, exploitation could be
more feasible.
An updated version of PKCS #1 has been published, PKCS #1 Version
2.0. This new document may succeed RFC 2313. To resolve the
adaptive chosen ciphertext vulnerability, the new document specifies
and recommends use of Optimal Asymmetric Encryption Padding (OAEP)
when RSA encryption is applied to provide secrecy. Designers of
protocols and systems employing CMS for interactive environments
should either consider usage of OAEP, or should ensure that
information which could reveal the success or failure of attempted
PKCS #1 decryption operations is not provided. Support for OAEP may
be added to a future version of the CMS specification.
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
 End of changes. 

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