< draft-dusse-smime-msg-05.txt   draft-dusse-smime-msg-06.txt >
Internet Draft Steve Dusse, Internet Draft Steve Dusse,
draft-dusse-smime-msg-05.txt RSA Data Security draft-dusse-smime-msg-06.txt RSA Data Security
October 19, 1997 Paul Hoffman, November 08, 1997 Paul Hoffman,
Expires in six months Internet Mail Consortium Expires in six months Internet Mail Consortium
Blake Ramsdell, Blake Ramsdell,
Worldtalk Worldtalk
Laurence Lundblade, Laurence Lundblade,
Qualcomm Qualcomm
Lisa Repka, Lisa Repka,
Netscape Netscape
S/MIME Message Specification S/MIME Message Specification
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
documents of the Internet Engineering Task Force (IETF), its areas, of the Internet Engineering Task Force (IETF), its areas, and its working
and its working groups. Note that other groups may also distribute groups. Note that other groups may also distribute working documents as
working documents as Internet-Drafts. 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
and may be updated, replaced, or obsoleted by other documents at any may be updated, replaced, or obsoleted by other documents at any time. It
time. It is inappropriate to use Internet-Drafts as reference material is inappropriate to use Internet-Drafts as reference material or to cite
or to cite them other than as "work in progress." them other than as "work in progress."
To learn the current status of any Internet-Draft, please check the To learn the current status of any Internet-Draft, please check the
"1id-abstracts.txt" listing contained in the Internet-Drafts Shadow "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow
Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), munnari.oz.au
munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or (Pacific Rim), ds.internic.net (US East Coast), or ftp.isi.edu (US West
ftp.isi.edu (US West Coast). Coast).
1. Introduction 1. Introduction
S/MIME (Secure/Multipurpose Internet Mail Extensions) provides a S/MIME (Secure/Multipurpose Internet Mail Extensions) provides a consistent
consistent way to send and receive secure MIME data. Based on the way to send and receive secure MIME data. Based on the popular Internet
popular Internet MIME standard, S/MIME provides the following MIME standard, S/MIME provides the following cryptographic security
cryptographic security services for electronic messaging applications: services for electronic messaging applications: authentication, message
authentication, message integrity and non-repudiation of origin (using integrity and non-repudiation of origin (using digital signatures) and
digital signatures) and privacy and data security (using encryption). privacy and data security (using encryption).
S/MIME can be used by traditional mail user agents (MUAs) to add S/MIME can be used by traditional mail user agents (MUAs) to add
cryptographic security services to mail that is sent, and to interpret cryptographic security services to mail that is sent, and to interpret
cryptographic security services in mail that is received. However, cryptographic security services in mail that is received. However, S/MIME
S/MIME is not restricted to mail; it can be used with any transport is not restricted to mail; it can be used with any transport mechanism that
mechanism that transports MIME data, such as HTTP. As such, S/MIME transports MIME data, such as HTTP. As such, S/MIME takes advantage of the
takes advantage of the object-based features of MIME and allows secure object-based features of MIME and allows secure messages to be exchanged in
messages to be exchanged in mixed-transport systems. mixed-transport systems.
Further, S/MIME can be used in automated message transfer agents that Further, S/MIME can be used in automated message transfer agents that use
use cryptographic security services that do not require any human cryptographic security services that do not require any human intervention,
intervention, such as the signing of software-generated documents and such as the signing of software-generated documents and the encryption of
the encryption of FAX messages sent over the Internet. FAX messages sent over the Internet.
1.1 Specification Overview 1.1 Specification Overview
This document describes a protocol for adding cryptographic signature This document describes a protocol for adding cryptographic signature and
and encryption services to MIME data. The MIME standard encryption services to MIME data. The MIME standard [MIME-SPEC] provides a
[MIME-SPEC] provides a general structure for the content type of general structure for the content type of Internet messages and allows
Internet messages and allows extensions for new content type extensions for new content type applications.
applications.
This draft defines how to create a MIME body part that has been This draft defines how to create a MIME body part that has been
cryptographically enhanced according to PKCS #7 [PKCS-7]. This draft cryptographically enhanced according to PKCS #7 [PKCS-7]. This draft also
also defines the application/pkcs7-mime MIME type that can be used to defines the application/pkcs7-mime MIME type that can be used to transport
transport those body parts. This draft also defines how to create those body parts. This draft also defines how to create certification
certification requests that conform to PKCS #10 [PKCS-10], and the requests that conform to PKCS #10 [PKCS-10], and the application/pkcs10
application/pkcs10 MIME type for transporting those requests. MIME type for transporting those requests.
This draft also discusses how to use the multipart/signed MIME type This draft also discusses how to use the multipart/signed MIME type defined
defined in [MIME-SECURE] to transport S/MIME signed messages. This in [MIME-SECURE] to transport S/MIME signed messages. This draft also
draft also defines the application/pkcs7-signature MIME type, which is defines the application/pkcs7-signature MIME type, which is also used to
also used to transport S/MIME signed messages. This specification is transport S/MIME signed messages. This specification is compatible with
compatible with PKCS #7 in that it uses the data types defined by PKCS PKCS #7 in that it uses the data types defined by PKCS #7.
#7.
In order to create S/MIME messages, an agent has to follow In order to create S/MIME messages, an agent has to follow specifications
specifications in this draft, as well as some of the specifications in this draft, as well as some of the specifications listed in the
listed in the following documents: following documents:
- "PKCS #1: RSA Encryption", [PKCS-1]. - "PKCS #1: RSA Encryption", [PKCS-1]
- "PKCS #7: Cryptographic Message Syntax", [PKCS-7] - "PKCS #7: Cryptographic Message Syntax", [PKCS-7]
- "PKCS #10: Certification Request Syntax", [PKCS-10]. - "PKCS #10: Certification Request Syntax", [PKCS-10]
Throughout this draft, there are requirements and recommendations made Throughout this draft, there are requirements and recommendations made for
for how receiving agents handle incoming messages. There are separate how receiving agents handle incoming messages. There are separate
requirements and recommendations for how sending agents create requirements and recommendations for how sending agents create outgoing
outgoing messages. In general, the best strategy is to "be liberal in messages. In general, the best strategy is to "be liberal in what you
what you receive and conservative in what you send". Most of the receive and conservative in what you send". Most of the requirements are
requirements are placed on the handling of incoming messages while the placed on the handling of incoming messages while the recommendations are
recommendations are mostly on the creation of outgoing messages. mostly on the creation of outgoing messages.
The separation for requirements on receiving agents and sending agents The separation for requirements on receiving agents and sending agents also
also derives from the likelihood that there will be S/MIME systems derives from the likelihood that there will be S/MIME systems that involve
that involve software other than traditional Internet mail clients. software other than traditional Internet mail clients. S/MIME can be used
S/MIME can be used with any system that transports MIME data. An with any system that transports MIME data. An automated process that sends
automated process that sends an encrypted message might not be able to an encrypted message might not be able to receive an encrypted message at
receive an encrypted message at all, for example. Thus, the all, for example. Thus, the requirements and recommendations for the two
requirements and recommendations for the two types of agents are types of agents are listed separately when appropriate.
listed separately when appropriate.
1.2 Terminology 1.2 Terminology
Throughout this draft, the terms MUST, MUST NOT, SHOULD, and SHOULD Throughout this draft, the terms MUST, MUST NOT, SHOULD, and SHOULD NOT are
NOT are used in capital letters. This conforms to the definitions in used in capital letters. This conforms to the definitions in [MUSTSHOULD].
[MUSTSHOULD]. [MUSTSHOULD] defines the use of these key words to help [MUSTSHOULD] defines the use of these key words to help make the intent of
make the intent of standards track documents as clear as possible. The standards track documents as clear as possible. The same key words are used
same key words are used in this document to help implementors achieve in this document to help implementors achieve interoperability.
interoperability.
1.3 Definitions 1.3 Definitions
For the purposes of this draft, the following definitions apply. For the purposes of this draft, the following definitions apply.
ASN.1: Abstract Syntax Notation One, as defined in CCITT X.680-689. ASN.1: Abstract Syntax Notation One, as defined in CCITT X.208.
BER: Basic Encoding Rules for ASN.1, as defined in CCITT X.690. BER: Basic Encoding Rules for ASN.1, as defined in CCITT X.209.
Certificate: A type that binds an entity's distinguished name to a Certificate: A type that binds an entity's distinguished name to a public
public key with a digital signature. key with a digital signature.
DER: Distinguished Encoding Rules for ASN.1, as defined in CCITT DER: Distinguished Encoding Rules for ASN.1, as defined in CCITT X.509.
X.690.
7-bit data: Text data with lines less than 998 characters long, where 7-bit data: Text data with lines less than 998 characters long, where none
none of the characters have the 8th bit set, and there are no NULL of the characters have the 8th bit set, and there are no NULL characters.
characters. <CR> and <LF> occur only as part of a <CR><LF> end of line <CR> and <LF> occur only as part of a <CR><LF> end of line delimiter.
delimiter.
8-bit data: Text data with lines less than 998 characters, and where 8-bit data: Text data with lines less than 998 characters, and where none
none of the characters are NULL characters. <CR> and <LF> occur only of the characters are NULL characters. <CR> and <LF> occur only as part of
as part of a <CR><LF> end of line delimiter. a <CR><LF> end of line delimiter.
Binary data: Arbitrary data. Binary data: Arbitrary data.
Transfer Encoding: A reversible transformation made on data so 8-bit Transfer Encoding: A reversible transformation made on data so 8-bit or
or binary data may be sent via a channel that only transmits 7-bit binary data may be sent via a channel that only transmits 7-bit data.
data.
1.4 Compatibility with Prior Practice of S/MIME 1.4 Compatibility with Prior Practice of S/MIME
Appendix C contains important information about how S/MIME agents Appendix C contains important information about how S/MIME agents following
following this specification should act in order to have the greatest this specification should act in order to have the greatest
interoperability with earlier implementations of S/MIME. interoperability with earlier implementations of S/MIME.
1.5 Discussion of This Draft 1.5 Discussion of This Draft
This draft is being discussed on the "ietf-smime" mailing list. This draft is being discussed on the "ietf-smime" mailing list.
To subscribe, send a message to: To subscribe, send a message to:
ietf-smime-request@imc.org ietf-smime-request@imc.org
with the single word with the single word
subscribe subscribe
in the body of the message. There is a Web site for the mailing list in the body of the message. There is a Web site for the mailing list
at <http://www.imc.org/ietf-smime/>. at <http://www.imc.org/ietf-smime/>.
2. PKCS #7 Options 2. PKCS #7 Options
The PKCS #7 message format allows for a wide variety of options in The PKCS #7 message format allows for a wide variety of options in content
content and algorithm support. This section puts forth a number of and algorithm support. This section puts forth a number of support
support requirements and recommendations in order to achieve a base requirements and recommendations in order to achieve a base level of
level of interoperability among all S/MIME implementations. interoperability among all S/MIME implementations.
2.1 DigestAlgorithmIdentifier 2.1 DigestAlgorithmIdentifier
Receiving agents MUST support SHA-1 [SHA1] and MD5 [MD5]. Receiving agents MUST support SHA-1 [SHA1] and MD5 [MD5].
Sending agents SHOULD use SHA-1. Sending agents SHOULD use SHA-1.
2.2 DigestEncryptionAlgorithmIdentifier 2.2 DigestEncryptionAlgorithmIdentifier
Receiving agents MUST support rsaEncryption, defined in [PKCS-1]. Receiving agents MUST support rsaEncryption, defined in [PKCS-1]. Receiving
Receiving agents MUST support verification of signatures using RSA agents MUST support verification of signatures using RSA public key sizes
public key sizes from 512 bits to 1024 bits. from 512 bits to 1024 bits.
Sending agents MUST support rsaEncryption. Outgoing messages are Sending agents MUST support rsaEncryption. Outgoing messages are signed
signed with a user's private key. The size of the private key is with a user's private key. The size of the private key is determined during
determined during key generation. key generation.
2.3 KeyEncryptionAlgorithmIdentifier 2.3 KeyEncryptionAlgorithmIdentifier
Receiving agents MUST support rsaEncryption. Incoming encrypted Receiving agents MUST support rsaEncryption. Incoming encrypted messages
messages contain symmetric keys which are to be decrypted with a contain symmetric keys which are to be decrypted with a user's private key.
user's private key. The size of the private key is determined during The size of the private key is determined during key generation.
key generation.
Sending agents MUST support rsaEncryption. Sending agents MUST support Sending agents MUST support rsaEncryption. Sending agents MUST support
encryption of symmetric keys with RSA public keys at key sizes from encryption of symmetric keys with RSA public keys at key sizes from 512
512 bits to 1024 bits. bits to 1024 bits.
2.4 General Syntax 2.4 General Syntax
The PKCS #7 defines six distinct content types: "data", "signedData", The PKCS #7 defines six distinct content types: "data", "signedData",
"envelopedData", "signedAndEnvelopedData", "digestedData", and "envelopedData", "signedAndEnvelopedData", "digestedData", and
"encryptedData". Receiving agents MUST support the "data", "encryptedData". Receiving agents MUST support the "data", "signedData" and
"signedData" and "envelopedData" content types. Sending agents may or "envelopedData" content types. Sending agents may or may not send out any
may not send out any of the content types, depending on the services of the content types, depending on the services that the agent supports.
that the agent supports.
2.4.1 Data Content Type 2.4.1 Data Content Type
Sending agents MUST use the "data" content type as the content within Sending agents MUST use the "data" content type as the content within other
other content types to indicate the message content which has had content types to indicate the message content which has had security
security services applied to it. services applied to it.
2.4.2 SignedData Content Type 2.4.2 SignedData Content Type
Sending agents MUST use the signedData content type to apply a Sending agents MUST use the signedData content type to apply a digital
digital signature to a message or, in a degenerate case where signature to a message or, in a degenerate case where there is no signature
there is no signature information, to convey certificates. information, to convey certificates.
2.4.3 EnvelopedData Content Type 2.4.3 EnvelopedData Content Type
This content type is used to apply privacy protection to a This content type is used to apply privacy protection to a message. A
message. A sender needs to have access to a public key for each sender needs to have access to a public key for each intended message
intended message recipient to use this service. This content type does recipient to use this service. This content type does not provide
not provide authentication. authentication.
2.5 Attribute SignerInfo Type 2.5 Attribute SignerInfo Type
The SignerInfo type allows the inclusion of unauthenticated and The SignerInfo type allows the inclusion of unauthenticated and
authenticated attributes to be included along with a signature. authenticated attributes to be included along with a signature.
Receiving agents MUST be able to handle zero or one instance of each Receiving agents MUST be able to handle zero or one instance of each of the
of the signed attributes described in this section. signed attributes described in this section.
Sending agents SHOULD be able to generate one instance of each of the Sending agents SHOULD be able to generate one instance of each of the
signed attributes described in this section, and SHOULD include these signed attributes described in this section, and SHOULD include these
attributes in each signed message sent. attributes in each signed message sent.
Additional attributes and values for these attributes may be Additional attributes and values for these attributes may be defined in the
defined in the future. Receiving agents SHOULD handle attributes future. Receiving agents SHOULD handle attributes or values that it does
or values that it does not recognize in a graceful manner. not recognize in a graceful manner.
2.5.1 Signing-Time Attribute 2.5.1 Signing-Time Attribute
The signing-time attribute is used to convey the time that a message The signing-time attribute is used to convey the time that a message was
was signed. Until there are trusted timestamping services, the time of signed. Until there are trusted timestamping services, the time of signing
signing will most likely be created by a message originator and will most likely be created by a message originator and therefore is only
therefore is only as trustworthy as the originator. as trustworthy as the originator.
Sending agents MUST encode signing time through the year 2049 as Sending agents MUST encode signing time through the year 2049 as UTCTime;
UTCTime; signing times in 2050 or later MUST be encoded as signing times in 2050 or later MUST be encoded as GeneralizedTime. Agents
GeneralizedTime. Agents MUST interpret the year field (YY) as follows: MUST interpret the year field (YY) as follows: if YY is greater than or
if YY is greater than or equal to 50, the year is interpreted as 19YY; equal to 50, the year is interpreted as 19YY; if YY is less than 50, the
if YY is less than 50, the year is interpreted as 20YY. year is interpreted as 20YY.
2.5.2 SMIMECapabilities Attribute 2.5.2 sMIMECapabilities Attribute
The SMIMECapabilities attribute includes signature algorithms (such as The sMIMECapabilities attribute includes signature algorithms (such as
"md5WithRSAEncryption"), symmetric algorithms (such as "DES-CBC"), and "md5WithRSAEncryption"), symmetric algorithms (such as "DES-CBC"), and key
key encipherment algorithms (such as "rsaEncryption"). It also encipherment algorithms (such as "rsaEncryption"). It also includes a
includes a non-algorithm capability which is the preference for non-algorithm capability which is the preference for signedData. The
signedData. The SMIMECapabilities were designed to be flexible and sMIMECapabilities were designed to be flexible and extensible so that, in
extensible so that, in the future, a means of identifying other the future, a means of identifying other capabilities and preferences such
capabilities and preferences such as certificates can be added in a as certificates can be added in a way that will not cause current clients
way that will not cause current clients to break. to break.
The semantics of the SMIMECapabilites attribute specify a partial list The semantics of the SMIMECapabilites attribute specify a partial list as
as to what the client announcing the SMIMECapabilites can support. A to what the client announcing the SMIMECapabilites can support. A client
client does not have to list every capability it supports, and does not have to list every capability it supports, and probably should not
probably should not list all its capabilities so that the capabilities list all its capabilities so that the capabilities list doesn't get too
list doesn't get too long. In an SMIMECapabilities attribute, the OIDs long. In an sMIMECapabilities attribute, the OIDs are listed in order of
are listed in order of their preference, but SHOULD be logically their preference, but SHOULD be logically separated along the lines of
separated along the lines of their categories (signature algorithms, their categories (signature algorithms, symmetric algorithms, key
symmetric algorithms, key encipherment algorithms, etc.) encipherment algorithms, etc.)
The structure of the SMIMECapabilities attribute is to facilitate The structure of the sMIMECapabilities attribute is to facilitate simple
simple table lookups and binary comparisons in order to determine table lookups and binary comparisons in order to determine matches. For
matches. For instance, the DER-encoding for the SMIMECapability for instance, the DER-encoding for the SMIMECapability for DES EDE3 CBC MUST be
DES EDE3 CBC MUST be identically encoded regardless of the identically encoded regardless of the implementation.
implementation.
In the case of symmetric algorithms, the associated parameters for the In the case of symmetric algorithms, the associated parameters for the OID
OID MUST specify all of the parameters necessary to differentiate MUST specify all of the parameters necessary to differentiate between two
between two instances of the same algorithm. For instance, the number instances of the same algorithm. For instance, the number of rounds and
of rounds and block size for RC5 must be specified in addition to the block size for RC5 must be specified in addition to the key length.
key length.
There is a list of OIDs (the registered SMIMECapabilities list) that There is a list of OIDs (the registered sMIMECapabilities list) that is
is centrally maintained and is separate from this draft. The list of centrally maintained and is separate from this draft. The list of OIDs is
OIDs is maintained by the Internet Mail Consortium at maintained by the Internet Mail Consortium at
<http://www.imc.org/ietf-smime/oids.html>. <http://www.imc.org/ietf-smime/oids.html>.
The OIDs that correspond to algorithms SHOULD use the same OID as the The OIDs that correspond to algorithms SHOULD use the same OID as the
actual algorithm, except in the case where the algorithm usage is actual algorithm, except in the case where the algorithm usage is ambiguous
ambiguous from the OID. For instance, in an earlier draft, from the OID. For instance, in an earlier draft, rsaEncryption was
rsaEncryption was ambiguous because it could refer to either a ambiguous because it could refer to either a signature algorithm or a key
signature algorithm or a key encipherment algorithm. In the event that encipherment algorithm. In the event that an OID is ambiguous, it needs to
an OID is ambiguous, it needs to be arbitrated by the maintainer of be arbitrated by the maintainer of the registered sMIMECapabilities list as
the registered SMIMECapabilities list as to which type of algorithm to which type of algorithm will use the OID, and a new OID MUST be
will use the OID, and a new OID MUST be allocated under the allocated under the sMIMECapabilities OID to satisfy the other use of the
SMIMECapabilities OID to satisfy the other use of the OID. OID.
The registered SMIMECapabilities list specifies the parameters for The registered sMIMECapabilities list specifies the parameters for OIDs
OIDs that need them, most notably key lengths in the case of that need them, most notably key lengths in the case of variable-length
variable-length symmetric ciphers. In the event that there are no symmetric ciphers. In the event that there are no differentiating
differentiating parameters for a particular OID, the parameters MUST parameters for a particular OID, the parameters MUST be omitted, and MUST
be omitted, and MUST NOT be encoded as NULL. NOT be encoded as NULL.
Additional values for the SMIMECapabilities attribute may be defined Additional values for the sMIMECapabilities attribute may be defined in the
in the future. Receiving agents MUST handle a SMIMECapabilities object future. Receiving agents MUST handle a sMIMECapabilities object that has
that has values that it does not recognize in a graceful manner. values that it does not recognize in a graceful manner.
2.6 ContentEncryptionAlgorithmIdentifier 2.6 ContentEncryptionAlgorithmIdentifier
Receiving agents MUST support decryption using the RC2 [RC2] or a Receiving agents MUST support decryption using the RC2 [RC2] or a
compatible algorithm at a key size of 40 bits, hereinafter called compatible algorithm at a key size of 40 bits, hereinafter called "RC2/40".
"RC2/40". Receiving agents SHOULD support decryption using DES EDE3 Receiving agents SHOULD support decryption using DES EDE3 CBC, hereinafter
CBC, hereinafter called "tripleDES" [3DES] [DES]. called "tripleDES" [3DES] [DES].
Sending agents SHOULD support encryption with RC2/40 and tripleDES. Sending agents SHOULD support encryption with RC2/40 and tripleDES.
2.6.1 Deciding Which Encryption Method To Use 2.6.1 Deciding Which Encryption Method To Use
When a sending agent creates an encrypted message, it has to decide When a sending agent creates an encrypted message, it has to decide which
which type of encryption to use. The decision process involves using type of encryption to use. The decision process involves using information
information garnered from the capabilities lists included in messages garnered from the capabilities lists included in messages received from the
received from the recipient, as well as out-of-band information such recipient, as well as out-of-band information such as private agreements,
as private agreements, user preferences, legal restrictions, and so user preferences, legal restrictions, and so on.
on.
Section 2.5 defines a method by which a sending agent can optionally Section 2.5 defines a method by which a sending agent can optionally
announce, among other things, its decrypting capabilities in its order announce, among other things, its decrypting capabilities in its order of
of preference. The following method for processing and remembering the preference. The following method for processing and remembering the
encryption capabilities attribute in incoming signed messages SHOULD encryption capabilities attribute in incoming signed messages SHOULD be
be used. used.
- If the receiving agent has not yet created a list of capabilities - If the receiving agent has not yet created a list of capabilities
for the sender's public key, then, after verifying the signature for the sender's public key, then, after verifying the signature
on the incoming message and checking the timestamp, the receiving on the incoming message and checking the timestamp, the receiving
agent SHOULD create a new list containing at least the signing agent SHOULD create a new list containing at least the signing
time and the symmetric capabilities. time and the symmetric capabilities.
- If such a list already exists, the receiving agent SHOULD verify - If such a list already exists, the receiving agent SHOULD verify
that the signing time in the incoming message is greater than that the signing time in the incoming message is greater than
the signing time stored in the list and that the signature is the signing time stored in the list and that the signature is
valid. If so, the receiving agent SHOULD update both the signing valid. If so, the receiving agent SHOULD update both the signing
time and capabilities in the list. Values of the signing time that time and capabilities in the list. Values of the signing time that
lie far in the future (that is, a greater discrepancy than any lie far in the future (that is, a greater discrepancy than any
reasonable clock skew), or a capabilitie lists in messages whose reasonable clock skew), or a capabilitie lists in messages whose
signature could not be verified, MUST NOT be accepted. signature could not be verified, MUST NOT be accepted.
The list of capabilities SHOULD be stored for future use in creating The list of capabilities SHOULD be stored for future use in creating
messages. messages.
Before sending a message, the sending agent MUST decide whether it is Before sending a message, the sending agent MUST decide whether it is
willing to use weak encryption for the particular data in the message. willing to use weak encryption for the particular data in the message. If
If the sending agent decides that weak encryption is unacceptable for the sending agent decides that weak encryption is unacceptable for this
this data, then the sending agent MUST NOT use a weak algorithm such data, then the sending agent MUST NOT use a weak algorithm such as RC2/40.
as RC2/40. The decision to use or not use weak encryption overrides The decision to use or not use weak encryption overrides any other decision
any other decision in this section about which encryption algorithm to in this section about which encryption algorithm to use.
use.
Sections 2.6.2.1 through 2.6.2.4 describe the decisions a sending Sections 2.6.2.1 through 2.6.2.4 describe the decisions a sending agent
agent SHOULD use in deciding which type of encryption should be SHOULD use in deciding which type of encryption should be applied to a
applied to a message. These rules are ordered, so the sending agent message. These rules are ordered, so the sending agent SHOULD make its
SHOULD make its decision in the order given. decision in the order given.
2.6.2.1 Rule 1: Known Capabilities 2.6.2.1 Rule 1: Known Capabilities
If the sending agent has received a set of capabilities from the If the sending agent has received a set of capabilities from the recipient
recipient for the message the agent is about to encrypt, then the for the message the agent is about to encrypt, then the sending agent
sending agent SHOULD use that information by selecting the first SHOULD use that information by selecting the first capability in the list
capability in the list (that is, the capability most preferred by the (that is, the capability most preferred by the intended recipient) for
intended recipient) for which the sending agent knows how to encrypt. which the sending agent knows how to encrypt. The sending agent SHOULD use
The sending agent SHOULD use one of the capabilities in the list if one of the capabilities in the list if the agent reasonably expects the
the agent reasonably expects the recipient to be able to decrypt the recipient to be able to decrypt the message.
message.
2.6.2.2 Rule 2: Unknown Capabilities, Known Use of Encryption 2.6.2.2 Rule 2: Unknown Capabilities, Known Use of Encryption
If: If:
- the sending agent has no knowledge of the encryption capabilities - the sending agent has no knowledge of the encryption capabilities
of the recipient, of the recipient,
- and the sending agent has received at least one message from the - and the sending agent has received at least one message from the
recipient, recipient,
- and the last encrypted message received from the recipient had a - and the last encrypted message received from the recipient had a
trusted signature on it, trusted signature on it,
then the outgoing message SHOULD use the same encryption algorithm as then the outgoing message SHOULD use the same encryption algorithm as was
was used on the last signed and encrypted message received from the used on the last signed and encrypted message received from the recipient.
recipient.
2.6.2.3 Rule 3: Unknown Capabilities, Risk of Failed Decryption 2.6.2.3 Rule 3: Unknown Capabilities, Risk of Failed Decryption
If: If:
- the sending agent has no knowledge of the encryption capabilities - the sending agent has no knowledge of the encryption capabilities
of the recipient, of the recipient,
- and the sending agent is willing to risk that the recipient may - and the sending agent is willing to risk that the recipient may
not be able to decrypt the message, not be able to decrypt the message,
then the sending agent SHOULD use tripleDES. then the sending agent SHOULD use tripleDES.
skipping to change at line 402 skipping to change at line 387
If: If:
- the sending agent has no knowledge of the encryption capabilities - the sending agent has no knowledge of the encryption capabilities
of the recipient, of the recipient,
- and the sending agent is not willing to risk that the recipient - and the sending agent is not willing to risk that the recipient
may not be able to decrypt the message, may not be able to decrypt the message,
then the sending agent MUST use RC2/40. then the sending agent MUST use RC2/40.
2.6.3 Choosing Weak Encryption 2.6.3 Choosing Weak Encryption
Like all algorithms that use 40 bit keys, RC2/40 is considered by many Like all algorithms that use 40 bit keys, RC2/40 is considered by many to
to be weak encryption. A sending agent that is controlled by a human be weak encryption. A sending agent that is controlled by a human SHOULD
SHOULD allow a human sender to determine the risks of sending data allow a human sender to determine the risks of sending data using RC2/40 or
using RC2/40 or a similarly weak encryption algorithm before sending a similarly weak encryption algorithm before sending the data, and possibly
the data, and possibly allow the human to use a stronger encryption allow the human to use a stronger encryption method such as tripleDES.
method such as tripleDES.
2.6.4 Multiple Recipients 2.6.4 Multiple Recipients
If a sending agent is composing an encrypted message to a group of If a sending agent is composing an encrypted message to a group of
recipients where the encryption capabilities of some of the recipients recipients where the encryption capabilities of some of the recipients do
do not overlap, the sending agent is forced to send more than one not overlap, the sending agent is forced to send more than one message. It
message. It should be noted that if the sending agent chooses to send should be noted that if the sending agent chooses to send a message
a message encrypted with a strong algorithm, and then send the same encrypted with a strong algorithm, and then send the same message encrypted
message encrypted with a weak algorithm, someone watching the with a weak algorithm, someone watching the communications channel can
communications channel can decipher the contents of the decipher the contents of the strongly-encrypted message simply by
strongly-encrypted message simply by decrypting the weakly-encrypted decrypting the weakly-encrypted message.
message.
3. Creating S/MIME Messages 3. Creating S/MIME Messages
This section describes the S/MIME message formats and how they are This section describes the S/MIME message formats and how they are created.
created. S/MIME messages are a combination of MIME bodies and PKCS S/MIME messages are a combination of MIME bodies and PKCS objects. Several
objects. Several MIME types as well as several PKCS objects are used. MIME types as well as several PKCS objects are used. The data to be secured
The data to be secured is always a canonical MIME entity. The MIME is always a canonical MIME entity. The MIME entity and other data, such as
entity and other data, such as certificates and algorithm identifiers, certificates and algorithm identifiers, are given to PKCS processing
are given to PKCS processing facilities which produces a PKCS object. facilities which produces a PKCS object. The PKCS object is then finally
The PKCS object is then finally wrapped in MIME. wrapped in MIME.
S/MIME provides one format for enveloped-only data, several formats S/MIME provides one format for enveloped-only data, several formats for
for signed-only data, and several formats for signed and enveloped signed-only data, and several formats for signed and enveloped data.
data. Several formats are required to accommodate several Several formats are required to accommodate several environments, in
environments, in particular for signed messages. The criteria for particular for signed messages. The criteria for choosing among these
choosing among these formats are also described. formats are also described.
The reader of this section is expected to understand MIME as described The reader of this section is expected to understand MIME as described in
in [MIME-SPEC] and [MIME-SECURE]. [MIME-SPEC] and [MIME-SECURE].
3.1 Preparing the MIME Entity for Signing or Enveloping 3.1 Preparing the MIME Entity for Signing or Enveloping
S/MIME is used to secure MIME entities. A MIME entity may be a S/MIME is used to secure MIME entities. A MIME entity may be a sub-part,
sub-part, sub-parts of a message, or the whole message with all its sub-parts of a message, or the whole message with all its sub-parts. A MIME
sub-parts. A MIME entity that is the whole message includes only the entity that is the whole message includes only the MIME headers and MIME
MIME headers and MIME body, and does not include the RFC-822 headers. body, and does not include the RFC-822 headers. Note that S/MIME can also
Note that S/MIME can also be used to secure MIME entities used in be used to secure MIME entities used in applications other than Internet
applications other than Internet mail. mail.
The MIME entity that is secured and described in this section can be The MIME entity that is secured and described in this section can be
thought of as the "inside" MIME entity. That is, it is the "innermost" thought of as the "inside" MIME entity. That is, it is the "innermost"
object in what is possibly a larger MIME message. Processing "outside" object in what is possibly a larger MIME message. Processing "outside" MIME
MIME entities into PKCS #7 objects is described in Section 3.2, 3.4 entities into PKCS #7 objects is described in Section 3.2, 3.4 and
and elsewhere. elsewhere.
The procedure for preparing a MIME entity is given in [MIME-SPEC]. The The procedure for preparing a MIME entity is given in [MIME-SPEC]. The same
same procedure is used here with some additional restrictions when procedure is used here with some additional restrictions when signing.
signing. Description of the procedures from [MIME-SPEC] are repeated Description of the procedures from [MIME-SPEC] are repeated here, but the
here, but the reader should refer to that document for the exact reader should refer to that document for the exact procedure. This section
procedure. This section also describes additional requirements. also describes additional requirements.
A single procedure is used for creating MIME entities that are to be A single procedure is used for creating MIME entities that are to be
signed, enveloped, or both signed and enveloped. Some additional steps signed, enveloped, or both signed and enveloped. Some additional steps are
are recommended to defend against known corruptions that can occur recommended to defend against known corruptions that can occur during mail
during mail transport that are of particular importance for transport that are of particular importance for clear-signing using the
clear-signing using the multipart/signed format. It is recommended multipart/signed format. It is recommended that these additional steps be
that these additional steps be performed on enveloped messages, or performed on enveloped messages, or signed and enveloped messages in order
signed and enveloped messages in order that the message can be that the message can be forwarded to any environment without modification.
forwarded to any environment without modification.
These steps are descriptive rather than prescriptive. The implementor These steps are descriptive rather than prescriptive. The implementor is
is free to use any procedure as long as the result is the same. free to use any procedure as long as the result is the same.
Step 1. The MIME entity is prepared according to the local Step 1. The MIME entity is prepared according to the local
conventions conventions
Step 2. The leaf parts of the MIME entity are converted to canonical Step 2. The leaf parts of the MIME entity are converted to canonical
form form
Step 3. Appropriate transfer encoding is applied to the leaves of Step 3. Appropriate transfer encoding is applied to the leaves of
the MIME entity the MIME entity
When an S/MIME message is received, the security services on the When an S/MIME message is received, the security services on the message
message are removed, and the result is the MIME entity. That MIME are removed, and the result is the MIME entity. That MIME entity is
entity is typically passed to a MIME-capable user agent where, it is typically passed to a MIME-capable user agent where, it is further decoded
further decoded and presented to the user or receiving application. and presented to the user or receiving application.
3.1.1 Canonicalization 3.1.1 Canonicalization
Each MIME entity MUST be converted to a canonical form that is uniquely Each MIME entity MUST be converted to a canonical form that is uniquely and
and unambiguously representable in the environment where the signature unambiguously representable in the environment where the signature is
is created and the environment where the signature will be verified. created and the environment where the signature will be verified. MIME
MIME entities MUST be canonicalized for enveloping as well as signing. entities MUST be canonicalized for enveloping as well as signing.
The exact details of canonicalization depend on the actual MIME type The exact details of canonicalization depend on the actual MIME type and
and subtype of an entity, and are not described here. Instead, the subtype of an entity, and are not described here. Instead, the standard for
standard for the particular MIME type should be consulted. For the particular MIME type should be consulted. For example, canonicalization
example, canonicalization of type text/plain is different from of type text/plain is different from canonicalization of audio/basic. Other
canonicalization of audio/basic. Other than text types, most types than text types, most types have only one representation regardless of
have only one representation regardless of computing platform or computing platform or environment which can be considered their canonical
environment which can be considered their canonical representation. In representation. In general, canonicalization will be performed by the
general, canonicalization will be performed by the sending agent sending agent rather than the S/MIME implementation.
rather than the S/MIME implementation.
The most common and important canonicalization is for text, which is The most common and important canonicalization is for text, which is often
often represented differently in different environments. MIME entities represented differently in different environments. MIME entities of major
of major type "text" must have both their line endings and character type "text" must have both their line endings and character set
set canonicalized. The line ending must be the pair of characters canonicalized. The line ending must be the pair of characters <CR><LF>, and
<CR><LF>, and the charset should be a registered charset [CHARSETS]. the charset should be a registered charset [CHARSETS]. The details of the
The details of the canonicalization are specified in [MIME-SPEC]. The canonicalization are specified in [MIME-SPEC]. The chosen charset SHOULD be
chosen charset SHOULD be named in the charset parameter so that named in the charset parameter so that the receiving agent can
the receiving agent can unambiguously determine the charset used. unambiguously determine the charset used.
Note that some charsets such as ISO-2022 have multiple Note that some charsets such as ISO-2022 have multiple representations for
representations for the same characters. When preparing such text for the same characters. When preparing such text for signing, the canonical
signing, the canonical representation specified for the charset representation specified for the charset MUST be used.
MUST be used.
3.1.2 Transfer Encoding 3.1.2 Transfer Encoding
When generating any of the secured MIME entities below, except the When generating any of the secured MIME entities below, except the signing
signing using the multipart/signed format, no transfer encoding at all using the multipart/signed format, no transfer encoding at all is required.
is required. S/MIME implementations MUST be able to deal with binary S/MIME implementations MUST be able to deal with binary MIME objects. If no
MIME objects. If no Content-Transfer-Encoding header is present, the Content-Transfer-Encoding header is present, the transfer encoding should
transfer encoding should be considered 7BIT. be considered 7BIT.
S/MIME implementations SHOULD however use transfer encoding described S/MIME implementations SHOULD however use transfer encoding described in
in section 3.1.3 for all MIME entities they secure. The reason for section 3.1.3 for all MIME entities they secure. The reason for securing
securing only 7-bit MIME entities, even for enveloped data that are only 7-bit MIME entities, even for enveloped data that are not exposed to
not exposed to the transport, is that it allows the MIME entity to be the transport, is that it allows the MIME entity to be handled in any
handled in any environment without changing it. For example, a trusted environment without changing it. For example, a trusted gateway might
gateway might remove the envelope, but not the signature, of a remove the envelope, but not the signature, of a message, and then forward
message, and then forward the signed message on to the end recipient the signed message on to the end recipient so that they can verify the
so that they can verify the signatures directly. If the transport signatures directly. If the transport internal to the site is not 8-bit
internal to the site is not 8-bit clean, such as on a wide-area clean, such as on a wide-area network with a single mail gateway, verifying
network with a single mail gateway, verifying the signature will not the signature will not be possible unless the original MIME entity was only
be possible unless the original MIME entity was only 7-bit data. 7-bit data.
3.1.3 Transfer Encoding for Signing Using multipart/signed 3.1.3 Transfer Encoding for Signing Using multipart/signed
If a multipart/signed entity is EVER to be transmitted over the standard If a multipart/signed entity is EVER to be transmitted over the standard
Internet SMTP infrastructure or other transport that is constrained to Internet SMTP infrastructure or other transport that is constrained to
7-bit text, it MUST have transfer encoding applied so that it is 7-bit text, it MUST have transfer encoding applied so that it is
represented as 7-bit text. MIME entities that are 7-bit data already represented as 7-bit text. MIME entities that are 7-bit data already need
need no transfer encoding. Entities such as 8-bit text and binary data no transfer encoding. Entities such as 8-bit text and binary data can be
can be encoded with quoted-printable or base-64 transfer encoding. encoded with quoted-printable or base-64 transfer encoding.
The primary reason for the 7-bit requirement is that the Internet mail The primary reason for the 7-bit requirement is that the Internet mail
transport infrastructure cannot guarantee transport of 8-bit or binary transport infrastructure cannot guarantee transport of 8-bit or binary
data. Even though many segments of the transport infrastructure now data. Even though many segments of the transport infrastructure now handle
handle 8-bit and even binary data, it is sometimes not possible to 8-bit and even binary data, it is sometimes not possible to know whether
know whether the transport path is 8-bit clear. If a mail message with the transport path is 8-bit clear. If a mail message with 8-bit data were
8-bit data were to encounter a message transfer agent that can not to encounter a message transfer agent that can not transmit 8-bit or binary
transmit 8-bit or binary data, the agent has three options, none of data, the agent has three options, none of which are acceptable for a
which are acceptable for a clear-signed message: clear-signed message:
- The agent could change the transfer encoding; this would - The agent could change the transfer encoding; this would
invalidate the signature. invalidate the signature.
- The agent could transmit the data anyway, which would most likely - The agent could transmit the data anyway, which would most likely
result in the 8th bit being corrupted; this too would invalidate result in the 8th bit being corrupted; this too would invalidate
the signature. the signature.
- The agent could return the message to the sender. - The agent could return the message to the sender.
[MIME-SECURE] prohibits an agent from changing the transfer encoding [MIME-SECURE] prohibits an agent from changing the transfer encoding of the
of the first part of a multipart/signed message. If a compliant agent first part of a multipart/signed message. If a compliant agent that can not
that can not transmit 8-bit or binary data encounters a transmit 8-bit or binary data encounters a multipart/signed message with
multipart/signed message with 8-bit or binary data in the first part, 8-bit or binary data in the first part, it would have to return the message
it would have to return the message to the sender as undeliverable. to the sender as undeliverable.
3.1.4 Sample Canonical MIME Entity 3.1.4 Sample Canonical MIME Entity
This example shows a multipart/mixed message with full transfer This example shows a multipart/mixed message with full transfer encoding.
encoding. This message contains a text part and an attachment. The This message contains a text part and an attachment. The sample message
sample message text includes characters that are not US-ASCII and thus text includes characters that are not US-ASCII and thus must be transfer
must be transfer encoded. Though not shown here, the end of each line encoded. Though not shown here, the end of each line is <CR><LF>. The line
is <CR><LF>. The line ending of the MIME headers, the text, and ending of the MIME headers, the text, and transfer encoded parts, all must
transfer encoded parts, all must be <CR><LF>. be <CR><LF>.
Note that this example is not of an S/MIME message. Note that this example is not of an S/MIME message.
Content-Type: multipart/mixed; boundary=bar Content-Type: multipart/mixed; boundary=bar
--bar --bar
Content-Type: text/plain; charset=iso-8859-1 Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable Content-Transfer-Encoding: quoted-printable
A1Hola Michael! =A1Hola Michael!
How do you like the new S/MIME specification? How do you like the new S/MIME specification?
I agree. It's generally a good idea to encode lines that begin with I agree. It's generally a good idea to encode lines that begin with
From=20because some mail transport agents will insert a greater- From=20because some mail transport agents will insert a greater-
than (>) sign, thus invalidating the signature. than (>) sign, thus invalidating the signature.
Also, in some cases it might be desirable to encode any =20 Also, in some cases it might be desirable to encode any =20
trailing whitespace that occurs on lines in order to ensure =20 trailing whitespace that occurs on lines in order to ensure =20
that the message signature is not invalidated when passing =20 that the message signature is not invalidated when passing =20
a gateway that modifies such whitespace (like BITNET). =20 a gateway that modifies such whitespace (like BITNET). =20
--bar --bar
Content-Type: image/jpeg Content-Type: image/jpeg
Content-Transfer-Encoding: base64
iQCVAwUBMJrRF2N9oWBghPDJAQE9UQQAtl7LuRVndBjrk4EqYBIb3h5QXIX/LC// iQCVAwUBMJrRF2N9oWBghPDJAQE9UQQAtl7LuRVndBjrk4EqYBIb3h5QXIX/LC//
jJV5bNvkZIGPIcEmI5iFd9boEgvpirHtIREEqLQRkYNoBActFBZmh9GC3C041WGq jJV5bNvkZIGPIcEmI5iFd9boEgvpirHtIREEqLQRkYNoBActFBZmh9GC3C041WGq
uMbrbxc+nIs1TIKlA08rVi9ig/2Yh7LFrK5Ein57U/W72vgSxLhe/zhdfolT9Brn uMbrbxc+nIs1TIKlA08rVi9ig/2Yh7LFrK5Ein57U/W72vgSxLhe/zhdfolT9Brn
HOxEa44b+EI= HOxEa44b+EI=
--bar-- --bar--
3.2 The application/pkcs7-mime Type 3.2 The application/pkcs7-mime Type
The application/pkcs7-mime type is used to carry PKCS #7 objects of The application/pkcs7-mime type is used to carry PKCS #7 objects of several
several types including envelopedData and signedData. The details of types including envelopedData and signedData. The details of constructing
constructing these entities is described in subsequent sections. This these entities is described in subsequent sections. This section describes
section describes the general characteristics of the the general characteristics of the application/pkcs7-mime type.
application/pkcs7-mime type.
This MIME type always carries a single PKCS #7 object. The PKCS #7 This MIME type always carries a single PKCS #7 object. The PKCS #7 object
object must always be BER encoding of the ASN.1 syntax describing the must always be BER encoding of the ASN.1 syntax describing the object. The
object. The contentInfo field of the carried PKCS #7 object always contentInfo field of the carried PKCS #7 object always contains a MIME
contains a MIME entity that is prepared as described in section 3.1. entity that is prepared as described in section 3.1. The contentInfo field
The contentInfo field must never be empty. must never be empty.
Since PKCS #7 objects are binary data, in most cases base-64 transfer Since PKCS #7 objects are binary data, in most cases base-64 transfer
encoding is appropriate, in particular when used with SMTP transport. encoding is appropriate, in particular when used with SMTP transport. The
The transfer encoding used depends on the transport through which the transfer encoding used depends on the transport through which the object is
object is to be sent, and is not a characteristic of the MIME type. to be sent, and is not a characteristic of the MIME type.
Note that this discussion refers to the transfer encoding of the Note that this discussion refers to the transfer encoding of the PKCS #7
PKCS #7 object or "outside" MIME entity. It is completely distinct object or "outside" MIME entity. It is completely distinct from, and
from, and unrelated to, the transfer encoding of the MIME entity unrelated to, the transfer encoding of the MIME entity secured by the PKCS
secured by the PKCS #7 object, the "inside" object, which is described #7 object, the "inside" object, which is described in section 3.1.
in section 3.1.
Because there are several types of application/pkcs7-mime objects, a Because there are several types of application/pkcs7-mime objects, a
sending agent SHOULD do as much as possible to help a receiving agent sending agent SHOULD do as much as possible to help a receiving agent know
know about the contents of the object without forcing the receiving about the contents of the object without forcing the receiving agent to
agent to decode the ASN.1 for the object. The MIME headers of all decode the ASN.1 for the object. The MIME headers of all
application/pkcs7-mime objects SHOULD include the optional application/pkcs7-mime objects SHOULD include the optional "smime-type"
"smime-type" parameter, as described in the following sections. parameter, as described in the following sections.
3.2.1 The name and filename Parameters 3.2.1 The name and filename Parameters
For the application/pkcs7-mime, sending agents SHOULD emit the For the application/pkcs7-mime, sending agents SHOULD emit the optional
optional "name" parameter to the Content-Type field for compatibility "name" parameter to the Content-Type field for compatibility with older
with older systems. Sending agents SHOULD also emit the optional systems. Sending agents SHOULD also emit the optional Content-Disposition
Content-Disposition field [CONTDISP] with the "filename" parameter. If field [CONTDISP] with the "filename" parameter. If a sending agent emits
a sending agent emits the above parameters, the value of the the above parameters, the value of the parameters SHOULD be a file name
parameters SHOULD be a file name with the appropriate extension: with the appropriate extension:
MIME Type File Extension MIME Type File Extension
application/pkcs7-mime .p7m application/pkcs7-mime .p7m
(signedData, envelopedData) (signedData, envelopedData)
application/pkcs7-mime .p7c application/pkcs7-mime .p7c
(degenerate signedData (degenerate signedData
"certs-only" message) "certs-only" message)
application/pkcs7-signature .p7s application/pkcs7-signature .p7s
application/pkcs10 .p10 application/pkcs10 .p10
In addition, the file name SHOULD be limited to eight characters In addition, the file name SHOULD be limited to eight characters followed
followed by a three letter extension. The eight character filename by a three letter extension. The eight character filename base can be any
base can be any distinct name; the use of the filename base "smime" distinct name; the use of the filename base "smime" SHOULD be used to
SHOULD be used to indicate that the MIME entity is associated with indicate that the MIME entity is associated with S/MIME.
S/MIME.
Including a file name serves two purposes. It facilitates easier use Including a file name serves two purposes. It facilitates easier use of
of S/MIME objects as files on disk. It also can convey type S/MIME objects as files on disk. It also can convey type information across
information across gateways. When a MIME entity of type gateways. When a MIME entity of type application/pkcs7-mime (for example)
application/pkcs7-mime (for example) arrives at a gateway that has no arrives at a gateway that has no special knowledge of S/MIME, it will
special knowledge of S/MIME, it will default the entity's MIME type to default the entity's MIME type to application/octet-stream and treat it as
application/octet-stream and treat it as a generic attachment, thus a generic attachment, thus losing the type information. However, the
losing the type information. However, the suggested filename for an suggested filename for an attachment is often carried across a gateway.
attachment is often carried across a gateway. This often allows the This often allows the receiving systems to determine the appropriate
receiving systems to determine the appropriate application to hand the application to hand the attachment off to, in this case a stand-alone
attachment off to, in this case a stand-alone S/MIME processing S/MIME processing application. Note that this mechanism is provided as a
application. Note that this mechanism is provided as a convenience for convenience for implementations in certain environments. A proper S/MIME
implementations in certain environments. A proper S/MIME implementation MUST use the MIME types and MUST NOT rely on the file
implementation MUST use the MIME types and MUST not rely on the file
extensions. extensions.
3.3 Creating an Enveloped-only Message 3.3 Creating an Enveloped-only Message
This section describes the format for enveloping a MIME entity without This section describes the format for enveloping a MIME entity without
signing it. signing it.
Step 1. The MIME entity to be enveloped is prepared according to Step 1. The MIME entity to be enveloped is prepared according to
section 3.1. section 3.1.
Step 2. The MIME entity and other required data is processed into a Step 2. The MIME entity and other required data is processed into a
PKCS #7 object of type envelopedData. PKCS #7 object of type envelopedData.
Step 3. The PKCS #7 object is inserted into an application/pkcs7-mime Step 3. The PKCS #7 object is inserted into an application/pkcs7-mime
MIME entity. MIME entity.
The smime-type parameter for enveloped-only messages is The smime-type parameter for enveloped-only messages is "enveloped-data".
"enveloped-data". The file extension for this type of message is The file extension for this type of message is ".p7m".
".p7m".
A sample message would be: A sample message would be:
Content-Type: application/pkcs7-mime; smime-type=enveloped-data; Content-Type: application/pkcs7-mime; smime-type=enveloped-data;
name=smime.p7m name=smime.p7m
Content-Transfer-Encoding: base64 Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7m Content-Disposition: attachment; filename=smime.p7m
rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6 rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6
7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H 7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H
f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4
0GhIGfHfQbnj756YT64V 0GhIGfHfQbnj756YT64V
3.4 Creating a Signed-only Message 3.4 Creating a Signed-only Message
There are two formats for signed messages defined for S/MIME: There are two formats for signed messages defined for S/MIME:
application/pkcs7-mime and SignedData, and multipart/signed. In application/pkcs7-mime and SignedData, and multipart/signed. In general,
general, the multipart/signed form is preferred for sending, and the multipart/signed form is preferred for sending, and receiving agents
receiving agents SHOULD be able to handle both. SHOULD be able to handle both.
3.4.1 Choosing a Format for Signed-only Messages 3.4.1 Choosing a Format for Signed-only Messages
There are no hard-and-fast rules when a particular signed-only format There are no hard-and-fast rules when a particular signed-only format
should be chosen because it depends on the capabilities of all the should be chosen because it depends on the capabilities of all the
receivers and the relative importance of receivers with S/MIME receivers and the relative importance of receivers with S/MIME facilities
facilities being able to verify the signature versus the importance of being able to verify the signature versus the importance of receivers
receivers without S/MIME software being able to view the message. without S/MIME software being able to view the message.
Messages signed using the multipart/signed format can always be viewed Messages signed using the multipart/signed format can always be viewed by
by the receiver whether they have S/MIME software or not. They can the receiver whether they have S/MIME software or not. They can also be
also be viewed whether they are using a MIME-native user agent or they viewed whether they are using a MIME-native user agent or they have
have messages translated by a gateway. In this context, "be viewed" messages translated by a gateway. In this context, "be viewed" means the
means the ability to process the message essentially as if it were not ability to process the message essentially as if it were not a signed
a signed message, including any other MIME structure the message might message, including any other MIME structure the message might have.
have.
Messages signed using the signedData format cannot be viewed by a Messages signed using the signedData format cannot be viewed by a recipient
recipient unless they have S/MIME facilities. However, if they have unless they have S/MIME facilities. However, if they have S/MIME
S/MIME facilities, these messages can always be verified if they were facilities, these messages can always be verified if they were not changed
not changed in transit. in transit.
3.4.2 Signing Using application/pkcs7-mime and SignedData 3.4.2 Signing Using application/pkcs7-mime and SignedData
This signing format uses the application/pkcs7-mime MIME type. The This signing format uses the application/pkcs7-mime MIME type. The steps to
steps to create this format are: create this format are:
Step 1. The MIME entity is prepared according to section 3.1 Step 1. The MIME entity is prepared according to section 3.1
Step 2. The MIME entity and other required data is processed into a Step 2. The MIME entity and other required data is processed into a
PKCS #7 object of type signedData PKCS #7 object of type signedData
Step 3. The PKCS #7 object is inserted into an Step 3. The PKCS #7 object is inserted into an
application/pkcs7-mime MIME entity application/pkcs7-mime MIME entity
The smime-type parameter for messages using application/pkcs7-mime and The smime-type parameter for messages using application/pkcs7-mime and
SignedData is "signed-data". The file extension for this type of SignedData is "signed-data". The file extension for this type of message is
message is ".p7m". ".p7m".
A sample message would be: A sample message would be:
Content-Type: application/pkcs7-mime; smime-type=signed-data; Content-Type: application/pkcs7-mime; smime-type=signed-data;
name=smime.p7m name=smime.p7m
Content-Transfer-Encoding: base64 Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7m Content-Disposition: attachment; filename=smime.p7m
567GhIGfHfYT6ghyHhHUujpfyF4f8HHGTrfvhJhjH776tbB9HG4VQbnj7 567GhIGfHfYT6ghyHhHUujpfyF4f8HHGTrfvhJhjH776tbB9HG4VQbnj7
77n8HHGT9HG4VQpfyF467GhIGfHfYT6rfvbnj756tbBghyHhHUujhJhjH 77n8HHGT9HG4VQpfyF467GhIGfHfYT6rfvbnj756tbBghyHhHUujhJhjH
HUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H7n8HHGghyHh HUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H7n8HHGghyHh
6YT64V0GhIGfHfQbnj75 6YT64V0GhIGfHfQbnj75
3.4.3 Signing Using the multipart/signed Format 3.4.3 Signing Using the multipart/signed Format
This format is a clear-signing format. Recipients without any S/MIME This format is a clear-signing format. Recipients without any S/MIME or
or PKCS processing facilities are able to view the message. It makes PKCS processing facilities are able to view the message. It makes use of
use of the multipart/signed MIME type described in [MIME-SECURE]. The the multipart/signed MIME type described in [MIME-SECURE]. The
multipart/signed MIME type has two parts. The first part contains the multipart/signed MIME type has two parts. The first part contains the MIME
MIME entity that is to be signed; the second part contains the entity that is to be signed; the second part contains the signature, which
signature, which is a PKCS #7 detached signature. is a PKCS #7 detached signature.
3.4.3.1 The application/pkcs7-signature MIME Type 3.4.3.1 The application/pkcs7-signature MIME Type
This MIME type always contains a single PKCS #7 object of type This MIME type always contains a single PKCS #7 object of type signedData.
signedData. The contentInfo field of the PKCS #7 object must be empty. The contentInfo field of the PKCS #7 object must be empty. The signerInfos
The signerInfos field contains the signatures for the MIME entity. The field contains the signatures for the MIME entity. The details of the
details of the registered type are given in Appendix E. registered type are given in Appendix E.
The file extension for signed-only messages using The file extension for signed-only messages using
application/pkcs7-signature is ".p7s". application/pkcs7-signature is ".p7s".
3.4.3.2 Creating a multipart/signed Message 3.4.3.2 Creating a multipart/signed Message
Step 1. The MIME entity to be signed is prepared according to Step 1. The MIME entity to be signed is prepared according to
section 3.1, taking special care for clear-signing. section 3.1, taking special care for clear-signing.
Step 2. The MIME entity is presented to PKCS #7 processing in order Step 2. The MIME entity is presented to PKCS #7 processing in order
skipping to change at line 809 skipping to change at line 784
multipart/signed message with no processing other than multipart/signed message with no processing other than
that described in section 3.1. that described in section 3.1.
Step 4. Transfer encoding is applied to the detached signature and Step 4. Transfer encoding is applied to the detached signature and
it is inserted into a MIME entity of type it is inserted into a MIME entity of type
application/pkcs7-signature application/pkcs7-signature
Step 5. The MIME entity of the application/pkcs7-signature is Step 5. The MIME entity of the application/pkcs7-signature is
inserted into the second part of the multipart/signed entity inserted into the second part of the multipart/signed entity
The multipart/signed Content type has two required parameters: the The multipart/signed Content type has two required parameters: the protocol
protocol parameter and the micalg parameter. parameter and the micalg parameter.
The protocol parameter MUST be "application/pkcs7-signature". Note The protocol parameter MUST be "application/pkcs7-signature". Note that
that quotation marks are required around the protocol parameter quotation marks are required around the protocol parameter because MIME
because MIME requires that the "/" character in the parameter value requires that the "/" character in the parameter value MUST be quoted.
MUST be quoted.
The micalg parameter allows for one-pass processing when the signature The micalg parameter allows for one-pass processing when the signature is
is being verified. The value of the micalg parameter is dependent on being verified. The value of the micalg parameter is dependent on the
the message digest algorithm used in the calculation of the Message message digest algorithm used in the calculation of the Message Integrity
Integrity Check. The value of the micalg parameter SHOULD be one of Check. The value of the micalg parameter SHOULD be one of the following:
the following:
Algorithm used Value Algorithm used Value
-------------- --------- -------------- ---------
MD5 md5 MD5 md5
SHA-1 sha1 SHA-1 sha1
any other unknown any other unknown
(Historical note: some early implementations of S/MIME emitted and (Historical note: some early implementations of S/MIME emitted and expected
expected "rsa-md5" and "rsa-sha1" for the micalg parameter.) Receiving "rsa-md5" and "rsa-sha1" for the micalg parameter.) Receiving agents SHOULD
agents SHOULD be able to recover gracefully from a micalg parameter be able to recover gracefully from a micalg parameter value that they do
value that they do not recognize. not recognize.
3.4.3.3 Sample multipart/signed Message 3.4.3.3 Sample multipart/signed Message
Content-Type: multipart/signed; Content-Type: multipart/signed;
protocol="application/pkcs7-signature"; protocol="application/pkcs7-signature";
micalg=sha1; boundary=boundary42 micalg=sha1; boundary=boundary42
--boundary42 --boundary42
Content-Type: text/plain Content-Type: text/plain
skipping to change at line 857 skipping to change at line 830
Content-Transfer-Encoding: base64 Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7s Content-Disposition: attachment; filename=smime.p7s
ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6 ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6
4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj 4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj
n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4
7GhIGfHfYT64VQbnj756 7GhIGfHfYT64VQbnj756
--boundary42-- --boundary42--
3.4.3.4 Encapsulating multipart/signed Messages
Some mail gateways will split or alter a multipart/signed message in
ways that might invalidate the signature. Sending agents that create
multipart/signed messages may encapsulate those messages using the
application/mime construct [APP-MIME], as described in Appendix F.
3.5 Signing and Encrypting 3.5 Signing and Encrypting
To achieve signing and enveloping, any of the signed-only and To achieve signing and enveloping, any of the signed-only and
encrypted-only formats may be nested. This is allowed because the encrypted-only formats may be nested. This is allowed because the above
above formats are all MIME entities, and because they all secure MIME formats are all MIME entities, and because they all secure MIME entities.
entities. In addition, PKCS #7 provides a data type for enveloped and
signed data, and its use is described here.
An S/MIME implementation MUST be able to receive and process An S/MIME implementation MUST be able to receive and process arbitrarily
arbitrarily nested S/MIME within reasonable resource limits of the nested S/MIME within reasonable resource limits of the recipient computer.
recipient computer.
It is possible to either sign a message first, or to envelope the It is possible to either sign a message first, or to envelope the message
message first. It is up to the implementor and the user to choose. first. It is up to the implementor and the user to choose. When signing
When signing first, the signatories are then securely obscured by the first, the signatories are then securely obscured by the enveloping. When
enveloping. When enveloping first the signatories are exposed, but it enveloping first the signatories are exposed, but it is possible to verify
is possible to verify signatures without removing the enveloping. This signatures without removing the enveloping. This may be useful in an
may be useful in an environment were automatic signature verification environment were automatic signature verification is desired, as no private
is desired, as no private key material is required to verify a key material is required to verify a signature.
signature.
3.6 Creating a Certificates-only Message 3.6 Creating a Certificates-only Message
The certificates only message or MIME entity is used to transport The certificates only message or MIME entity is used to transport
certificates, such as in response to a registration request. This certificates, such as in response to a registration request. This format
format can also be used to convey CRLs. can also be used to convey CRLs.
Step 1. The certificates are made available to the PKCS #7 generating Step 1. The certificates are made available to the PKCS #7 generating
process which creates a PKCS #7 object of type signedData. process which creates a PKCS #7 object of type signedData.
The contentInfo and signerInfos fields must be empty. The contentInfo and signerInfos fields must be empty.
Step 2. The PKCS #7 signedData object is enclosed in an Step 2. The PKCS #7 signedData object is enclosed in an
application/pkcs7-mime MIME entity application/pkcs7-mime MIME entity
The smime-type parameter for a certs-only message is "certs-only". The smime-type parameter for a certs-only message is "certs-only". The file
The file extension for this type of message is ".p7c". extension for this type of message is ".p7c".
3.7 Creating a Registration Request 3.7 Creating a Registration Request
A typical application which allows a user to generate cryptographic A typical application which allows a user to generate cryptographic
information has to submit that information to a certification information has to submit that information to a certification authority,
authority, who transforms it into a certificate. PKCS #10 describes a who transforms it into a certificate. PKCS #10 describes a syntax for
syntax for certification requests. The application/pkcs10 body type certification requests. The application/pkcs10 body type MUST be used to
MUST be used to transfer a PKCS #10 certification request. transfer a PKCS #10 certification request.
The details of certification requests and the process of obtaining a The details of certification requests and the process of obtaining a
certificate are beyond the scope of this draft. Instead, only the certificate are beyond the scope of this draft. Instead, only the format of
format of data used in application/pkcs10 is defined. data used in application/pkcs10 is defined.
3.7.1 Format of the application/pkcs10 Body 3.7.1 Format of the application/pkcs10 Body
PKCS #10 defines the ASN.1 type CertificationRequest for use in PKCS #10 defines the ASN.1 type CertificationRequest for use in submitting
submitting a certification request. Therefore, when the MIME content a certification request. Therefore, when the MIME content type
type application/pkcs10 is used, the body MUST be a application/pkcs10 is used, the body MUST be a CertificationRequest,
CertificationRequest, encoded using the Basic Encoding Rules (BER). encoded using the Basic Encoding Rules (BER).
Although BER is specified, instead of the more restrictive DER, a Although BER is specified, instead of the more restrictive DER, a typical
typical application will use DER since the CertificationRequest's application will use DER since the CertificationRequest's
CertificationRequestInfo has to be DER-encoded in order to be signed. CertificationRequestInfo has to be DER-encoded in order to be signed. A
A robust application SHOULD output DER, but allow BER or DER on input. robust application SHOULD output DER, but allow BER or DER on input.
Data produced by BER or DER is 8-bit, but many transports are limited Data produced by BER or DER is 8-bit, but many transports are limited to
to 7-bit data. Therefore, a suitable 7-bit Content-Transfer-Encoding 7-bit data. Therefore, a suitable 7-bit Content-Transfer-Encoding SHOULD be
SHOULD be applied. The base64 Content-Transfer-Encoding SHOULD be used applied. The base64 Content-Transfer-Encoding SHOULD be used with
with application/pkcs10, although any 7-bit transfer encoding may application/pkcs10, although any 7-bit transfer encoding may work.
work.
3.7.2 Sending and Receiving an application/pkcs10 Body Part 3.7.2 Sending and Receiving an application/pkcs10 Body Part
For sending a certificate-signing request, the application/pkcs10 For sending a certificate-signing request, the application/pkcs10 message
message format MUST be used to convey a PKCS #10 certificate-signing format MUST be used to convey a PKCS #10 certificate-signing request. Note
request. Note that for sending certificates and CRLs messages that for sending certificates and CRLs messages without any signed content,
without any signed content, the application/pkcs7-mime message format the application/pkcs7-mime message format MUST be used to convey a
MUST be used to convey a degenerate PKCS #7 signedData "certs-only" degenerate PKCS #7 signedData "certs-only" message.
message.
To send an application/pkcs10 body, the application generates the To send an application/pkcs10 body, the application generates the
cryptographic information for the user. The details of the cryptographic information for the user. The details of the cryptographic
cryptographic information are beyond the scope of this draft. information are beyond the scope of this draft.
Step 1. The cryptographic information is placed within a PKCS #10 Step 1. The cryptographic information is placed within a PKCS #10
CertificationRequest. CertificationRequest.
Step 2. The CertificationRequest is encoded according to BER or DER Step 2. The CertificationRequest is encoded according to BER or DER
(typically, DER). (typically, DER).
Step 3. As a typical step, the DER-encoded CertificationRequest is Step 3. As a typical step, the DER-encoded CertificationRequest is
also base64 encoded so that it is 7-bit data suitable for also base64 encoded so that it is 7-bit data suitable for
transfer in SMTP. This then becomes the body of an transfer in SMTP. This then becomes the body of an
skipping to change at line 966 skipping to change at line 926
Content-Type: application/pkcs10; name=smime.p10 Content-Type: application/pkcs10; name=smime.p10
Content-Transfer-Encoding: base64 Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p10 Content-Disposition: attachment; filename=smime.p10
rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6 rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6
7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H 7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H
f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4 f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4
0GhIGfHfQbnj756YT64V 0GhIGfHfQbnj756YT64V
A typical application only needs to send a certification request. It A typical application only needs to send a certification request. It is a
is a certification authority that has to receive and process the certification authority that has to receive and process the request. The
request. The steps for recovering the CertificationRequest from the steps for recovering the CertificationRequest from the message are
message are straightforward but are not presented here. The procedures straightforward but are not presented here. The procedures for processing
for processing the certification request are beyond the scope of this the certification request are beyond the scope of this document.
document.
3.8 Identifying an S/MIME Message 3.8 Identifying an S/MIME Message
Because S/MIME takes into account interoperation in non-MIME Because S/MIME takes into account interoperation in non-MIME environments,
environments, several different mechanisms are employed to carry the several different mechanisms are employed to carry the type information,
type information, and it becomes a bit difficult to identify S/MIME and it becomes a bit difficult to identify S/MIME messages. The following
messages. The following table lists criteria for determining whether table lists criteria for determining whether or not a message is an S/MIME
or not a message is an S/MIME message. A message is considered an message. A message is considered an S/MIME message if it matches any below.
S/MIME message if it matches any below.
The file suffix in the table below comes from the "name" parameter in The file suffix in the table below comes from the "name" parameter in the
the content-type header, or the "filename" parameter on the content-type header, or the "filename" parameter on the content-disposition
content-disposition header. These parameters that give the file suffix header. These parameters that give the file suffix are not listed below as
are not listed below as part of the parameter section. part of the parameter section.
MIME type: application/pkcs7-mime MIME type: application/pkcs7-mime
parameters: any parameters: any
file suffix: any file suffix: any
MIME type: application/pkcs10 MIME type: application/pkcs10
parameters: any parameters: any
file suffix: any file suffix: any
MIME type: multipart/signed MIME type: multipart/signed
parameters: protocol="application/pkcs7-signature" parameters: protocol="application/pkcs7-signature"
file suffix: any file suffix: any
MIME type: application/mime
parameters: content-type="multipart/signed";
protocol="application/pkcs7-signature"
file suffix: any
MIME type: application/octet-stream MIME type: application/octet-stream
parameters: any parameters: any
file suffix: p7m, p7s, aps, p7c, p10 file suffix: p7m, p7s, aps, p7c, p10
4. Certificate Processing 4. Certificate Processing
A receiving agent MUST provide some certificate retrieval mechanism in A receiving agent MUST provide some certificate retrieval mechanism in
order to gain access to certificates for recipients of digital order to gain access to certificates for recipients of digital envelopes.
envelopes. This draft does not cover how S/MIME agents handle This draft does not cover how S/MIME agents handle certificates, only what
certificates, only what they do after a certificate has been validated they do after a certificate has been validated or rejected. S/MIME
or rejected. S/MIME certification issues are covered in a different certification issues are covered in a different document.
document.
At a minimum, for initial S/MIME deployment, a user agent could At a minimum, for initial S/MIME deployment, a user agent could
automatically generate a message to an intended recipient requesting automatically generate a message to an intended recipient requesting that
that recipient's certificate in a signed return message. Receiving and recipient's certificate in a signed return message. Receiving and sending
sending agents SHOULD also provide a mechanism to allow a user to agents SHOULD also provide a mechanism to allow a user to "store and
"store and protect" certificates for correspondents in such a way so protect" certificates for correspondents in such a way so as to guarantee
as to guarantee their later retrieval. their later retrieval.
4.1 Key Pair Generation 4.1 Key Pair Generation
An S/MIME agent or some related administrative utility or function MUST An S/MIME agent or some related administrative utility or function MUST be
be capable of generating RSA key pairs on behalf of the user. Each key capable of generating RSA key pairs on behalf of the user. Each key pair
pair MUST be generated from a good source of non-deterministic MUST be generated from a good source of non-deterministic random input and
random input and protected in a secure fashion. protected in a secure fashion.
A user agent SHOULD generate RSA key pairs at a minimum key size of A user agent SHOULD generate RSA key pairs at a minimum key size of 768
768 bits and a maximum key size of 1024 bits. A user agent MUST NOT bits and a maximum key size of 1024 bits. A user agent MUST NOT generate
generate RSA key pairs less than 512 bits long. Some agents created in RSA key pairs less than 512 bits long. Some agents created in the United
the United States have chosen to create 512 bit keys in order to get States have chosen to create 512 bit keys in order to get more advantageous
more advantageous export licenses. However, 512 bit keys are export licenses. However, 512 bit keys are considered by many to be
considered by many to be cryptographically insecure. cryptographically insecure.
Implementors should be aware that multiple (active) key pairs may be Implementors should be aware that multiple (active) key pairs may be
associated with a single individual. For example, one key pair may be associated with a single individual. For example, one key pair may be used
used to support confidentiality, while a different key pair may be to support confidentiality, while a different key pair may be used for
used for authentication. authentication.
5. Security 5. Security Considerations
This entire draft discusses security. Security issues not covered in This entire draft discusses security. Security issues not covered in other
other parts of the draft include: parts of the draft include:
40-bit encryption is considered weak by most cryptographers. Using 40-bit encryption is considered weak by most cryptographers. Using weak
weak cryptography in S/MIME offers little actual security over sending cryptography in S/MIME offers little actual security over sending
plaintext. However, other features of S/MIME, such as the plaintext. However, other features of S/MIME, such as the specification of
specification of tripleDES and the ability to announce stronger tripleDES and the ability to announce stronger cryptographic capabilities
cryptographic capabilities to parties with whom you communicate, allow to parties with whom you communicate, allow senders to create messages that
senders to create messages that use strong encryption. Using weak use strong encryption. Using weak cryptography is never recommended unless
cryptography is never recommended unless the only alternative is no the only alternative is no cryptography. When feasible, sending and
cryptography. When feasible, sending and receiving agents should receiving agents should inform senders and recipients the relative
inform senders and recipients the relative cryptographic strength of cryptographic strength of messages.
messages.
It is impossible for most software or people to estimate the value of It is impossible for most software or people to estimate the value of a
a message. Further, it is impossible for most software or people to message. Further, it is impossible for most software or people to estimate
estimate the actual cost of decrypting a message that is encrypted the actual cost of decrypting a message that is encrypted with a key of a
with a key of a particular size. Further, it is quite difficult to particular size. Further, it is quite difficult to determine the cost of a
determine the cost of a failed decryption if a recipient cannot decode failed decryption if a recipient cannot decode a message. Thus, choosing
a message. Thus, choosing between different key sizes (or choosing between different key sizes (or choosing whether to just use plaintext) is
whether to just use plaintext) is also impossible. However, decisions also impossible. However, decisions based on these criteria are made all
based on these criteria are made all the time, and therefore this the time, and therefore this draft gives a framework for using those
draft gives a framework for using those estimates in choosing estimates in choosing algorithms.
algorithms.
If a sending agent is sending the same message using different If a sending agent is sending the same message using different strengths of
strengths of cryptography, an attacker watching the communications cryptography, an attacker watching the communications channel can determine
channel can determine the contents of the strongly-encrypted message the contents of the strongly-encrypted message by decrypting the
by decrypting the weakly-encrypted version. In other words, a sender weakly-encrypted version. In other words, a sender should not send a copy
should not send a copy of a message using weaker cryptography than of a message using weaker cryptography than they would use for the original
they would use for the original of the message. of the message.
A. Object Identifiers and Syntax A. Object Identifiers and Syntax
The syntax for SMIMECapability is: The syntax for SMIMECapability is:
SMIMECapability ::= SEQUENCE { SMIMECapability ::= SEQUENCE {
capabilityID OBJECT IDENTIFIER, capabilityID OBJECT IDENTIFIER,
parameters OPTIONAL ANY DEFINED BY capabilityID } parameters OPTIONAL ANY DEFINED BY capabilityID }
SMIMECapabilities ::= SEQUENCE OF SMIMECapability sMIMECapabilities ::= SEQUENCE OF SMIMECapability
A.1 Content Encryption Algorithms A.1 Content Encryption Algorithms
RC2-CBC OBJECT IDENTIFIER ::= RC2-CBC OBJECT IDENTIFIER ::=
{iso(1) member-body(2) us(840) rsadsi(113549) encryptionAlgorithm(3) 2} {iso(1) member-body(2) us(840) rsadsi(113549) encryptionAlgorithm(3) 2}
For the effective-key-bits (key size) other than 32 and less than For the effective-key-bits (key size) greater than 32 and less than
256, the RC2-CBC algorithm parameters are encoded as: 256, the RC2-CBC algorithm parameters are encoded as:
RC2-CBC parameter ::= SEQUENCE { RC2-CBC parameter ::= SEQUENCE {
rc2ParameterVersion INTEGER, rc2ParameterVersion INTEGER,
iv OCTET STRING (8)} iv OCTET STRING (8)}
For the effective-key-bits of 40, 64, and 128, the For the effective-key-bits of 40, 64, and 128, the
rc2ParameterVersion values are 160, 120, 58 respectively. rc2ParameterVersion values are 160, 120, 58 respectively.
DES-EDE3-CBC OBJECT IDENTIFIER ::= DES-EDE3-CBC OBJECT IDENTIFIER ::=
skipping to change at line 1127 skipping to change at line 1077
{iso(1) identified-organization(3) oiw(14) secsig(3) algorithm(2) 26} {iso(1) identified-organization(3) oiw(14) secsig(3) algorithm(2) 26}
A.3 Asymmetric Encryption Algorithms A.3 Asymmetric Encryption Algorithms
rsaEncryption OBJECT IDENTIFIER ::= rsaEncryption OBJECT IDENTIFIER ::=
{iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1} {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 1}
rsa OBJECT IDENTIFIER ::= rsa OBJECT IDENTIFIER ::=
{joint-iso-ccitt(2) ds(5) algorithm(8) encryptionAlgorithm(1) 1} {joint-iso-ccitt(2) ds(5) algorithm(8) encryptionAlgorithm(1) 1}
A.3 Signature Algorithms A.4 Signature Algorithms
md2WithRSAEncryption OBJECT IDENTIFIER ::= md2WithRSAEncryption OBJECT IDENTIFIER ::=
{iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 2} {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 2}
md5WithRSAEncryption OBJECT IDENTIFIER ::= md5WithRSAEncryption OBJECT IDENTIFIER ::=
{iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 4} {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 4}
sha-1WithRSAEncryption OBJECT IDENTIFIER ::= sha-1WithRSAEncryption OBJECT IDENTIFIER ::=
{iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 5} {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1) 5}
A.4 Signed Attributes A.5 Signed Attributes
signingTime OBJECT IDENTIFIER ::= signingTime OBJECT IDENTIFIER ::=
{iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 5} {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 5}
SMIMECapabilities OBJECT IDENTIFIER ::= sMIMECapabilities OBJECT IDENTIFIER ::=
{iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 15} {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 15}
B. References B. References
[3DES] W. Tuchman, "Hellman Presents No Shortcut Solutions To DES," [3DES] W. Tuchman, "Hellman Presents No Shortcut Solutions To DES," IEEE
IEEE Spectrum, v. 16, n. 7, July 1979, pp40-41. Spectrum, v. 16, n. 7, July 1979, pp40-41.
[APP-MIME] "Wrapping MIME Objects: Application/MIME", Internet Draft
draft-crocker-wrap-01.txt.
[CHARSETS] Character sets assigned by IANA. See [CHARSETS] Character sets assigned by IANA. See
<ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets>. <ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets>.
[CONTDISP] "Communicating Presentation Information in Internet [CONTDISP] "Communicating Presentation Information in Internet Messages:
Messages: The Content-Disposition Header Field", RFC 2183 The Content-Disposition Header Field", RFC 2183
[DES] ANSI X3.106, "American National Standard for Information [DES] ANSI X3.106, "American National Standard for Information Systems-Data
Systems-Data Link Encryption," American National Standards Institute, Link Encryption," American National Standards Institute, 1983.
1983.
[MD5] "The MD5 Message Digest Algorithm", RFC 1321 [MD5] "The MD5 Message Digest Algorithm", RFC 1321
[MIME-SPEC] The primary definition of MIME. "MIME Part 1: Format of [MIME-SPEC] The primary definition of MIME. "MIME Part 1: Format of
Internet Message Bodies", RFC 2045; "MIME Part 2: Media Types", RFC Internet Message Bodies", RFC 2045; "MIME Part 2: Media Types", RFC 2046;
2046; "MIME Part 3: Message Header Extensions for Non-ASCII Text", RFC "MIME Part 3: Message Header Extensions for Non-ASCII Text", RFC 2047;
2047; "MIME Part 4: Registration Procedures", RFC 2048; "MIME Part 5: "MIME Part 4: Registration Procedures", RFC 2048; "MIME Part 5: Conformance
Conformance Criteria and Examples", RFC 2049 Criteria and Examples", RFC 2049
[MIME-SECURE] "Security Multiparts for MIME: Multipart/Signed and [MIME-SECURE] "Security Multiparts for MIME: Multipart/Signed and
Multipart/Encrypted", RFC 1847 Multipart/Encrypted", RFC 1847
[MUSTSHOULD] "Key words for use in RFCs to Indicate Requirement [MUSTSHOULD] "Key words for use in RFCs to Indicate Requirement Levels",
Levels", RFC 2119 RFC 2119
[PKCS-1] "PKCS #1: RSA Encryption", Internet Draft [PKCS-1] "PKCS #1: RSA Encryption", Internet Draft
draft-hoffman-pkcs-rsa-encrypt draft-hoffman-pkcs-rsa-encrypt
[PKCS-7] "PKCS #7: Cryptographic Message Syntax", Internet Draft [PKCS-7] "PKCS #7: Cryptographic Message Syntax", Internet Draft
draft-hoffman-pkcs-crypt-msg draft-hoffman-pkcs-crypt-msg
[PKCS-10] "PKCS #10: Certification Request Syntax", Internet Draft [PKCS-10] "PKCS #10: Certification Request Syntax", Internet Draft
draft-hoffman-pkcs-certif-req draft-hoffman-pkcs-certif-req
[RC2] "Description of the RC2 Encryption Algorithm", Internet Draft [RC2] "Description of the RC2 Encryption Algorithm", Internet Draft
draft-rivest-rc2desc draft-rivest-rc2desc
[SHA1] NIST FIPS PUB 180-1, "Secure Hash Standard," National Institute [SHA1] NIST FIPS PUB 180-1, "Secure Hash Standard," National Institute of
of Standards and Technology, U.S. Department of Commerce, DRAFT, 31 Standards and Technology, U.S. Department of Commerce, DRAFT, 31 May 1994.
May 1994.
C. Compatibility with Prior Practice in S/MIME C. Compatibility with Prior Practice in S/MIME
S/MIME was originally developed by RSA Data Security, Inc. Many S/MIME was originally developed by RSA Data Security, Inc. Many developers
developers implemented S/MIME agents before this document was implemented S/MIME agents before this document was published. All S/MIME
published. All S/MIME receiving agents SHOULD make every attempt to receiving agents SHOULD make every attempt to interoperate with these
interoperate with these earlier implementations of S/MIME. earlier implementations of S/MIME.
C.1 Early MIME Types C.1 Early MIME Types
Some early implementations of S/MIME agents used the following MIME Some early implementations of S/MIME agents used the following MIME types:
types:
application/x-pkcs7-mime application/x-pkcs7-mime
application/x-pkcs7-signature application/x-pkcs7-signature
application/x-pkcs10 application/x-pkcs10
In each case, the "x-" subtypes correspond to the subtypes described In each case, the "x-" subtypes correspond to the subtypes described in
in this document without the "x-". this document without the "x-".
C.2 Profiles C.2 Profiles
Early S/MIME documentation had two profiles for encryption: Early S/MIME documentation had two profiles for encryption: "restricted"
"restricted" and "unrestricted". The difference between these profiles and "unrestricted". The difference between these profiles historically came
historically came about due to US Government export regulations, as about due to US Government export regulations, as described at the end of
described at the end of this section. It is expected that in the this section. It is expected that in the future, there will be few agents
future, there will be few agents that only use the restricted profile. that only use the restricted profile.
Briefly, the restricted profile required the ability to encrypt and Briefly, the restricted profile required the ability to encrypt and decrypt
decrypt using RSA's trade-secret RC2 algorithm in CBC mode with 40-bit using RSA's trade-secret RC2 algorithm in CBC mode with 40-bit keys. The
keys. The unrestricted profile required the ability to encrypt and unrestricted profile required the ability to encrypt and decrypt using
decrypt using RSA's trade-secret RC2 algorithm in CBC mode with 40-bit RSA's trade-secret RC2 algorithm in CBC mode with 40-bit keys, and to
keys, and to encrypt and decrypt using tripleDES. The restricted encrypt and decrypt using tripleDES. The restricted profile also had
profile also had non-mandatory suggestions for other algorithms, but non-mandatory suggestions for other algorithms, but these were not widely
these were not widely implemented. implemented.
It is important to note that many current implementations of S/MIME It is important to note that many current implementations of S/MIME use the
use the restricted profile. restricted profile.
C.2.1 Historical Reasons for the Existence of Two Encryption Profiles C.2.1 Historical Reasons for the Existence of Two Encryption Profiles
Due to US Government export regulations, an S/MIME agent which Due to US Government export regulations, an S/MIME agent which supports a
supports a strong content encryption algorithm such as DES would not strong content encryption algorithm such as DES would not be freely
be freely exportable outside of North America. US software exportable outside of North America. US software manufacturers have been
manufacturers have been compelled to incorporate an exportable or compelled to incorporate an exportable or "restricted" content encryption
"restricted" content encryption algorithm in order to create a widely algorithm in order to create a widely exportable version of their product.
exportable version of their product. S/MIME agents created in the US S/MIME agents created in the US and intended for US domestic use (or use
and intended for US domestic use (or use under special State under special State Department export licenses) can utilize stronger,
Department export licenses) can utilize stronger, "unrestricted" "unrestricted" content encryption. However, in order to achieve
content encryption. However, in order to achieve interoperability, interoperability, such agents need to support whatever exportable algorithm
such agents need to support whatever exportable algorithm is is incorporated in restricted S/MIME agents.
incorporated in restricted S/MIME agents.
The RC2 symmetric encryption algorithm has been approved by the US The RC2 symmetric encryption algorithm has been approved by the US
Government for "expedited" export licensing at certain key sizes. Government for "expedited" export licensing at certain key sizes.
Consequently, support for the RC2 algorithm in CBC mode is required Consequently, support for the RC2 algorithm in CBC mode is required for
for baseline interoperability in all S/MIME implementations. Support baseline interoperability in all S/MIME implementations. Support for other
for other strong symmetric encryption algorithms such as RC5 CBC, DES strong symmetric encryption algorithms such as RC5 CBC, DES CBC and DES
CBC and DES EDE3-CBC for content encryption is strongly encouraged EDE3-CBC for content encryption is strongly encouraged where possible.
where possible.
D. Revision History D. Revision History
The following changes were made between the -04 and -05 revisions of The following changes were made between the -05 and -06 revisions of this
this draft: draft:
Fixed errors in the MIME examples in 3.1.4, 3.4.3.3, and F.2 where the Removed discussion of "application/mime" wrapping because no one has
base64 text didn't have a blank line before the separator. implemented it and because the specification for application/mime is in
flux. This entailed removing section 3.4.3.4, a bit of the table near the
end of section 3.8, and text throughout appendix F.
In 3.1.1, changed "character set" to "charset" and added a reference to Changed the case of SMIMECapabilities to sMIMECapabilities everywhere.
the list of registered charsets.
Changed the references for ASN.1, BER, and DER back to their 1988
documents.
Fixed error in the MIME examples in 3.1.4 (left off the C-T-E).
Removed antique text from first paragraph 3.5.
Fixed section numbering in Appendix A.
In A.1, changed "other than 32" to "greater than 32".
Removed "smime-type" from E.2 and E.3, where they appeared by mistake.
E. Request for New MIME Subtypes E. Request for New MIME Subtypes
E.1 application/pkcs7-mime E.1 application/pkcs7-mime
To: ietf-types@iana.org To: ietf-types@iana.org
Subject: Registration of MIME media type application/pkcs7-mime Subject: Registration of MIME media type application/pkcs7-mime
MIME media type name: application MIME media type name: application
skipping to change at line 1313 skipping to change at line 1269
To: ietf-types@iana.org To: ietf-types@iana.org
Subject: Registration of MIME media type application/pkcs7-signature Subject: Registration of MIME media type application/pkcs7-signature
MIME media type name: application MIME media type name: application
MIME subtype name: pkcs7-signature MIME subtype name: pkcs7-signature
Required parameters: none Required parameters: none
Optional parameters: name, filename, smime-type Optional parameters: name, filename
Encoding considerations: Will be binary data, therefore should use Encoding considerations: Will be binary data, therefore should use
base64 encoding base64 encoding
Security considerations: Described in [PKCS-7] Security considerations: Described in [PKCS-7]
Interoperability considerations: Designed to carry digital Interoperability considerations: Designed to carry digital
signatures with PKCS-7, as described in [PKCS-7] signatures with PKCS-7, as described in [PKCS-7]
Published specification: draft-dusse-smime-msg-xx Published specification: draft-dusse-smime-msg-xx
skipping to change at line 1348 skipping to change at line 1304
To: ietf-types@iana.org To: ietf-types@iana.org
Subject: Registration of MIME media type application/pkcs10 Subject: Registration of MIME media type application/pkcs10
MIME media type name: application MIME media type name: application
MIME subtype name: pkcs10 MIME subtype name: pkcs10
Required parameters: none Required parameters: none
Optional parameters: name, filename, smime-type Optional parameters: name, filename
Encoding considerations: Will be binary data, therefore should use Encoding considerations: Will be binary data, therefore should use
base64 encoding base64 encoding
Security considerations: Described in [PKCS-10] Security considerations: Described in [PKCS-10]
Interoperability considerations: Designed to carry digital Interoperability considerations: Designed to carry digital
certificates formatted with PKCS-10, as described in [PKCS-10] certificates formatted with PKCS-10, as described in [PKCS-10]
Published specification: draft-dusse-smime-msg-xx Published specification: draft-dusse-smime-msg-xx
skipping to change at line 1374 skipping to change at line 1330
File extension(s): .p10 File extension(s): .p10
Macintosh File Type Code(s): Macintosh File Type Code(s):
Person & email address to contact for further information: Person & email address to contact for further information:
Steve Dusse, spock@rsa.com Steve Dusse, spock@rsa.com
Intended usage: COMMON Intended usage: COMMON
F. Encapsulating Signed Messages for Internet Transport F. Encapsulating Signed Messages for Internet Transport
The rationale behind the multiple formats for signing has to do with The rationale behind the multiple formats for signing has to do with the
the MIME subtype defaulting rules of the application and multipart MIME subtype defaulting rules of the application and multipart top-level
top-level types, and the behavior of currently deployed gateways and types, and the behavior of currently deployed gateways and mail user
mail user agents. agents.
Ideally, the multipart/signed format would be the only format used Ideally, the multipart/signed format would be the only format used because
because it provides a truly backwards compatible way to sign MIME it provides a truly backwards compatible way to sign MIME entities. In a
entities. In a pure MIME environment with very capable user agents, pure MIME environment with very capable user agents, this would be
this would be possible. The world, however, is more complex than this. possible. The world, however, is more complex than this.
One problem with the multipart/signed format occurs with gateways to One problem with the multipart/signed format occurs with gateways to
non-MIME environments. In these environments, the gateway will non-MIME environments. In these environments, the gateway will generally
generally not be S/MIME aware, will not recognize the multipart/signed not be S/MIME aware, will not recognize the multipart/signed type, and will
type, and will default its treatment to multipart/mixed as is default its treatment to multipart/mixed as is prescribed by the MIME
prescribed by the MIME standard. The real problem occurs when the standard. The real problem occurs when the gateway also applies conversions
gateway also applies conversions to the MIME structure of the original to the MIME structure of the original message that is being signed and is
message that is being signed and is contained in the first part of the contained in the first part of the multipart/signed structure, such as the
multipart/signed structure, such as the gateway converting text and gateway converting text and attachments to the local format. Because the
attachments to the local format. Because the signature is over the signature is over the MIME structure of the original message, but the
MIME structure of the original message, but the original message is original message is now decomposed and transformed, the signature cannot be
now decomposed and transformed, the signature cannot be verified. verified. Because MIME encoding of a particular set of body parts can be
Because MIME encoding of a particular set of body parts can be done in done in many different ways, there is no way to reconstruct the original
many different ways, there is no way to reconstruct the original MIME MIME entity over which the signature was computed.
entity over which the signature was computed.
A similar problem occurs when an attempt is made to combine an A similar problem occurs when an attempt is made to combine an existing
existing user agent with a stand-alone S/MIME facility. Typical user user agent with a stand-alone S/MIME facility. Typical user agents do not
agents do not have the ability to make a multipart sub-entity have the ability to make a multipart sub-entity available to a stand-alone
available to a stand-alone application in the same way they make leaf application in the same way they make leaf MIME entities available to
MIME entities available to "viewer" applications. This user agent "viewer" applications. This user agent behavior is not required by the MIME
behavior is not required by the MIME standard and thus not widely standard and thus not widely implemented. The result is that it is
implemented. The result is that it is impossible for most user agents impossible for most user agents to hand off the entire multipart/signed
to hand off the entire multipart/signed entity to a stand-alone entity to a stand-alone application.
application.
F.1 Solutions to the Problem F.1 Solutions to the Problem
To work around these two problems, the application/pkcs7-mime type can To work around these two problems, the application/pkcs7-mime type can be
be used. When going through a gateway, it will be defaulted to the used. When going through a gateway, it will be defaulted to the MIME type
MIME type of application/octet-stream and treated as a single opaque of application/octet-stream and treated as a single opaque entity. That is,
entity. That is, the message will be treated as an attachment of the message will be treated as an attachment of unknown type, converted
unknown type, converted into the local representation for an into the local representation for an attachment and thus can be made
attachment and thus can be made available to an S/MIME facility available to an S/MIME facility completely intact. A similar result is
completely intact. A similar result is achieved when a user agent achieved when a user agent similarly treats the application/pkcs7-mime MIME
similarly treats the application/pkcs7-mime MIME entity as a simple entity as a simple leaf node of the MIME structure and makes it available
leaf node of the MIME structure and makes it available to viewer to viewer applications.
applications.
Another way to work around these problems is to encapsulate the Another way to work around these problems is to encapsulate the
multipart/signed MIME entity in a MIME entity of type multipart/signed MIME entity in a MIME entity that will not be damaged by
application/mime. The result is similar to that obtained using the gateway. At the time that this draft is being written, there is a
application/pkcs7-mime. When the application/mime entity arrives at a proposal for a MIME entity "application/mime" for this purpose. However, no
gateway that does not recognize it, its type will be defaulted to implementations of S/MIME use this type of wrapping.
application/octet-stream and it will be treated as a single opaque
entity. A similar situation will happen with a receiving client that
does not recognize the entity. It will usually be treated as a file
attachment. It can then be made available to the S/MIME facility.
The major difference between the two alternatives
(application/pkcs7-mime or multipart/signed wrapped with
application/mime ) is when the S/MIME facility opens the attachment.
In the latter case, the S/MIME agent will find a multipart/signed
entity rather than a BER encoded PKCS7-object. Considering the two
representations abstractly, the only difference is syntax.
Application/mime is a general mechanism for encapsulating MIME, and in
particular delaying its interpretation until it can be done in the
appropriate environment or at the request of the user. The
application/mime specification does not permit a user agent to
automatically interpret the encapsulated MIME unless it can be
processed entirely and properly. The parameters to the
application/mime entity give the type of the encapsulated entity so it
can be determined whether or not the entity can be processed before it
is expanded.
Application/mime is a general encapsulation mechanism that can be
built into a gateway or user agent, allowing expansion of the
encapsulated entity under user control. Because it is a general
mechanism, it is in many cases more likely to be available than an
S/MIME facility. Thus, it enables users to expand or to verify signed
messages based on their local facilities and choices. It provides
exactly the same advantages that the application/pkcs7-mime with
signedData does. It also has the added benefit of allowing expansion
in non-S/MIME environments and expansion under the recipient's
control.
F.2 Encapsulation Using application/mime
In some cases, multipart/signed entities are automatically decomposed
in such a way as to make computing the hash of the first part, the
signed part, impossible; in such a situation, the signature becomes
unverifiable. In order to prevent such decomposition until the MIME
entity can be processed in a proper S/MIME environment, a
multipart/signed entity may be encapsulated in an application/mime
entity.
All S/MIME implementations SHOULD be able to generate and receive
application/mime encapsulations of multipart/signed entities which
have their signature of type application/pkcs7-mime. In particular, on
receipt of a MIME entity of type application/mime with the type
parameter "multipart/signed" and the protocol parameter
"application/pkcs7-mime", a receiving agent SHOULD be able to process
the entity correctly. This is required even if the local environment
has facilities for processing application/mime because
application/mime requires that the encapsulated entity only be
processed on request of the user, or if processing software can
process the entity completely and correctly. In this case, an S/MIME
facility can always process the entity completely and SHOULD do so.
The steps to create an application/mime encapsulation of a
multipart/signed entity are:
Step 1. Prepare a multipart/signed message as described in
section 3.4.3.2
Step 2. Insert the multipart/signed entity into an application/mime
according to [APP-MIME]. This requires that the parameters
of the multipart/signed entity be included as parameters
on the application/mime entity.
Note that messages using application/mime are subject to the same
encoding rules as message/* and multipart/* types. The encoding of the
application/mime part MUST NOT be binary.
In addition, the application/mime entity SHOULD have a name parameter
giving a file name ending with ".aps". It SHOULD also have a
content-disposition parameter with the same filename. The ".aps"
extension SHOULD be used exclusively for application/mime encapsulated
multipart/signed entities containing a signature of type
application/pkcs7-signature. This is necessary so that the receiving
agent can correctly dispatch to software that verifies S/MIME
signatures in environments where the MIME type and parameters have
been lost or can't be used for such dispatch. Basically, the file
extension becomes the sole carrier of type information.
A sample application/mime encapsulation of a signed message might be:
Content-type: application/mime; content-type="multipart/signed";
protocol="application/pkcs7-signature";
micalg=sha1; name=smime.aps
Content-disposition: attachment; filename=smime.aps
Content-Type: multipart/signed;
protocol="application/pkcs7-signature";
micalg=sha1; boundary=boundary42
--boundary42
Content-Type: text/plain
This is a very short clear-signed message. However, at least you
can read it!
--boundary42
Content-Type: application/pkcs7-signature; name=smime.p7s
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7s
ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6
4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj
n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4
7GhIGfHfYT64VQbnj756
--boundary42--
F.3 Encapsulation in an Non-MIME Environment F.2 Encapsulation in an Non-MIME Environment
While this document primarily addresses the Internet, it is useful to While this document primarily addresses the Internet, it is useful to
compose and receive S/MIME secured messages in non-MIME environments. compose and receive S/MIME secured messages in non-MIME environments. This
This is particularly the case when it is desired that security be is particularly the case when it is desired that security be implemented
implemented end-to-end. Other discussion here addresses the receipt of end-to-end. Other discussion here addresses the receipt of S/MIME messages
S/MIME messages in non-MIME environments. Here the composition of in non-MIME environments. Here the composition of multipart/signed entities
multipart/signed entities is addressed. is addressed.
When a message is to be sent in such an environment, the When a message is to be sent in such an environment, the multipart/signed
multipart/signed entity is created as described above. That entity is entity is created as described above. That entity is then treated as an
then treated as an opaque stream of bits and added to the message as opaque stream of bits and added to the message as an attachment. It must
an attachment. It must have a file name that ends with ".aps", as this have a file name that ends with ".aps", as this is the sole mechanism for
is the sole mechanism for recognizing it as an S/MIME message by the recognizing it as an S/MIME message by the receiving agent.
receiving agent.
When this message arrives in a MIME environment, it is likely to have When this message arrives in a MIME environment, it is likely to have a
a MIME type of application/octet-stream, with MIME parameters giving MIME type of application/octet-stream, with MIME parameters giving the
the filename for the attachment. If the intervening gateway has filename for the attachment. If the intervening gateway has carried the
carried the file type, it will end in ".aps" and be recognized as an file type, it will end in ".aps" and be recognized as an S/MIME message.
S/MIME message.
G. Acknowledgements G. Acknowledgements
Significant contributions to the content of this draft were made by Significant contributions to the content of this draft were made by many
many people, including Jeff Thompson and Jeff Weinstein. people, including Jeff Thompson and Jeff Weinstein.
H. Authors' addresses H. Authors' addresses
Steve Dusse Steve Dusse
RSA Data Security, Inc. RSA Data Security, Inc.
100 Marine Parkway, #500 100 Marine Parkway, #500
Redwood City, CA 94065 USA Redwood City, CA 94065 USA
(415) 595-8782 (415) 595-8782
spock@rsa.com spock@rsa.com
 End of changes. 158 change blocks. 
802 lines changed or deleted 643 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/