RFC 2633

S/MIME Version 3 Message Specification

๐Ÿ“… published June 1999, from ietf

1. Introduction โœจ

RFC 2633: S/MIME Version 3 Message Specification ๐ŸŽ€

Author: B. Ramsdell (Editor), Worldtalk ๐Ÿ’– Category: Standards Track ๐Ÿ”ฅ Date: June 1999 ๐Ÿ“… Obsoletes / Updates: this title block doesn't list anything it obsoletes or updates ๐Ÿฆ‹

Status of this Memo โœจ

okay so this section is the official bit: this document specifies an Internet standards track protocol for the Internet community, and it's asking for discussion and suggestions for improvements ๐Ÿ’…. For the standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1) ๐Ÿ“š. Distribution of this memo is unlimited ๐ŸŒธ.

Copyright (C) The Internet Society (1999). All Rights Reserved. ๐Ÿ’œ

1. Introduction โœจ

okay so S/MIME (Secure/Multipurpose Internet Mail Extensions) is basically how you get a consistent way to send and receive secure MIME data ๐ŸŽ€. It's built on the popular Internet MIME standard, and it gives electronic messaging apps these cryptographic security services: authentication, message integrity and non-repudiation of origin (using digital signatures), plus privacy and data security (using encryption) ๐Ÿ”.

S/MIME can be used by traditional mail user agents (MUAs) to add cryptographic security services to mail that gets sent, and to interpret those services in mail that gets received ๐Ÿ’Œ. but it's not just for mail, bestie!! It works with any transport mechanism that carries MIME data, like HTTP ๐ŸŒˆ. So it takes advantage of MIME's object-based features and lets secure messages move around in mixed-transport systems, which is giving main character energy ๐Ÿ‘‘.

It can also live inside automated message transfer agents that use cryptographic security services without any human intervention ๐Ÿค–. Think signing software-generated documents, or encrypting FAX messages sent over the Internet ๐Ÿ“ . iconic.

1.1 Specification Overview

This document describes a protocol for adding cryptographic signature and encryption services to MIME data ๐Ÿฆ‹. The MIME standard [MIME-SPEC] gives a general structure for the content type of Internet messages, and it allows extensions for new content type applications ๐Ÿงš.

This memo defines how to create a MIME body part that has been cryptographically enhanced according to CMS [CMS], which is derived from PKCS #7 [PKCS-7] ๐Ÿ’…. It also defines the application/pkcs7-mime MIME type, which can be used to transport those body parts ๐ŸŽ.

This memo also discusses how to use the multipart/signed MIME type defined in [MIME-SECURE] to transport S/MIME signed messages โœจ. It also defines the application/pkcs7-signature MIME type, which is also used to transport S/MIME signed messages ๐Ÿ’–.

In order to create S/MIME messages, an S/MIME agent has to follow the specifications in this memo, as well as the specifications listed in the Cryptographic Message Syntax [CMS] ๐Ÿ“–.

Throughout this memo there are requirements and recommendations for how receiving agents handle incoming messages ๐Ÿ“ฅ. There are separate requirements and recommendations for how sending agents create outgoing messages ๐Ÿ“ค. In general, the best strategy is to "be liberal in what you receive and conservative in what you send" ๐Ÿซถ. Most of the requirements land on the handling of incoming messages, while the recommendations are mostly about creating outgoing messages ๐Ÿ’….

The split between receiving agents and sending agents also comes from the fact that there will likely be S/MIME systems running on software other than traditional Internet mail clients ๐Ÿค–. S/MIME can be used with any system that transports MIME data. An automated process that sends an encrypted message might not be able to receive an encrypted message at all, for example ๐Ÿ™ˆ. So the requirements and recommendations for the two types of agents are listed separately when that's appropriate ๐ŸŒธ.

1.2 Terminology

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [MUSTSHOULD] ๐Ÿ“.

1.3 Definitions

For the purposes of this memo, the following definitions apply ๐ŸŽ€.

ASN.1: Abstract Syntax Notation One, as defined in CCITT X.208 ๐Ÿง .

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 public key with a digital signature ๐Ÿ”‘.

DER: Distinguished Encoding Rules for ASN.1, as defined in CCITT X.509 ๐Ÿง .

7-bit data: Text data with lines less than 998 characters long, where none of the characters have the 8th bit set, and there are no NULL characters. <CR> and <LF> occur only as part of a <CR><LF> end of line delimiter ๐Ÿ’….

8-bit data: Text data with lines less than 998 characters, and where none of the characters are NULL characters. <CR> and <LF> occur only as part of a <CR><LF> end of line delimiter โœจ.

Binary data: Arbitrary data ๐ŸŒˆ.

Transfer Encoding: A reversible transformation made on data so 8-bit or binary data may be sent via a channel that only transmits 7-bit data ๐Ÿ”.

Receiving agent: Software that interprets and processes S/MIME CMS objects, MIME body parts that contain CMS objects, or both ๐Ÿ“ฅ.

Sending agent: Software that creates S/MIME CMS objects, MIME body parts that contain CMS objects, or both ๐Ÿ“ค.

S/MIME agent: User software that is a receiving agent, a sending agent, or both ๐Ÿ’–.

1.4 Compatibility with Prior Practice of S/MIME

S/MIME version 3 agents should attempt to have the greatest interoperability possible with S/MIME version 2 agents ๐Ÿซถ. S/MIME version 2 is described in RFC 2311 through RFC 2315, inclusive. RFC 2311 also has historical information about the development of S/MIME ๐Ÿ“œ.

2. CMS Options ๐ŸŽ€

CMS allows for a wide variety of options in content and algorithm support ๐ŸŒˆ. This section puts forth a number of support requirements and recommendations to reach a base level of interoperability among all S/MIME implementations ๐Ÿค. [CMS] provides additional details about using the cryptographic algorithms ๐Ÿ”.

2.1 DigestAlgorithmIdentifier

Sending and receiving agents MUST support SHA-1 [SHA1]. Receiving agents SHOULD support MD5 [MD5] for backward compatibility with MD5-digested S/MIME v2 SignedData objects ๐Ÿ”™.

2.2 SignatureAlgorithmIdentifier

Sending and receiving agents MUST support id-dsa defined in [DSS]. The algorithm parameters MUST be absent (not encoded as NULL) โœ๏ธ.

Receiving agents SHOULD support rsaEncryption, defined in [PKCS-1] ๐Ÿ’….

Sending agents SHOULD support rsaEncryption. Outgoing messages are signed with a user's private key. The size of the private key is determined during key generation ๐Ÿ”‘.

Note that S/MIME v2 clients are only capable of verifying digital signatures using the rsaEncryption algorithm ๐Ÿ™ˆ.

2.3 KeyEncryptionAlgorithmIdentifier

Sending and receiving agents MUST support Diffie-Hellman defined in [DH] ๐ŸŒธ.

Receiving agents SHOULD support rsaEncryption. Incoming encrypted messages contain symmetric keys, which are decrypted with a user's private key. The size of the private key is determined during key generation ๐Ÿ—๏ธ.

Sending agents SHOULD support rsaEncryption ๐Ÿ’–.

Note that S/MIME v2 clients are only capable of decrypting content encryption keys using the rsaEncryption algorithm ๐Ÿ™ˆ.

2.4 General Syntax

CMS defines multiple content types. Of these, only the Data, SignedData, and EnvelopedData content types are currently used for S/MIME ๐Ÿ“ฆ.

2.4.1 Data Content Type

Sending agents MUST use the id-data content type identifier to indicate the message content that has had security services applied to it ๐ŸŽฏ. For example, when applying a digital signature to MIME data, the CMS signedData encapContentInfo eContentType MUST include the id-data object identifier, and the MIME content MUST be stored in the SignedData encapContentInfo eContent OCTET STRING (unless the sending agent is using multipart/signed, in which case the eContent is absent, per section 3.4.3 of this document) โœ๏ธ. As another example, when applying encryption to MIME data, the CMS EnvelopedData encryptedContentInfo ContentType MUST include the id-data object identifier, and the encrypted MIME content MUST be stored in the envelopedData encryptedContentInfo encryptedContent OCTET STRING ๐Ÿ”.

2.4.2 SignedData Content Type

Sending agents MUST use the signedData content type to apply a digital signature to a message or, in a degenerate case where there is no signature information, to convey certificates ๐Ÿ“œ.

2.4.3 EnvelopedData Content Type

This content type is used to apply privacy protection to a message ๐Ÿคซ. A sender needs access to a public key for each intended message recipient to use this service ๐Ÿ—๏ธ. This content type does not provide authentication โš ๏ธ.

2.5 Attribute SignerInfo Type

The SignerInfo type allows unsigned and signed attributes to be included along with a signature โœจ.

Receiving agents MUST be able to handle zero or one instance of each of the signed attributes listed here. Sending agents SHOULD generate one instance of each of the following signed attributes in each S/MIME message ๐Ÿ’…:

  • signingTime (section 2.5.1 in this document)
  • sMIMECapabilities (section 2.5.2 in this document)
  • sMIMEEncryptionKeyPreference (section 2.5.3 in this document)

Further, receiving agents SHOULD be able to handle zero or one instance in the signed attributes of the signingCertificate attribute (section 5 in [ESS]) ๐ŸŽ€.

Sending agents SHOULD generate one instance of the signingCertificate signed attribute in each S/MIME message ๐Ÿ’–.

Additional attributes and values for these attributes may be defined in the future. Receiving agents SHOULD handle attributes or values that they do not recognize in a graceful manner ๐Ÿซถ.

Sending agents that include signed attributes that are not listed here SHOULD display those attributes to the user, so that the user is aware of all of the data being signed ๐Ÿ‘€.

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 was signed โฐ. Until there are trusted timestamping services, the time of signing will most likely be created by a message originator, and therefore is only as trustworthy as the originator ๐Ÿค”.

Sending agents MUST encode signing time through the year 2049 as UTCTime. Signing times in 2050 or later MUST be encoded as GeneralizedTime ๐Ÿ•ฐ๏ธ. When the UTCTime CHOICE is used, S/MIME agents MUST interpret the year field (YY) as follows: if YY is greater than or equal to 50, the year is interpreted as 19YY; if YY is less than 50, the year is interpreted as 20YY ๐Ÿงฎ.

(part 1 of 6, more coming bestie ๐Ÿ‘€)

2.5.2 SMIMECapabilities Attribute โœจ

Okay so the SMIMECapabilities attribute is basically a little menu of what you can do ๐Ÿ’– It lists signature algorithms (like sha1WithRSAEncryption), symmetric algorithms (like DES-EDE3-CBC), and key encipherment algorithms (like rsaEncryption). It also has one non-algorithm capability, which is your preference for signedData ๐ŸŽ€. It was built to be super flexible and extensible, so later on we can add other stuff, like certificates, without making current clients break ๐Ÿฆ‹

If it's there, the SMIMECapabilities attribute MUST be a SignedAttribute ๐Ÿ”’, and it MUST NOT be an UnsignedAttribute. CMS defines SignedAttributes as a SET OF Attribute. The SignedAttributes in a signerInfo MUST NOT include multiple instances of the SMIMECapabilities attribute. CMS defines the ASN.1 syntax for Attribute to include attrValues SET OF AttributeValue. A SMIMECapabilities attribute MUST only include a single instance of AttributeValue. There MUST NOT be zero or multiple instances of AttributeValue present in the attrValues SET OF AttributeValue.

The SMIMECapabilities list is a partial list of what the client announcing it can support, so it doesn't have to list every single thing it can do ๐Ÿ“ Honestly, it probably shouldn't list everything, or the list gets way too long. The OIDs are listed in order of preference, but they SHOULD be logically separated by category (signature algorithms, symmetric algorithms, key encipherment algorithms, and so on) ๐Ÿงš

The structure is built for simple table lookups and binary comparisons so matching is easy. For example, the DER-encoding for the SMIMECapability for DES EDE3 CBC MUST be identically encoded no matter which implementation makes it ๐Ÿ’…

For symmetric algorithms, the parameters tied to the OID MUST specify all of the parameters needed to tell two instances of the same algorithm apart. For instance, the number of rounds and block size for RC5 must be specified in addition to the key length ๐ŸŒˆ

There's a centrally maintained list of OIDs (OIDs Used with S/MIME), separate from this memo. The Internet Mail Consortium maintains it at http://www.imc.org/ietf-smime/oids.html. Note that all OIDs associated with the MUST and SHOULD implement algorithms are included in section A of this document ๐Ÿ“š

The OIDs for algorithms SHOULD use the same OID as the actual algorithm, except when the usage is ambiguous from the OID. For example, in an earlier draft, rsaEncryption was ambiguous because it could mean a signature algorithm or a key encipherment algorithm ๐Ÿ™ˆ If an OID is ambiguous, the maintainer of the registered SMIMECapabilities list has to arbitrate which type of algorithm gets the OID, and a new OID MUST be allocated under the smimeCapabilities OID so the other use is covered too โœจ

The registered SMIMECapabilities list gives the parameters for OIDs that need them, mostly key lengths for variable-length symmetric ciphers ๐Ÿ”‘ If there are no differentiating parameters for an OID, the parameters MUST be omitted, and MUST NOT be encoded as NULL ๐Ÿ’€

More values for the SMIMECapabilities attribute may be defined in the future. Receiving agents MUST handle a SMIMECapabilities object that has values they don't recognize in a graceful manner ๐Ÿซถ

2.5.3 Encryption Key Preference Attribute ๐Ÿ’œ

The encryption key preference attribute lets the signer clearly say which of their certificates holds their preferred encryption key ๐ŸŽฏ It's built to help with clients that use separate keys for encryption and signing. Anyone reading it can tell which listed certificate should be used to encrypt a session key for future encrypted messages ๐Ÿ”

If it's there, the SMIMEEncryptionKeyPreference attribute MUST be a SignedAttribute, and it MUST NOT be an UnsignedAttribute ๐Ÿ”’ CMS defines SignedAttributes as a SET OF Attribute. The SignedAttributes in a signerInfo MUST NOT include multiple instances of the SMIMEEncryptionKeyPreference attribute. CMS defines the ASN.1 syntax for Attribute to include attrValues SET OF AttributeValue. A SMIMEEncryptionKeyPreference attribute MUST only include a single instance of AttributeValue. There MUST NOT be zero or multiple instances of AttributeValue present in the attrValues SET OF AttributeValue.

The sending agent SHOULD include the referenced certificate in the set of certificates included in the signed message if this attribute is used ๐Ÿ“จ The certificate can be left out if the receiving agent already got it earlier. Sending agents SHOULD use this attribute if the commonly used or preferred encryption certificate is not the same as the one used to sign the message ๐Ÿฆ‹

Receiving agents SHOULD store the preference data if the signature on the message is valid and the signing time is greater than the currently stored value ๐Ÿ—‚๏ธ (Same as with SMIMECapabilities, the clock skew should be checked, and the data not used if the skew is too great โฐ) Receiving agents SHOULD respect the sender's encryption key preference attribute if they can ๐Ÿ™Œ This is only a preference, though, so the receiving agent may use any certificate that is valid when replying to the sender ๐ŸŒธ

2.5.3.1 Selection of Recipient Key Management Certificate ๐Ÿ—๏ธ

To figure out which key management certificate to use when sending a future CMS envelopedData message to a particular recipient, the following steps SHOULD be followed:

  • If an SMIMEEncryptionKeyPreference attribute is found in a signedData object received from the desired recipient, that identifies the X.509 certificate to use as the recipient's X.509 key management certificate ๐Ÿ‘‘
  • If an SMIMEEncryptionKeyPreference attribute is not found in a signedData object received from the desired recipient, the set of X.509 certificates should be searched for an X.509 certificate with the same subject name as the signing X.509 certificate that can be used for key management ๐Ÿ”
  • Or use some other method to find the user's key management key. If no X.509 key management certificate is found, then encryption can't be done with the signer of the message ๐Ÿ’€ If multiple X.509 key management certificates are found, the S/MIME agent can make an arbitrary choice between them ๐ŸŽฒ

2.6 SignerIdentifier SignerInfo Type ๐Ÿงฉ

S/MIME v3 requires SignerInfo version 1, which means the issuerAndSerialNumber CHOICE MUST be used for SignerIdentifier ๐Ÿ“‹

2.7 ContentEncryptionAlgorithmIdentifier ๐Ÿ”

Sending and receiving agents MUST support encryption and decryption with DES EDE3 CBC, which we'll call tripleDES [3DES] [DES] ๐Ÿ’ช Receiving agents SHOULD support encryption and decryption using RC2 [RC2] or a compatible algorithm at a 40-bit key size, which we'll call RC2/40 ๐ŸŒธ

2.7.1 Deciding Which Encryption Method To Use ๐Ÿค”

When a sending agent creates an encrypted message, it has to decide which type of encryption to use. That decision uses info from the capabilities lists in messages it got from the recipient, plus out-of-band stuff like private agreements, user preferences, legal restrictions, and so on ๐Ÿง 

Section 2.5 describes how a sending agent can optionally announce its decrypting capabilities in order of preference. The following method for processing and remembering the encryption capabilities attribute in incoming signed messages SHOULD be used:

  • If the receiving agent hasn't made a capabilities list for the sender's public key yet, then, after verifying the signature on the incoming message and checking the timestamp, the receiving agent SHOULD create a new list with at least the signing time and the symmetric capabilities ๐Ÿ“
  • If a list already exists, the receiving agent SHOULD verify that the signing time in the incoming message is greater than the signing time stored in the list, and that the signature is valid. If so, the receiving agent SHOULD update both the signing time and the capabilities in the list. Signing time values far in the future (a bigger gap than any reasonable clock skew), or a capabilities list from messages whose signature couldn't be verified, MUST NOT be accepted ๐Ÿšซ

The list of capabilities SHOULD be stored for future use when creating messages ๐Ÿ’พ

Before sending a message, the sending agent MUST decide whether it is willing to use weak encryption for the particular data in the message ๐Ÿคจ If the sending agent decides weak encryption is unacceptable for this data, then the sending agent MUST NOT use a weak algorithm such as RC2/40 ๐Ÿ™…โ€โ™€๏ธ That decision overrides any other decision in this section about which encryption algorithm to use ๐Ÿ‘‘

Sections 2.7.2.1 through 2.7.2.4 describe the decisions a sending agent SHOULD use when deciding which type of encryption to apply to a message ๐Ÿ—บ๏ธ These rules are ordered, so the sending agent SHOULD make its decision in the order given ๐Ÿ”ข

2.7.1.1 Rule 1: Known Capabilities โœ…

If the sending agent has received a set of capabilities from the recipient for the message it's about to encrypt, then the sending agent SHOULD use that info by picking the first capability in the list (the one the intended recipient likes most) that it knows how to encrypt with ๐Ÿฅ‡ The sending agent SHOULD use one of the capabilities in the list if it reasonably expects the recipient to be able to decrypt the message ๐Ÿ’–

2.7.1.2 Rule 2: Unknown Capabilities, Known Use of Encryption ๐Ÿ•ต๏ธโ€โ™€๏ธ

If:

  • the sending agent has no knowledge of the encryption capabilities of the recipient,
  • and the sending agent has received at least one message from the recipient,
  • and the last encrypted message received from the recipient had a trusted signature on it,

then the outgoing message SHOULD use the same encryption algorithm that was used on the last signed and encrypted message received from the recipient ๐Ÿ”

2.7.1.3 Rule 3: Unknown Capabilities, Unknown Version of S/MIME ๐ŸŒˆ

If:

  • the sending agent has no knowledge of the encryption capabilities of the recipient,
  • and the sending agent has no knowledge of the version of S/MIME of the recipient,

then the sending agent SHOULD use tripleDES, because it's the stronger algorithm and S/MIME v3 requires it ๐Ÿ’ช If the sending agent chooses not to use tripleDES in this step, it SHOULD use RC2/40 ๐Ÿซฃ

2.7.2 Choosing Weak Encryption ๐Ÿšจ

Like all algorithms that use 40-bit keys, RC2/40 is considered weak encryption by many people ๐Ÿ˜ฌ A sending agent that's controlled by a human SHOULD let the human sender understand the risks of sending data with RC2/40 or a similarly weak algorithm before the data goes out, and possibly let the human switch to a stronger method like tripleDES ๐Ÿ›ก๏ธ

2.7.3 Multiple Recipients โœจ

Okay so picture this ๐Ÿ’Œ: you're sending an encrypted message to a whole group chat, but not everyone can decrypt the same methods. Their encryption capabilities don't overlap, so the sending agent is forced to send more than one message ๐Ÿ˜ญ. Also, bestie, heads up. If the sender encrypts the same message with a strong algorithm AND then again with a weak one, someone watching the channel can decrypt the weak copy and learn what the strong one said. Not the vibe ๐Ÿ’€.

3. Creating S/MIME Messages ๐ŸŽ€

This section is where we get into how S/MIME messages actually get made ๐Ÿงš. S/MIME messages are a combo of MIME bodies and CMS objects, and several MIME types and CMS objects are involved. The data being secured is always a canonical MIME entity. That MIME entity, plus other stuff like certificates and algorithm identifiers, gets handed to the CMS processing facilities, which produce a CMS object. Then the CMS object gets wrapped in MIME at the very end ๐ŸŒธ. The Enhanced Security Services for S/MIME [ESS] document has examples of how nested, secured S/MIME messages are formatted. It shows how a triple-wrapped S/MIME message is formatted using multipart/signed and application/pkcs7-mime for the signatures.

S/MIME gives you one format for enveloped-only data, several formats for signed-only data, and several formats for signed and enveloped data ๐Ÿฆ‹. Why so many? Different environments need different things, especially for signed messages. This section also explains how to pick among these formats.

The reader is expected to understand MIME as described in [MIME-SPEC] and [MIME-SECURE]. Read those first, bestie ๐Ÿ“š.

3.1 Preparing the MIME Entity for Signing or Enveloping ๐Ÿ’…

S/MIME is used to secure MIME entities. A MIME entity can be a subpart, some subparts of a message, or the whole message with all its subparts. A MIME entity that is the whole message includes only the MIME headers and MIME body. It does not include the RFC-822 headers. Also, S/MIME can secure MIME entities used in apps other than Internet mail, which is giving versatility ๐Ÿ™Œ.

The MIME entity that gets secured here is the "inside" MIME entity. It's the "innermost" object in what might be a bigger MIME message, like a onion ๐Ÿง…. Processing "outside" MIME entities into CMS objects is covered in Section 3.2, 3.4 and elsewhere.

The procedure for preparing a MIME entity is given in [MIME-SPEC]. The same procedure is used here, with some extra restrictions when signing. The procedure from [MIME-SPEC] is repeated here, but you should check that document for the exact steps. This section also adds some extra requirements โœจ.

One single procedure is used for creating MIME entities that are going to be signed, enveloped, or both signed and enveloped. Some extra steps are recommended to defend against known corruptions that can happen during mail transport. These matter a lot for clear-signing with the multipart/signed format. It is recommended that these extra steps be done on enveloped messages, or signed and enveloped messages, so the message can be forwarded to any environment without being modified ๐Ÿ”ฅ.

These steps are descriptive, not prescriptive. The implementor can use any procedure they want, as long as the result is the same ๐Ÿซถ.

Step 1. The MIME entity is prepared according to the local conventions.

Step 2. The leaf parts of the MIME entity are converted to canonical form.

Step 3. Appropriate transfer encoding is applied to the leaves of the MIME entity.

When an S/MIME message is received, its security services get processed, and the result is the MIME entity. That MIME entity is usually passed to a MIME-capable user agent, which decodes it further and presents it to the user or receiving application ๐Ÿ‘€.

3.1.1 Canonicalization ๐ŸŒˆ

Each MIME entity MUST be converted to a canonical form that is uniquely and unambiguously representable in the environment where the signature is created and the environment where the signature will be verified. MIME entities MUST be canonicalized for enveloping as well as signing. No exceptions, bestie ๐Ÿ™…โ€โ™€๏ธ.

The exact details of canonicalization depend on the MIME type and subtype of an entity, and they aren't described here. Instead, you should check the standard for that particular MIME type. For example, canonicalization of text/plain is different from canonicalization of audio/basic. Apart from text types, most types have only one representation no matter the computing platform or environment, and that can be considered their canonical representation ๐Ÿ’–. Generally, canonicalization is done by the non-security part of the sending agent, not the S/MIME implementation.

Text is the most common and important one to canonicalize, because it's often represented differently across environments ๐Ÿ˜ญ. MIME entities of major type "text" must have both their line endings and character set canonicalized. The line ending must be the pair of characters <CR><LF>, and the charset should be a registered charset [CHARSETS]. The details are specified in [MIME-SPEC]. The chosen charset SHOULD be named in the charset parameter, so the receiving agent can figure out the charset without any guessing ๐ŸŽฏ.

Note that some charsets, like ISO-2022, have multiple representations for the same characters. When preparing that kind of text for signing, the canonical representation specified for the charset MUST be used. Non-negotiable ๐Ÿ’….

3.1.2 Transfer Encoding ๐Ÿฆ‹

When generating any of the secured MIME entities below, no transfer encoding at all is required, except for signing with the multipart/signed format. S/MIME implementations MUST be able to deal with binary MIME objects. If there's no Content-Transfer-Encoding header, the transfer encoding should be considered 7BIT.

S/MIME implementations SHOULD however use the transfer encoding described in section 3.1.3 for all MIME entities they secure ๐Ÿง. Why secure only 7-bit MIME entities, even for enveloped data that never gets exposed to the transport? Because it lets the MIME entity be handled in any environment without changing it. For example, a trusted gateway might remove the envelope but not the signature of a message, then forward the signed message on to the end recipient so they can verify the signatures directly. If the transport inside the site isn't 8-bit clean, like on a wide-area network with a single mail gateway, verifying the signature won't be possible unless the original MIME entity was only 7-bit data ๐Ÿ™ˆ.

3.1.3 Transfer Encoding for Signing Using multipart/signed ๐Ÿ”

If a multipart/signed entity is EVER going to be transmitted over the standard Internet SMTP infrastructure, or any other transport constrained to 7-bit text, it MUST have transfer encoding applied so that it's represented as 7-bit text. MIME entities that are already 7-bit data need no transfer encoding. Entities like 8-bit text and binary data can be encoded with quoted-printable or base-64 transfer encoding ๐Ÿ’œ.

The main reason for the 7-bit requirement is that the Internet mail transport infrastructure can't guarantee it will carry 8-bit or binary data. Lots of parts of the transport now handle 8-bit, and even binary, data just fine. But sometimes it's impossible to know whether the transport path is 8-bit clean. If a message with 8-bit data hits a message transfer agent that can't transmit 8-bit or binary data, that agent has three options, and none of them are acceptable for a clear-signed message ๐Ÿ˜ฑ:

  • The agent could change the transfer encoding; this would invalidate the signature.
  • The agent could transmit the data anyway, which would most likely result in the 8th bit being corrupted; this too would invalidate the signature.
  • The agent could return the message to the sender.

[MIME-SECURE] prohibits an agent from changing the transfer encoding of the first part of a multipart/signed message. So if a compliant agent that can't transmit 8-bit or binary data runs into a multipart/signed message with 8-bit or binary data in the first part, it has to return the message to the sender as undeliverable ๐Ÿ’€.

3.1.4 Sample Canonical MIME Entity ๐Ÿ“

This example shows a multipart/mixed message with full transfer encoding. It has a text part and an attachment. The sample text has characters that aren't US-ASCII, so they must be transfer encoded. Even though it isn't shown here, the end of each line is <CR><LF>. The line endings of the MIME headers, the text, and the transfer encoded parts all must be <CR><LF> โœจ.

Note that this example is not of an S/MIME message ๐Ÿ™ƒ.

Content-Type: multipart/mixed; boundary=bar

--bar
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

=A1Hola Michael!

How do you like the new S/MIME specification?

I agree. It's generally a good idea to encode lines that begin with
From=20 because some mail transport agents will insert a
greater-than (>) sign, thus invalidating the signature.

Also, in some cases it might be desirable to encode any  =20
trailing whitespace that occurs on lines in order to ensure  =20
that the message signature is not invalidated when passing  =20
a gateway that modifies such whitespace (like BITNET).  =20

--bar
Content-Type: image/jpeg
Content-Transfer-Encoding: base64

iQCVAwUBMJrRF2N9oWBghPDJAQE9UQQAtl7LuRVndBjrk4EqYBIb3h5QXIX/LC//
jJV5bNvkZIGPIcEmI5iFd9boEgvpirHtIREEqLQRkYNoBActFBZmh9GC3C041WGq
uMbrbxc+nIs1TIKlA08rVi9ig/2Yh7LFrK5Ein57U/W72vgSxLhe/zhdfolT9Brn
HOxEa44b+EI=

--bar--

3.2 The application/pkcs7-mime Type ๐Ÿงšโ€โ™€๏ธ

The application/pkcs7-mime type is used to carry CMS objects of several types, including envelopedData and signedData. How these entities get constructed is described in the later sections. This section covers the general characteristics of the application/pkcs7-mime type ๐Ÿ’–.

The carried CMS object always contains a MIME entity that's prepared as described in section 3.1 if the eContentType is id-data. Other contents can be carried when the eContentType has different values. See [ESS] for an example of this with signed receipts ๐Ÿ“ฌ.

Since CMS objects are binary data, base-64 transfer encoding is usually appropriate, especially when used with SMTP transport. The transfer encoding depends on the transport the object is sent through. It is not a characteristic of the MIME type ๐ŸŒธ.

Note that this discussion is about the transfer encoding of the CMS object, or "outside" MIME entity. That's completely separate from, and unrelated to, the transfer encoding of the MIME entity secured by the CMS object, the "inside" object, which is covered in section 3.1 ๐Ÿ™Œ.

Since there are several types of application/pkcs7-mime objects, a sending agent SHOULD do as much as it can to help a receiving agent know what's inside the object, without forcing the receiving agent to decode the ASN.1 for the object ๐Ÿค“. The MIME headers of all application/pkcs7-mime objects SHOULD include the optional "smime-type" parameter, as described in the following sections ๐ŸŽ€.

3.2.1 The name and filename Parameters โœจ

Okay bestie, for application/pkcs7-mime, sending agents SHOULD emit the optional name parameter on the Content-Type field so older systems don't get lost ๐Ÿ’…. They SHOULD also send the optional Content-Disposition field [CONTDISP] with a filename parameter ๐ŸŽ€. If a sending agent includes those parameters, their values SHOULD be a file name with the right extension ๐Ÿฆ‹:

MIME Type                                File Extension

Application/pkcs7-mime (signedData,      .p7m
envelopedData)

Application/pkcs7-mime (degenerate       .p7c
signedData "certs-only" message)

Application/pkcs7-signature              .p7s

The file name SHOULD be limited to eight characters followed by a three letter extension ๐ŸŒธ. The eight character base can be any distinct name, but the base smime SHOULD be used to show that the MIME entity is associated with S/MIME ๐Ÿ’œ.

So why bother with filenames? ngl, they do two jobs โœจ. They make S/MIME objects way easier to use as files on disk, and they can carry type info across gateways ๐Ÿงš. When an application/pkcs7-mime entity hits a gateway that has no clue what S/MIME is, the gateway defaults the type to application/octet-stream and treats it as a generic attachment, so the type info is gone ๐Ÿ˜ญ. The suggested filename, though, often survives the trip across the gateway, and that helps the receiving system figure out which app to hand the attachment to, like a stand-alone S/MIME processing app ๐Ÿ”ฅ. This is just a convenience for certain environments, though. A proper S/MIME implementation MUST use the MIME types and MUST NOT rely on the file extensions. Not me relying on file extensions ๐Ÿ™ˆ

3.2.2 The smime-type parameter ๐Ÿ’œ

The application/pkcs7-mime content type defines an optional smime-type parameter โœจ. Its whole purpose is to tell you what security was applied (signed or enveloped) and what kind of content is inside ๐ŸŽ€. This memo defines the following smime-types:

Name                   Security                Inner Content

enveloped-data         EnvelopedData           id-data

signed-data            SignedData              id-data

certs-only             SignedData              none

To keep future values consistent, here's how to name a new smime-type ๐ŸŒˆ:

  1. If both signing and encryption can be applied to the content, then two values for smime-type SHOULD be assigned: "signed-*" and "encrypted-*". If only one operation applies, the other can be left out. That's why "signed-" is dropped for "certs-only", since that one can only be signed.
  2. A common string should be assigned for a content OID. We use "data" for the id-data content OID when MIME is the inner content.
  3. If no common string is assigned, then the common string of "OID.<oid>" is recommended. For example, "OID.1.3.6.1.5.5.7.6.1" would be DES40.

3.3 Creating an Enveloped-only Message ๐ŸŽ

This section explains how to envelope a MIME entity without signing it. Heads up, this one's important: sending enveloped but unsigned messages does NOT give you data integrity ๐Ÿ˜ฌ Someone could swap out the ciphertext so the processed message still looks valid, but the meaning could change. Yikes ๐Ÿ’€

Step 1. Prepare the MIME entity to be enveloped according to section 3.1.

Step 2. Process the MIME entity and other required data into a CMS object of type envelopedData. Besides encrypting a copy of the content-encryption key for each recipient, a copy of the content encryption key SHOULD be encrypted for the originator and included in the envelopedData (see CMS Section 6) ๐Ÿซถ

Step 3. Insert the CMS object into an application/pkcs7-mime MIME entity โœจ

For enveloped-only messages, the smime-type parameter is enveloped-data, and the file extension is .p7m. Here's a sample message ๐ŸŒธ:

Content-Type: application/pkcs7-mime; smime-type=enveloped-data;
     name=smime.p7m
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7m

rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6
7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H
f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4
0GhIGfHfQbnj756YT64V

3.4 Creating a Signed-only Message ๐Ÿ–Š๏ธ

There are two signed formats for S/MIME: application/pkcs7-mime with SignedData, and multipart/signed. In general, multipart/signed is the preferred one for sending ๐Ÿ’–, but receiving agents SHOULD be able to handle both ๐Ÿซถ

3.4.1 Choosing a Format for Signed-only Messages ๐Ÿค”

Honestly, there's no hard-and-fast rule for picking a signed-only format ๐Ÿ™ƒ It depends on what all the receivers can handle, and on how much it matters that receivers with S/MIME can verify the signature versus how much it matters that receivers without S/MIME software can read the message at all.

Messages signed with the multipart/signed format can always be read by the receiver, whether or not they have S/MIME software โœจ They can also be read by a MIME-native user agent or by a message that's been translated by a gateway ๐Ÿฆ‹ Here, "be viewed" means the receiver can process the message essentially as if it weren't signed at all, including any other MIME structure it has ๐ŸŒˆ

Messages signed with the signedData format can't be read by a recipient unless they have S/MIME facilities ๐Ÿ˜ญ But if they do have S/MIME facilities, those messages can always be verified, as long as they weren't changed in transit ๐Ÿ”ฅ

3.4.2 Signing Using application/pkcs7-mime with SignedData ๐Ÿงš

This signing format uses the application/pkcs7-mime MIME type. Here are the steps:

Step 1. Prepare the MIME entity according to section 3.1 ๐Ÿ’…

Step 2. Process the MIME entity and other required data into a CMS object of type signedData ๐ŸŽ€

Step 3. Insert the CMS object into an application/pkcs7-mime MIME entity ๐ŸŒธ

For messages using application/pkcs7-mime with SignedData, the smime-type parameter is signed-data, and the file extension is .p7m. Sample time ๐Ÿ‘‘

Content-Type: application/pkcs7-mime; smime-type=signed-data;
     name=smime.p7m
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7m
567GhIGfHfYT6ghyHhHUujpfyF4f8HHGTrfvhJhjH776tbB9HG4VQbnj7
77n8HHGT9HG4VQpfyF467GhIGfHfYT6rfvbnj756tbBghyHhHUujhJhjH
HUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H7n8HHGghyHh
6YT64V0GhIGfHfQbnj75

3.4.3 Signing Using the multipart/signed Format ๐Ÿฆ‹

This one's a clear-signing format ๐Ÿซง Recipients with zero S/MIME or CMS processing can still read the message. It uses the multipart/signed MIME type described in [MIME-SECURE]. It has two parts. The first part holds the MIME entity that's being signed. The second part holds the "detached signature" CMS SignedData object, and its encapContentInfo eContent field is absent ๐ŸŒˆ

3.4.3.1 The application/pkcs7-signature MIME Type ๐Ÿ’Ž

This MIME type always contains a single CMS object of type signedData. The signedData encapContentInfo eContent field MUST be absent ๐Ÿ™…โ€โ™€๏ธ The signerInfos field holds the signatures for the MIME entity.

The file extension for signed-only messages using application/pkcs7-signature is .p7s ๐ŸŽ€

3.4.3.2 Creating a multipart/signed Message ๐Ÿ—๏ธ

Step 1. Prepare the MIME entity to be signed according to section 3.1, and take special care with clear-signing โœจ

Step 2. Present the MIME entity to CMS processing to get an object of type signedData where the encapContentInfo eContent field is absent ๐Ÿงš

Step 3. Insert the MIME entity into the first part of a multipart/signed message, with no processing beyond what section 3.1 describes ๐ŸŒธ

Step 4. Apply transfer encoding to the "detached signature" CMS SignedData object, and put it into a MIME entity of type application/pkcs7-signature ๐Ÿ’…

Step 5. Insert the application/pkcs7-signature MIME entity into the second part of the multipart/signed entity ๐Ÿซถ

The multipart/signed Content type has two required parameters: the protocol parameter and the micalg parameter ๐Ÿ’–

The protocol parameter MUST be "application/pkcs7-signature". Quotation marks are required around it, because MIME requires that the "/" character in the parameter value MUST be quoted ๐Ÿ™ˆ

The micalg parameter lets verification happen in one pass ๐Ÿ”ฅ Its value depends on the message digest algorithm(s) used to compute the Message Integrity Check. If multiple message digest algorithms are used, they MUST be separated by commas per [MIME-SECURE]. The values for the micalg parameter SHOULD come from this list ๐Ÿ‘‘

Algorithm   Value
used

MD5         md5
SHA-1       sha1
Any other   unknown

(Historical note: some early S/MIME implementations emitted and expected "rsa-md5" and "rsa-sha1" for the micalg parameter ๐Ÿ•ฐ๏ธ) Receiving agents SHOULD be able to recover gracefully from a micalg parameter value they don't recognize ๐ŸŒˆ

3.4.3.3 Sample multipart/signed Message ๐ŸŽ€

Content-Type: multipart/signed;
   protocol="application/pkcs7-signature";
   micalg=sha1; boundary=boundary42

--boundary42
Content-Type: text/plain

This is a clear-signed message.

--boundary42
Content-Type: application/pkcs7-signature; name=smime.p7s
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7s

ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6
4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj
n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4
7GhIGfHfYT64VQbnj756

--boundary42--

3.5 Signing and Encrypting โœจ

okay so you can totally nest the signed-only and encrypted-only formats inside each other to get signing AND enveloping ๐Ÿซถ this works because every one of these formats is a MIME entity, and they all secure MIME entities, so they just slot together like puzzle pieces ๐Ÿงฉ

an S/MIME implementation MUST be able to receive and process arbitrarily nested S/MIME within reasonable resource limits of the recipient computer. no skipping this one bestie ๐Ÿ’…

you get to pick the order: sign first, or envelope first. it's the implementor and the user who decide, not the spec ๐Ÿ’– if you sign first, the signers get securely hidden inside the envelope ๐Ÿ•ต๏ธโ€โ™€๏ธ if you envelope first, the signers are visible, BUT you can check the signatures without opening the envelope first ๐Ÿ‘€ this can be super useful when you want automatic signature checking, because you don't need any private key material to verify a signature ๐Ÿ”‘โœจ

the order has real security consequences though, so pay attention ๐Ÿšจ if a message is encrypted and then signed, the recipient can confirm the encrypted block wasn't changed, but they can't figure out any connection between the signer and the unencrypted contents ๐Ÿ™ˆ if a message is signed and then encrypted, the recipient can assume the signed part hasn't been tampered with, but a careful attacker might have messed with the parts that aren't authenticated inside the encrypted message ๐Ÿ˜ฌ

3.6 Creating a Certificates-only Message ๐ŸŽ€

the certificates-only message (or MIME entity) is for transporting certificates, like when you're answering a registration request. it can also carry CRLs ๐Ÿงพ

Step 1. The certificates are made available to the CMS generating process which creates a CMS object of type signedData. The signedData encapContentInfo eContent field MUST be absent and signerInfos field MUST be empty.

Step 2. The CMS signedData object is enclosed in an application/pkcs7-mime MIME entity

the smime-type parameter for a certs-only message is "certs-only" and the file extension is .p7c ๐Ÿ“

3.7 Registration Requests ๐Ÿ“ฌ

a sending agent that signs messages MUST have a certificate for the signature, so the receiving agent can verify it ๐Ÿ” there are lots of ways to get one: a certificate authority, a hardware token, a diskette, and so on ๐Ÿ’พ

S/MIME v2 [SMIMEV2] had a way to "register" public keys with certificate authorities using an application/pkcs10 body part. the IETF's PKIX Working Group was working on another way to request certificates, but that wasn't finished when this memo was written ๐Ÿซ  S/MIME v3 doesn't say how to request a certificate. instead it requires that every sending agent already has one ๐Ÿ™Œ certificate management is being handled separately in the IETF.

3.8 Identifying an S/MIME Message ๐Ÿ”

S/MIME works in non-MIME environments too, so the type info gets carried in several different ways, which makes it kinda hard to spot S/MIME messages ๐Ÿฅบ the table below lists the criteria. a message counts as an S/MIME message if it matches any of them.

the file suffix in the table comes from the "name" parameter in the content-type header, or the "filename" parameter in the content-disposition header. those parameters that give the file suffix aren't listed in the parameters column ๐Ÿ“Ž

MIME type:   application/pkcs7-mime
parameters:  any
file suffix: any

MIME type:   multipart/signed
parameters:  protocol="application/pkcs7-signature"
file suffix: any

MIME type:   application/octet-stream
parameters:  any
file suffix: p7m, p7s, p7c

4. Certificate Processing ๐Ÿชช

a receiving agent MUST provide some certificate retrieval mechanism so it can get the certificates for recipients of digital envelopes ๐Ÿ“ฅ this memo doesn't cover how S/MIME agents handle certificates, just what they do after a certificate has been validated or rejected. S/MIME certification issues are covered in [CERT3] ๐Ÿ“š

at the very least, for initial S/MIME deployment, a user agent could automatically send a message to an intended recipient asking for their certificate in a signed reply ๐Ÿ’Œ sending and receiving agents SHOULD also give users a way to "store and protect" certificates for correspondents, in a way that guarantees they can be retrieved later โœจ

4.1 Key Pair Generation ๐Ÿ—๏ธ

if an S/MIME agent needs to generate a key pair, the S/MIME agent or some related administrative utility or function MUST be capable of generating separate DH and DSS public/private key pairs on behalf of the user. every key pair MUST be generated from a good source of non-deterministic random input [RANDOM], and the private key MUST be protected securely ๐Ÿ”’

again, if an S/MIME agent needs to generate a key pair, the S/MIME agent or some related administrative utility or function SHOULD generate RSA key pairs ๐Ÿ’…

a user agent SHOULD generate RSA key pairs at a minimum key size of 768 bits. a user agent MUST NOT generate RSA key pairs less than 512 bits long ๐Ÿšซ making keys longer than 1024 bits may cause some older S/MIME receiving agents to be unable to verify signatures, but it gives better security, so it's valuable ๐Ÿ’ช a receiving agent SHOULD be able to verify signatures with keys of any size over 512 bits. some agents made in the United States chose 512 bit keys to get more favorable export licenses, but a lot of people consider 512 bit keys cryptographically insecure ๐Ÿ’€ implementors should be aware that multiple (active) key pairs may be linked to one individual ๐Ÿซง for example, one key pair might handle confidentiality while a different key pair handles authentication.

5. Security ๐Ÿ›ก๏ธ

this entire memo is about security, but here are the security issues that don't get covered in the other parts ๐Ÿ‘‘

40-bit encryption is considered weak by most cryptographers ๐Ÿ˜ฌ using weak cryptography in S/MIME offers little real security over sending plaintext. BUT other features of S/MIME, like the spec for tripleDES and the ability to announce stronger cryptographic capabilities to the people you talk to, let senders create messages that use strong encryption ๐Ÿ”ฅ using weak cryptography is never recommended unless the only alternative is no cryptography at all. when it's feasible, sending and receiving agents should tell senders and recipients how cryptographically strong a message is ๐Ÿซถ

it's impossible for most software or people to estimate the value of a message. it's also impossible for most of them to estimate the actual cost of decrypting a message encrypted with a key of a particular size ๐Ÿคฏ and it's really hard to figure out the cost of a failed decryption if a recipient can't decode a message. so picking between key sizes (or picking whether to just use plaintext) is also impossible to do perfectly ๐Ÿ™ƒ but people make these decisions all the time, so this memo gives a framework for using those estimates when choosing algorithms ๐Ÿ“

if a sending agent sends the same message with different strengths of cryptography, an attacker watching the channel might be able to read the strongly-encrypted message by decrypting the weakly-encrypted version ๐Ÿ˜ญ in other words, a sender should not send a copy of a message using weaker cryptography than they'd use for the original.

modification of the ciphertext can go undetected if authentication isn't also used, which is what happens when you send EnvelopedData without wrapping it in SignedData or enclosing SignedData within it ๐Ÿšจ

A. ASN.1 Module ๐Ÿงš

SecureMimeMessageV3
  { iso(1) member-body(2) us(840) rsadsi(113549)
         pkcs(1) pkcs-9(9) smime(16) modules(0) smime(4) }

DEFINITIONS IMPLICIT TAGS ::=
BEGIN

IMPORTS
-- Cryptographic Message Syntax
    SubjectKeyIdentifier, IssuerAndSerialNumber,
RecipientKeyIdentifier
        FROM    CryptographicMessageSyntax
               { iso(1) member-body(2) us(840) rsadsi(113549)
                 pkcs(1) pkcs-9(9) smime(16) modules(0) cms(1) };

--  id-aa is the arc with all new authenticated and unauthenticated
--  attributes produced the by S/MIME Working Group

id-aa OBJECT IDENTIFIER ::= {iso(1) member-body(2) usa(840)
rsadsi(113549)
        pkcs(1) pkcs-9(9) smime(16) attributes(2)}

-- S/MIME Capabilities provides a method of broadcasting the symetric
-- capabilities understood.  Algorithms should be ordered by preference
-- and grouped by type

smimeCapabilities OBJECT IDENTIFIER ::=
   {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9) 15}

SMIMECapability ::= SEQUENCE {
   capabilityID OBJECT IDENTIFIER,
   parameters ANY DEFINED BY capabilityID OPTIONAL }

SMIMECapabilities ::= SEQUENCE OF SMIMECapability

-- Encryption Key Preference provides a method of broadcasting the
-- preferred encryption certificate.

id-aa-encrypKeyPref OBJECT IDENTIFIER ::= {id-aa 11}

SMIMEEncryptionKeyPreference ::= CHOICE {
   issuerAndSerialNumber   [0] IssuerAndSerialNumber,
   receipentKeyId          [1] RecipientKeyIdentifier,
   subjectAltKeyIdentifier [2] SubjectKeyIdentifier
}
-- The Content Encryption Algorithms defined for SMIME are:

-- Triple-DES is the manditory algorithm with CBCParameter being the
-- parameters

dES-EDE3-CBC OBJECT IDENTIFIER ::=
   {iso(1) member-body(2) us(840) rsadsi(113549)
encryptionAlgorithm(3) 7}

CBCParameter ::= IV

IV ::= OCTET STRING (SIZE (8..8))

--  RC2 (or compatable) is an optional algorithm w/ RC2-CBC-paramter
--  as the parameter

rC2-CBC OBJECT IDENTIFIER ::=
   {iso(1) member-body(2) us(840) rsadsi(113549)
encryptionAlgorithm(3) 2}

-- For the effective-key-bits (key size) greater than 32 and less than
-- 256, the RC2-CBC algorithm parameters are encoded as:

RC2-CBC-parameter ::=  SEQUENCE {
   rc2ParameterVersion  INTEGER,
   iv                   IV}

-- For the effective-key-bits of 40, 64, and 128, the
-- rc2ParameterVersion values are 160, 120, 58 respectively.

-- The following list the OIDs to be used with S/MIME V3

-- Digest Algorithms:

-- md5 OBJECT IDENTIFIER ::=
--    {iso(1) member-body(2) us(840) rsadsi(113549)
-- digestAlgorithm(2) 5}

-- sha-1 OBJECT IDENTIFIER ::=
--    {iso(1) identified-organization(3) oiw(14) secsig(3)
-- algorithm(2) 26}

-- Asymmetric Encryption Algorithms
--
-- rsaEncryption OBJECT IDENTIFIER ::=
--    {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1)
-- 1}
--
-- rsa OBJECT IDENTIFIER ::=
--    {joint-iso-ccitt(2) ds(5) algorithm(8) encryptionAlgorithm(1) 1}
--
-- id-dsa OBJECT IDENTIFIER ::=
--    {iso(1) member-body(2) us(840) x9-57(10040) x9cm(4) 1 }

-- Signature Algorithms
--
-- md2WithRSAEncryption OBJECT IDENTIFIER ::=
--    {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1)
-- 2}
--
-- md5WithRSAEncryption OBJECT IDENTIFIER ::=
--    {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1)
-- 4}
--
-- sha-1WithRSAEncryption OBJECT IDENTIFIER ::=
--    {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1)
-- 5}
--
-- id-dsa-with-sha1 OBJECT IDENTIFIER ::=
--    {iso(1) member-body(2) us(840) x9-57(10040) x9cm(4) 3}

-- Other Signed Attributes
--
-- signingTime OBJECT IDENTIFIER ::=
--    {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-9(9)
-- 5}
--    See [CMS] for a description of how to encode the attribute
--    value.

END

B. References โœจ

Bestie, here's the whole reference shelf, every single source the spec leans on ๐Ÿ“š๐ŸŽ€

  • [3DES] ANSI X9.52-1998, "Triple Data Encryption Algorithm Modes of Operation", American National Standards Institute, 1998.
  • [CERT3] Ramsdell, B., Editor, "S/MIME Version 3 Certificate Handling", RFC 2632, June 1999.
  • [CHARSETS] Character sets assigned by IANA. See <ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets>.
  • [CMS] Housley, R., "Cryptographic Message Syntax", RFC 2630, June 1999.
  • [CONTDISP] Troost, R., Dorner, S. and K. Moore, "Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field", RFC 2183, August 1997.
  • [DES] ANSI X3.106, "American National Standard for Information Systems- Data Link Encryption," American National Standards Institute, 1983.
  • [DH] Rescorla, E., "Diffie-Hellman Key Agreement Method", RFC 2631, June 1999.
  • [DSS] NIST FIPS PUB 186, "Digital Signature Standard", 18 May 1994.
  • [ESS] Hoffman, P., Editor "Enhanced Security Services for S/MIME", RFC 2634, June 1999.
  • [MD5] Rivest, R., "The MD5 Message Digest Algorithm", RFC 1321, April 1992.
  • [MIME-SPEC] The primary definition of MIME. "MIME Part 1: Format of Internet Message Bodies", RFC 2045; "MIME Part 2: Media Types", RFC 2046; "MIME Part 3: Message Header Extensions for Non-ASCII Text", RFC 2047; "MIME Part 4: Registration Procedures", RFC 2048; "MIME Part 5: Conformance Criteria and Examples", RFC 2049, September 1993.
  • [MIME-SECURE] Galvin, J., Murphy, S., Crocker, S. and N. Freed, "Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted", RFC 1847, October 1995.
  • [MUSTSHOULD] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP14, RFC 2119, March 1997.
  • [PKCS-1] Kaliski, B., "PKCS #1: RSA Encryption Version 2.0", RFC 2437, October 1998.
  • [PKCS-7] Kaliski, B., "PKCS #7: Cryptographic Message Syntax Version 1.5", RFC 2315, March 1998.
  • [RANDOM] Eastlake, 3rd, D., Crocker, S. and J. Schiller, "Randomness Recommendations for Security", RFC 1750, December 1994.
  • [RC2] Rivest, R., "A Description of the RC2 (r) Encryption Algorithm", RFC 2268, January 1998.
  • [SHA1] NIST FIPS PUB 180-1, "Secure Hash Standard," National Institute of Standards and Technology, U.S. Department of Commerce, DRAFT, 31May 1994.
  • [SMIMEV2] Dusse, S., Hoffman, P., Ramsdell, B., Lundblade, L. and L. Repka, "S/MIME Version 2 Message Specification", RFC 2311, March 1998.

C. Acknowledgements ๐Ÿซถ

Huge thank-you to the other authors of the S/MIME Version 2 Message Specification RFC: Steve Dusse, Paul Hoffman, Laurence Lundblade and Lisa Repka. Without v2, there wouldn't be a v3 ๐Ÿ’œ

A bunch of the S/MIME Working Group members also worked super hard and contributed to this document ๐ŸŒธ Any list of people is doomed to leave someone out, and the author apologizes for that ๐Ÿ™ˆ Here are the folks (alphabetical order) who really stand out because they made direct contributions:

  • Dave Crocker
  • Bill Flanigan
  • Paul Hoffman
  • Russ Housley
  • John Pawling
  • Jim Schaad

Editor's Address ๐Ÿ’Œ

   Blake Ramsdell
   Worldtalk
   17720 NE 65th St Ste 201
   Redmond, WA 98052

   Phone: +1 425 376 0225
   EMail: blaker@deming.com
Heads up: this legal notice has to stay word-for-word, so it's copied exactly below ๐ŸŽ€
   Copyright (C) The Internet Society (1999).  All Rights Reserved.

   This document and translations of it may be copied and furnished to
   others, and derivative works that comment on or otherwise explain it
   or assist in its implementation may be prepared, copied, published
   and distributed, in whole or in part, without restriction of any
   kind, provided that the above copyright notice and this paragraph are
   included on all such copies and derivative works.  However, this
   document itself may not be modified in any way, such as by removing
   the copyright notice or references to the Internet Society or other
   Internet organizations, except as needed for the purpose of
   developing Internet standards in which case the procedures for
   copyrights defined in the Internet Standards process must be
   followed, or as required to translate it into languages other than
   English.

   The limited permissions granted above are perpetual and will not be
   revoked by the Internet Society or its successors or assigns.

   This document and the information contained herein is provided on an
   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Acknowledgement ๐ŸŒˆ

Funding for the RFC Editor function is currently provided by the Internet Society. Thank you, Internet Society, for keeping the lights on โœจ

๐Ÿ“ฆ where this page comes from