RFC 8550

Secure/Multipurpose Internet Mail Extensions (S/MIME) Version 4.0 Certificate Handling

๐Ÿ“… published April 2019, from ietf

Secure/Multipurpose Internet Mail Extensions (S/MIME) Version 4.0 Certificate Handling ๐ŸŽ€

Okay bestie, this is RFC 8550 ๐Ÿ’Œ It's a Standards Track doc from the IETF, dated April 2019 with ISSN 2070-1721. The authors are J. Schaad (August Cellars), B. Ramsdell (Brute Squad Labs, Inc.), and S. Turner (sn3rd) ๐Ÿ‘‘ It obsoletes RFC 5750, which means this one replaces it ๐Ÿฆ‹

Abstract ๐Ÿ’…

So this doc is all about how S/MIME v4.0 agents handle X.509 certificates ๐Ÿ” S/MIME is how you send and receive secure MIME messages, and certificates are a huge part of what agents do. Agents check certificates the way RFC 5280 ("Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile") describes, and S/MIME agents must meet the certificate-processing rules in this doc as well as the ones in RFC 5280. It also obsoletes RFC 5750 ๐Ÿซถ

Status of This Memo ๐Ÿ“œ

This is an Internet Standards Track document ๐ŸŒธ

It's a product of the IETF, so it reflects the consensus of the IETF community. It got public review and was approved for publication by the Internet Engineering Steering Group (IESG). If you want more on Internet Standards, check Section 2 of RFC 7841 โœจ

Info about the current status of this doc, any errata, and how to send feedback lives at https://www.rfc-editor.org/info/rfc8550 ๐Ÿ”—

Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved. ๐Ÿฆข

This doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) as they stand on the publication date. Please read those carefully, because they spell out your rights and restrictions for this doc. Code Components pulled out of this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as described in the Simplified BSD License.

Some of this doc may contain material from IETF Documents or IETF Contributions that were published or made publicly available before November 10, 2008 ๐Ÿ•ฐ๏ธ The people who control the copyright in some of that older material may not have given the IETF Trust permission to allow changes to it outside the IETF Standards Process. Unless you get an adequate license from those copyright holders, this doc may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside that process. The one exceptions are formatting it for publication as an RFC and translating it into languages other than English ๐ŸŒˆ

Table of Contents ๐Ÿ—‚๏ธ

1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   4
  1.1.  Definitions . . . . . . . . . . . . . . . . . . . . . . .   4
  1.2.  Conventions Used in This Document . . . . . . . . . . . .   5
  1.3.  Compatibility with Prior Practice of S/MIME . . . . . . .   6
  1.4.  Changes from S/MIME v3 to S/MIME v3.1 . . . . . . . . . .   6
  1.5.  Changes from S/MIME v3.1 to S/MIME v3.2 . . . . . . . . .   7
  1.6.  Changes since S/MIME 3.2  . . . . . . . . . . . . . . . .   8
2.  CMS Options . . . . . . . . . . . . . . . . . . . . . . . . .   8
  2.1.  Certificate Revocation Lists  . . . . . . . . . . . . . .   9
  2.2.  Certificate Choices . . . . . . . . . . . . . . . . . . .   9
    2.2.1.  Historical Note about CMS Certificates  . . . . . . .   9
  2.3.  Included Certificates . . . . . . . . . . . . . . . . . .  10
3.  Using Distinguished Names for Internet Mail . . . . . . . . .  11
4.  Certificate Processing  . . . . . . . . . . . . . . . . . . .  12
  4.1.  Certificate Revocation Lists  . . . . . . . . . . . . . .  13
  4.2.  Certificate Path Validation . . . . . . . . . . . . . . .  13
  4.3.  Certificate and CRL Signing Algorithms, and Key Sizes . .  14
  4.4.  PKIX Certificate Extensions . . . . . . . . . . . . . . .  15
    4.4.1.  Basic Constraints . . . . . . . . . . . . . . . . . .  16
    4.4.2.  Key Usage Extension . . . . . . . . . . . . . . . . .  16
    4.4.3.  Subject Alternative Name  . . . . . . . . . . . . . .  17
    4.4.4.  Extended Key Usage Extension  . . . . . . . . . . . .  17
5.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  18
6.  Security Considerations . . . . . . . . . . . . . . . . . . .  18
7.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  20
  7.1.  Reference Conventions . . . . . . . . . . . . . . . . . .  20
  7.1.  Normative References  . . . . . . . . . . . . . . . . . .  20
  7.2.  Informative References  . . . . . . . . . . . . . . . . .  23
Appendix A.  Historic Considerations  . . . . . . . . . . . . . .  26
  A.1.  Signature Algorithms and Key Sizes  . . . . . . . . . . .  26
Appendix B.  Moving S/MIME v2 Certificate Handling to Historic
             Status . . . . . . . . . . . . . . . . . . . . . . .  27
Acknowledgements  . . . . . . . . . . . . . . . . . . . . . . . .  28
Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  28

1. Introduction ๐ŸŒท

S/MIME (Secure/Multipurpose Internet Mail Extensions) v4.0, described in [RFC8551], gives you a way to send and receive secure MIME messages ๐Ÿ’– Before you use a public key to provide security services, the S/MIME agent MUST verify that the public key is valid. S/MIME agents MUST use PKIX certificates to validate public keys as described in [RFC5280] ("Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile"). And S/MIME agents MUST meet the certificate-processing requirements in this document on top of the ones stated in [RFC5280] ๐Ÿ”ฅ

This spec is compatible with the Cryptographic Message Syntax (CMS) [RFC5652] because it uses the data types CMS defines. It also inherits all the varieties of architectures for certificate-based key management that CMS supports ๐Ÿงš

This doc obsoletes [RFC5750] ๐Ÿฅ€ The biggest changes revolve around recommendations for the cryptographic algorithms the spec uses. You can find more details in Section 1.6 ๐Ÿ“

This spec has a bunch of references to docs that have been obsoleted or replaced. That's on purpose, because the updated docs often don't have the same info or protocol requirements in them ๐Ÿ™ˆ

1.1. Definitions ๐Ÿ“š

For the purposes of this doc, the following definitions apply โœจ

ASN.1: Abstract Syntax Notation One, as defined in ITU-T X.680 [X.680].

Attribute certificate (AC): An X.509 AC is a separate structure from a subject's public key X.509 certificate. A subject may have multiple X.509 ACs associated with each of its public key X.509 certificates. Each X.509 AC binds one or more attributes with one of the subject's public key X.509 certificates. The X.509 AC syntax is defined in [RFC5755] ๐Ÿฆ‹

Certificate: A type that binds an entity's name to a public key with a digital signature. This type is defined in [RFC5280]. It also contains the distinguished name of the certificate issuer (the signer), an issuer-specific serial number, the issuer's signature algorithm identifier, a validity period, and extensions also defined in that document ๐Ÿ’œ

Certificate Revocation List (CRL): A type that contains information about certificates whose validity an issuer has revoked. The information consists of an issuer name, the time of issue, the next scheduled time of issue, a list of certificate serial numbers and their associated revocation times, and extensions as defined in [RFC5280]. The CRL is signed by the issuer. The type intended by this specification is the one defined in [RFC5280] ๐Ÿซง

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.2. Conventions Used in This Document ๐Ÿง 

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. So a lowercase "must" is just a normal word ๐Ÿ’…

We also define some additional requirement levels ๐Ÿ‘‘

SHOULD+ This term means the same as SHOULD. However, the authors expect that a requirement marked as SHOULD+ will be promoted at some future time to be a MUST.

SHOULD- This term means the same as SHOULD. However, the authors expect that a requirement marked as SHOULD- will be demoted to a MAY in a future version of this document.

MUST- This term means the same as MUST. However, the authors expect that this requirement will no longer be a MUST in a future document. Although its status will be determined at a later time, it is reasonable to expect that if a future revision of a document alters the status of a MUST- requirement, it will remain at least a SHOULD or a SHOULD-. ๐Ÿฅบ

The term "RSA" in this document almost always refers to the PKCS #1 v1.5 RSA signature algorithm, even when it isn't qualified as such. There are a couple of places where it refers to the general RSA cryptographic operation, and you can tell which from the context where it's used ๐Ÿ”

1.3. Compatibility with Prior Practice of S/MIME ๐Ÿ•ฐ๏ธ

S/MIME version 4.0 agents ought to attempt to have the greatest interoperability possible with agents for prior versions of S/MIME ๐Ÿซถ

Appendix A contains information about algorithms that were used for prior versions of S/MIME but are no longer considered to meet modern security standards. Support for these algorithms may be needed to support historic S/MIME artifacts, such as messages or files, but they SHOULD NOT be used for new artifacts. โš ๏ธ

1.4. Changes from S/MIME v3 to S/MIME v3.1 ๐Ÿ’Œ

okay so this bit is the changelog for when S/MIME v3.1 dropped ๐Ÿ’… heads up, the RFC 2119 words ("MUST", "SHOULD", etc.) from v3 may have been superseded in later versions, so keep that in mind ๐Ÿซถ

  • Version 1 and version 2 CRLs MUST be supported. ๐Ÿ“œ
  • Multiple certification authority (CA) certificates with the same subject and public key, but with overlapping validity periods, MUST be supported. ๐Ÿ”
  • Version 2 ACs SHOULD be supported, and version 1 ACs MUST NOT be used. ๐Ÿ™…โ€โ™€๏ธ
  • The use of the MD2 digest algorithm for certificate signatures is discouraged, and security language was added. ๐Ÿ”
  • Clarified email address use in certificates. Certificates that do not contain an email address have no requirements for verifying the email address associated with the certificate. ๐Ÿ“ง
  • Receiving agents SHOULD display certificate information when displaying the results of signature verification. ๐Ÿ‘€
  • Receiving agents MUST NOT accept a signature made with a certificate that does not have at least one of the digitalSignature or nonRepudiation bits set. ๐Ÿšซ
  • Added clarifications for the interpretation of the key usage and extended key usage extensions. โœจ

1.5. Changes from S/MIME v3.1 to S/MIME v3.2 ๐ŸŒธ

this section is the glow-up from v3.1 to v3.2 ๐Ÿฆ‹ same deal as before, the RFC 2119 language ("MUST", "SHOULD", etc.) used for v3.1 may have been superseded in later versions

quick heads up: the section numbers here (like "Section 6") are from [RFC5750], not this doc ๐Ÿ“š

  • Moved "Conventions Used in This Document" to Section 1.2. Added definitions for SHOULD+, SHOULD-, and MUST-. ๐Ÿง 
  • Section 1.1: Updated ASN.1 definition and reference. ๐Ÿ”ง
  • Section 1.3: Added text about v3.1 RFCs. ๐Ÿ“
  • Section 3: Aligned email address text with RFC 5280. Updated note to indicate that the emailAddress IA5String upper bound is 255 characters. Added text about matching email addresses. ๐Ÿ’•
  • Section 4.2: Added text to indicate how S/MIME agents locate the correct user certificate. ๐Ÿ”
  • Section 4.3: RSA with SHA-256 (PKCS #1 v1.5) added as MUST; DSA with SHA-256 added as SHOULD+; RSA with SHA-1, DSA with SHA-1, and RSA with MD5 changed to SHOULD-; and RSASSA-PSS with SHA-256 added as SHOULD+. Updated key sizes and changed pointer to PKIX RFCs. ๐Ÿ”‘ the SHA-1 and MD5 ones getting demoted is so real ๐Ÿ’€
  • Section 4.4.1: Aligned with PKIX on the use of a basicConstraints extension in CA certificates. Clarified which extension is used to constrain end entities from using their keys to perform issuing-authority operations. ๐Ÿ›๏ธ
  • Section 5: Updated security considerations. ๐Ÿ›ก๏ธ
  • Section 6: Moved references from Appendix A of RFC 3850 to this section. Updated the references. ๐Ÿ“š
  • Appendix A: Added Appendix A to move S/MIME v2 Certificate Handling to Historic status. ๐Ÿ•ฐ๏ธ

1.6. Changes since S/MIME 3.2 ๐Ÿš€

this is the v4.0 era and it's giving main character energy โœจ the RFC 2119 language ("MUST", "SHOULD", etc.) used for v3.2 may have been superseded by S/MIME v4.0 and may be superseded by future versions too, so stay alert ๐Ÿ‘€

  • Section 3: Support for internationalized email addresses is required. ๐ŸŒ
  • Section 4.3: Mandated support for the Elliptic Curve Digital Signature Algorithm (ECDSA) with P-256 and the Edwards-curve Digital Signature Algorithm (EdDSA) with curve25519 [RFC8410]. SHA-1 and MD5 algorithms are marked as historical, as they are no longer considered secure. As the Digital Signature Algorithm (DSA) has been replaced by elliptic curve versions, support for DSA is now considered historical. Increased lower bounds on RSA key sizes. ๐Ÿ”โšก bye bye old algorithms, we don't miss you ๐Ÿ˜ญ
  • Appendix A: Added Appendix A for algorithms that are now considered to be historical. ๐Ÿบ

2. CMS Options ๐ŸŽ€

okay so the CMS message format has SO many options for content and algorithm support, it's honestly a lot ๐Ÿ˜ตโ€๐Ÿ’ซ this section sets out a bunch of support requirements and recommendations so every S/MIME implementation can reach a base level of interoperability. the bulk of the CMS format for S/MIME messages is defined in [RFC8551] ๐Ÿ’–

2.1. Certificate Revocation Lists ๐Ÿ“œ

Receiving agents MUST support the CRL format defined in [RFC5280]. If sending agents include CRLs in outgoing messages, the CRL format defined in [RFC5280] MUST be used. Receiving agents MUST support both v1 and v2 CRLs.

All agents MUST be capable of performing revocation checks using CRLs as specified in [RFC5280]. All agents MUST perform revocation status checking in accordance with [RFC5280]. Receiving agents MUST recognize CRLs in received S/MIME messages. ๐Ÿ”

Agents SHOULD store CRLs received in messages for use in processing later messages. ๐Ÿ—‚๏ธ

2.2. Certificate Choices ๐ŸŽ€

Receiving agents MUST support v1 X.509 and v3 X.509 certificates as profiled in [RFC5280]. End-entity certificates MAY include an Internet mail address, as described in Section 3. ๐Ÿ’Œ

Receiving agents SHOULD support X.509 version 2 ACs. See [RFC5755] for details about the profile for ACs. ๐Ÿชช

2.2.1. Historical Note about CMS Certificates ๐Ÿ•ฐ๏ธ

the CMS message format supports a choice of certificate formats for public key content types: PKIX, PKCS #6 extended certificates [PKCS6], and PKIX ACs. it's a whole buffet ๐Ÿฐ

the PKCS #6 format isn't in widespread use. plus, PKIX certificate extensions cover much of the same functionality and flexibility that PKCS #6 certificate extensions were meant to provide, so it's kind of redundant ๐Ÿ™ƒ which is why sending and receiving agents MUST NOT use PKCS #6 extended certificates. receiving agents MUST be able to parse and process a message containing PKCS #6 extended certificates, although ignoring those certificates is expected behavior. โœ…

X.509 version 1 ACs also aren't widely implemented, and version 2 ACs have replaced them. sending agents MUST NOT send version 1 ACs. bye ๐Ÿ‘‹

2.3. Included Certificates ๐ŸŽ

receiving agents MUST be able to handle an arbitrary number of certificates of arbitrary relationship to the message sender and to each other in arbitrary order. ๐ŸŒ€ that's a big ask but it's the rule

in a lot of cases, the certificates in a signed message form a chain of certification from the sender to a particular root. but sometimes the certificates in a signed message are unrelated and only included for convenience ๐Ÿคทโ€โ™€๏ธ

Receiving agents MUST be able to handle an arbitrary number of certificates of arbitrary relationship to the message sender and to each other in arbitrary order. In many cases, the certificates included in a signed message may represent a chain of certification from the sender to a particular root. There may be, however, situations where the certificates in a signed message may be unrelated and included for convenience.

Sending agents SHOULD include any certificates for the user's public key(s) and associated issuer certificates. this makes it way more likely that the intended recipient can trust the originator's public key(s) ๐Ÿซถ it matters most when sending to people who may not have any other way to get the sender's public key, or when sending a signed message to someone new. including certificates in outgoing messages can be skipped if S/MIME objects only go around a group of correspondents who already have access to each other's certificates some other way, like a shared directory or manual certificate distribution ๐Ÿ“‚. and receiving S/MIME agents SHOULD be able to handle messages without certificates by using a database or directory lookup scheme to find them ๐Ÿ”Ž

A sending agent SHOULD include at least one chain of certificates up to, but not including, a CA that it believes that the recipient may trust as authoritative. A receiving agent MUST be able to handle an arbitrarily large number of certificates and chains. ๐Ÿงฉ

Agents MAY send CA certificates -- that is, cross-certificates, self-issued certificates, and self-signed certificates. ngl receiving agents SHOULD NOT simply trust any self-signed certificates as valid CAs. instead they SHOULD use some other mechanism to decide whether a CA should be trusted ๐Ÿšฉ also, when certificates contain DSA public keys, the parameters may live in the root certificate. this means the recipient needs both the end-entity certificate and the root certificate to verify a signature, and it's a valid example of when sending the root certificate may be required ๐ŸŒณ

Receiving agents MUST support chaining based on the distinguished name fields. Other methods of building certificate chains MAY be supported. ๐Ÿ”—

Receiving agents SHOULD support the decoding of X.509 ACs included in CMS objects. all other issues about generating and using X.509 ACs are outside the scope of this spec. one specification that covers AC use is [RFC3114] ๐Ÿ“˜

3. Using Distinguished Names for Internet Mail ๐Ÿ“ง

End-entity certificates MAY contain an Internet mail address. email addresses restricted to 7-bit ASCII characters use the pkcs-9-at-emailAddress object identifier (OID) (see below) and get encoded as described in Section 4.2.1.6 of [RFC5280]. internationalized email address names use the OID defined in [RFC8398] and are encoded as described there ๐ŸŒ the email address SHOULD be in the subjectAltName extension and SHOULD NOT be in the subject distinguished name ๐Ÿ’…

Receiving agents MUST recognize and accept certificates that contain no email address. agents are allowed to provide an alternative way of linking an email address to a certificate that doesn't have one, like through the agent's address book, if they have one ๐Ÿ“’ receiving agents MUST recognize both ASCII and internationalized email addresses in the subjectAltName extension. receiving agents MUST also recognize email addresses in the distinguished name field in the PKCS #9 [RFC2985] emailAddress attribute:

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

Note that this attribute MUST be encoded as IA5String and has an upper bound of 255 characters. โš ๏ธ comparing email addresses is fraught with peril ๐Ÿ˜ญ [RFC8398] defines the procedure for comparing internationalized email addresses. for ASCII email addresses, the domain component (the right-hand side of the '@') MUST be compared using a case-insensitive function. the local name component (the left-hand side of the '@') SHOULD be compared using a case-insensitive function. some localities may do other transformations on the local name component before comparing, but an S/MIME client cannot know what specific localities do ๐ŸŒ

Sending agents SHOULD make the address in the From or Sender header in a mail message match an Internet mail address in the signer's certificate. Receiving agents MUST check that the address in the From or Sender header of a mail message matches an Internet mail address in the signer's certificate, if mail addresses are present in the certificate. a receiving agent SHOULD provide some explicit alternate processing if this comparison fails ๐Ÿšจ this might mean displaying or logging a message that shows the recipient the mail addresses in the certificate or other certificate details ๐Ÿ”

A receiving agent SHOULD display a subject name or other certificate details when displaying an indication of successful or unsuccessful signature verification. โœ…โŒ

All subject and issuer names MUST be populated (i.e., not an empty SEQUENCE) in S/MIME-compliant X.509 certificates, except that the subject distinguished name in a user's (i.e., an end entity's) certificate MAY be an empty SEQUENCE. in that case, the subjectAltName extension will include the subject's identifier and MUST be marked as critical. ๐Ÿซง

4. Certificate Processing โœจ

okay so S/MIME agents need some way to fetch certificates for the people they're sending digital envelopes to ๐Ÿ’Œ. There are lots of ways to do that. [X.500] directory service is a really good example of a retrieval-only mechanism that works with classic X.500 distinguished names ๐ŸŽ€. The IETF also published [RFC8162], an experimental protocol for grabbing certificates from the Domain Name System (DNS) ๐ŸŒ. Until these are widely used, though, they can only help so much, because you can only get the few certificates your correspondent actually has up there. At the very least, for the first S/MIME rollout, a user agent could automatically send the intended recipient a message asking for their certificate in a signed reply ๐Ÿ“จ.

Receiving and sending agents SHOULD also give users a way to "store and protect" certificates for their correspondents, so they can be retrieved later on ๐Ÿ’พ. In lots of setups it makes sense to link the retrieval and storage mechanisms together in some kind of certificate database ๐Ÿ—‚๏ธ. In its simplest form, that database is local to one user and works like an "address book" for their frequent correspondents ๐Ÿ“’. That means the retrieval mechanism is only limited to the certificates the user has already stored (probably from incoming messages). A really thorough solution might combine two or more mechanisms for maximum flexibility ๐Ÿงฉ. For example, a secure Internet mail agent might check a centralized retrieval mechanism when a certificate isn't in the user's local storage database ๐Ÿ”.

Receiving and sending agents SHOULD provide a way to import and export certificates using a CMS certs-only message ๐Ÿ“ฆ. This lets you move full certificate chains around, not just a single certificate. It's described in [RFC8551] ๐Ÿ“–.

Agents MUST handle multiple valid CA certificates that have the same subject name and the same public keys, but overlapping validity intervals ๐Ÿซถ.

4.1. Certificate Revocation Lists

Honestly, it's always better to get the latest CRL information straight from a CA than to rely on whatever was stored in an incoming message ๐Ÿ™…โ€โ™€๏ธ. A receiving agent SHOULD have access to some CRL retrieval mechanism, so it can get certificate revocation information when it validates certification paths ๐Ÿ”. A receiving or sending agent SHOULD also provide a way for users to store incoming certificate revocation information for their correspondents, so it can be retrieved later on ๐Ÿ’œ.

Receiving and sending agents SHOULD retrieve and use CRL information every single time a certificate gets verified as part of certification path validation, even if that certificate was already verified before ๐Ÿ”. BUT (and this is a big but ๐Ÿ˜ญ) in plenty of situations, like off-line verification, getting the latest CRL information is hard or impossible. So how much you rely on CRL information may depend on how valuable the protected information is ๐Ÿ’Ž. How valuable CRL information is in a particular context is out of scope for this spec, but it might be set by the policies attached to particular certification paths ๐Ÿ“œ.

All agents MUST be capable of performing revocation checks using CRLs as specified in [RFC5280]. All agents MUST perform revocation status checking in accordance with [RFC5280]. Receiving agents MUST recognize CRLs in received S/MIME messages ๐Ÿ™Œ.

4.2. Certificate Path Validation

When you're building a user agent for secure messaging, certificate, CRL, and certification path validation should be super automated while still looking out for the user's best interests ๐Ÿค–๐Ÿ’…. Certificate, CRL, and path validation MUST be performed as per [RFC5280] whenever you validate a correspondent's public key ๐Ÿ”‘. This matters because you need it before using a public key for security stuff like verifying a signature, encrypting a content-encryption key (e.g., RSA), or forming a pairwise symmetric key (e.g., Diffie-Hellman) that's used to encrypt or decrypt a content-encryption key ๐Ÿ›ก๏ธ.

Certificates and CRLs reach the path validation procedure in two ways: a) incoming messages and b) certificate and CRL retrieval mechanisms ๐Ÿ›ฃ๏ธ. Certificates and CRLs in incoming messages don't have to show up in any particular order, and they don't have to be related to the sender or recipient of the message (although most of the time they will be related to the sender ๐Ÿซ ). Incoming certificates and CRLs SHOULD be cached for path validation, and optionally stored for later use ๐Ÿ—ƒ๏ธ. This temporary certificate and CRL cache SHOULD be used to supplement any other certificate and CRL retrieval mechanisms for path validation on incoming signed messages โœจ.

When you verify a signature and the certificates included in the message, if a signingCertificate attribute from RFC 2634 [ESS] or a signingCertificateV2 attribute from RFC 5035 [ESS] shows up in an S/MIME message, it SHALL be used to identify the signer's certificate ๐ŸŽฏ. Otherwise, the certificate is identified in an S/MIME message using either (1) the issuerAndSerialNumber, which identifies the signer's certificate by the issuer's distinguished name and the certificate serial number, or (2) the subjectKeyIdentifier, which identifies the signer's certificate by a key identifier ๐Ÿ†”.

When you decrypt an encrypted message, if an SMIMEEncryptionKeyPreference attribute shows up in an encapsulating SignedData, it SHALL be used to identify the originator's certificate found in OriginatorInfo ๐Ÿ•ต๏ธโ€โ™€๏ธ. See [RFC5652] for the CMS fields that reference the originator's and recipient's certificates ๐Ÿ“š.

4.3. Certificate and CRL Signing Algorithms, and Key Sizes

Certificates and CRLs get signed by the certificate issuer โœ๏ธ. Receiving agents:

  • MUST support ECDSA with curve P-256 with SHA-256.
  • MUST support EdDSA with curve25519 using PureEdDSA mode.
  • MUST- support RSA PKCS #1 v1.5 with SHA-256.
  • SHOULD support the RSA Probabilistic Signature Scheme (RSASSA-PSS) with SHA-256.

Implementations SHOULD use deterministic generation for the parameter 'k' for ECDSA, as outlined in [RFC6979]. EdDSA is defined to generate this parameter deterministically ๐Ÿง .

Here are the RSA and RSASSA-PSS key size requirements for S/MIME receiving agents during certificate and CRL signature verification ๐Ÿ”ข:

        key size <= 2047 : SHOULD NOT (see Appendix A)
2048 <= key size <= 4096 : MUST (see Security Considerations)
4096 <  key size         : MAY  (see Security Considerations)

The signature algorithm OIDs for RSA PKCS #1 v1.5 and RSASSA-PSS with SHA-256 using 1024-bit through 3072-bit public keys are specified in [RFC4055], and the signature algorithm definition is found in [FIPS186-2] with Change Notice 1 ๐Ÿ“.

The signature algorithm OIDs for RSA PKCS #1 v1.5 and RSASSA-PSS with SHA-256 using 4096-bit public keys are specified in [RFC4055], and the signature algorithm definition is found in [RFC3447] ๐Ÿงฎ.

For RSASSA-PSS with SHA-256, see [RFC4056] ๐Ÿ’ซ.

For ECDSA, see [RFC5758] and [RFC6090]. The first reference gives you the signature algorithm's OID, and the second gives you the signature algorithm's definition ๐ŸŒˆ. Curves other than curve P-256 MAY be used as well.

For EdDSA, see [RFC8032] and [RFC8410]. The first reference gives you the signature algorithm's OID, and the second gives you the signature algorithm's definition ๐Ÿฆ‹. Curves other than curve25519 MAY be used as well.

4.4. PKIX Certificate Extensions

PKIX describes an extensible framework where the basic certificate information can be extended, and it describes how those extensions can control the process of issuing and validating certificates ๐Ÿงฉ. The LAMPS Working Group is always working on identifying and creating extensions that are valuable in particular certification environments ๐Ÿ› ๏ธ. There are also active efforts to issue PKIX certificates for business purposes ๐Ÿ’ผ. This document identifies the minimum required set of certificate extensions that give the most value in the S/MIME environment ๐Ÿ‘‘. The syntax and semantics of all the identified extensions are defined in [RFC5280] ๐Ÿ“–.

Sending and receiving agents MUST correctly handle the basic constraints, key usage, authority key identifier, subject key identifier, and subject alternative name certificate extensions when they appear in end-entity and CA certificates ๐Ÿ’ช. Some mechanism SHOULD exist to gracefully handle other certificate extensions when they show up in end-entity or CA certificates ๐Ÿซง.

Certificates issued for the S/MIME environment SHOULD NOT contain any critical extensions (extensions that have the critical field set to TRUE) other than the ones listed here ๐Ÿšซ. These extensions SHOULD be marked as non-critical, unless proper handling of the extension is deemed critical to the correct interpretation of the associated certificate ๐Ÿ™ˆ. Other extensions may be included, but those extensions SHOULD NOT be marked as critical ๐Ÿ“.

Interpretation and syntax for all extensions MUST follow [RFC5280], unless otherwise specified here ๐Ÿ“š.

4.4.1. Basic Constraints

The basicConstraints extension is what delimits the role and position an issuing-authority or end-entity certificate plays in a certification path ๐Ÿ—บ๏ธ.

For example, certificates issued to CAs and subordinate CAs contain a basicConstraints extension that marks them as issuing-authority certificates ๐Ÿ‘‘. End-entity certificates contain the key usage extension, which stops end entities from using the key when they perform issuing-authority operations (see Section 4.4.2) ๐Ÿ”’.

As per [RFC5280], certificates MUST contain a basicConstraints extension in CA certificates and SHOULD NOT contain that extension in end-entity certificates ๐Ÿง.

4.4.2. Key Usage Extension

The key usage extension limits the technical purposes a public key in a valid certificate can be used for ๐ŸŽฏ. Issuing-authority certificates may contain a key usage extension that restricts the key to signing certificates, CRLs, and other data ๐Ÿ–Š๏ธ.

For example, a CA may create subordinate issuer certificates with a key usage extension that says the corresponding public key can be used to sign end-user certificates and CRLs ๐Ÿ’….

If a key usage extension is included in a PKIX certificate, then it MUST be marked as critical ๐Ÿšจ.

S/MIME receiving agents MUST NOT accept the signature of a message if it was verified using a certificate that has a key usage extension without at least one of the digitalSignature or nonRepudiation bits set ๐Ÿ™…โ€โ™€๏ธ. Sometimes S/MIME is used as a secure message transport for apps beyond interpersonal messaging. In those cases, the S/MIME-enabled application can set additional requirements about the digitalSignature or nonRepudiation bits within this extension ๐Ÿงš.

If the key usage extension isn't specified, receiving clients MUST presume that both the digitalSignature and nonRepudiation bits are set ๐Ÿ’–.

4.4.3. Subject Alternative Name โœจ

Okay so the subject alternative name extension is S/MIME's favourite way to say "this is the email address that belongs to this certificate" ๐Ÿ’Œ It's the preferred route, and honestly it's the main character here. If the local part of the email address is ASCII, it MUST be encoded using the rfc822Name CHOICE of the GeneralName type, as described in [RFC5280], Section 4.2.1.6. If the local part is not ASCII, it MUST be encoded using the otherName CHOICE of the GeneralName type instead, as described in [RFC8398], Section 3. And since SubjectAltName is a SEQUENCE OF GeneralName, multiple email addresses MAY be present ๐Ÿซถ One bestie is never enough.

4.4.4. Extended Key Usage Extension ๐Ÿฆ‹

The extended key usage extension also helps limit what a public key in a valid certificate can be used for ๐Ÿ” The technical purposes of the certificate are the intersection of the uses in the key usage extension and the extended key usage extension. In plain words, it's the overlap where both of them agree ๐Ÿ’…

For example, say the certificate has a key usage extension indicating a digital signature, and an extended key usage extension that includes the id-kp-emailProtection OID. Then the certificate may be used for signing but not encrypting S/MIME messages โœ๏ธ Now say the certificate has a key usage extension indicating a digital signature but no extended key usage extension at all. Then it may also be used to sign but not encrypt S/MIME messages. Same vibe, different setup ๐ŸŒธ

If the extended key usage extension is present in the certificate, then interpersonal-message S/MIME receiving agents MUST check that it contains either the id-kp-emailProtection OID or the anyExtendedKeyUsage OID as defined in [RFC5280]. This part is non-negotiable ๐Ÿ˜ค S/MIME uses other than interpersonal messaging MAY require the explicit presence of the extended key usage extension, the presence of other OIDs in the extension, or both. Those other uses can be a little pickier ๐Ÿงš


5. IANA Considerations ๐ŸŒธ

This document has no IANA actions. Zero registry drama, zero chaos ๐Ÿ™Œ

6. Security Considerations ๐Ÿ”ฅ

Every security issue that any cryptographic application has to deal with, an S/MIME agent has to deal with too ๐Ÿ˜ญ That means protecting the user's private key, preventing various attacks, and helping the user avoid mistakes like accidentally encrypting a message for the wrong recipient. The full list is way beyond this document, but here are some of the big ones ๐Ÿ’€

When processing certificates, there are lots of situations where things can go wrong. Because the processing might be done by a user agent, a security gateway, or some other program, there isn't one single way to handle every failure. Just because the failure handling isn't listed here doesn't mean it isn't important, though. The opposite is true! If a certificate is not provably valid and associated with the message, the processing software should take immediate and noticeable steps to tell the end user about it ๐Ÿšจ

Some of the many places where signature and certificate checking might fail include the following:

  • no Internet mail addresses in a certificate match the sender of a message, if the certificate contains at least one mail address
  • no certificate chain leads to a trusted CA
  • no ability to check the CRL for a certificate is implemented
  • an invalid CRL was received
  • the CRL being checked is expired
  • the certificate is expired
  • the certificate has been revoked

There are definitely other ways a certificate can be invalid too ๐Ÿ‘€ It's the processing software's job to check them all thoroughly and decide what to do when a check fails ๐Ÿ’…

It's possible for a CA to have multiple unexpired CRLs. If an agent is consulting CRLs for certificate validation, it SHOULD make sure that the most recently issued CRL for that CA is consulted. Why? Because an S/MIME message sender could deliberately include an older unexpired CRL in an S/MIME message ๐Ÿ˜ˆ That older CRL might not list recently revoked certificates, and that's how an agent could end up accepting a certificate that was revoked in a later CRL. Yikes ๐Ÿ™ˆ

When determining the time for a certificate validity check, agents have to be careful to use a reliable time โฐ In most cases, the time used SHOULD be the current time. There are a couple of exceptions:

  • The time the message was received is stored in a secure manner and is used at a later time to validate the message.
  • The time in a SigningTime attribute is found in a countersignature attribute [RFC5652] that has been successfully validated.

The signingTime attribute could be deliberately set to a time where the receiving agent would (1) use a CRL that does not contain a revocation for the signing certificate, or (2) use a certificate that has expired or is not yet valid. This could be done by either (1) the sender of the message or (2) an attacker that has compromised the key of the sender. Sneaky, sneaky ๐Ÿฆนโ€โ™€๏ธ

In addition to the security considerations identified in [RFC5280], caution should be taken when processing certificates that have not first been validated to a trust anchor ๐Ÿง Certificates could be manufactured by untrusted sources to mount denial-of-service attacks or other attacks. For example, keys selected to require excessive cryptographic processing, or extensive lists of CRL Distribution Point (CDP) and/or Authority Information Access (AIA) addresses in the certificate, could be used to mount denial-of-service attacks. Similarly, attacker-specified CDP and/or AIA addresses could be included in fake certificates to let the originator detect receipt of the message even if signature verification fails ๐Ÿ•ต๏ธ

RSA keys of less than 2048 bits are now considered by many experts to be cryptographically insecure (because computing power keeps getting better) ๐Ÿ’€ They SHOULD no longer be used to sign certificates or CRLs. These keys used to be considered secure, so processing previously received signed and encrypted mail may mean processing certificates or CRLs signed with weak keys. Implementations that want to support previous versions of S/MIME or process old messages need to weigh the security risks of accepting certificates and CRLs with smaller key sizes (e.g., spoofed certificates) against the costs of denial of service. If an implementation supports verification of certificates or CRLs generated with RSA and DSA keys of less than 2048 bits, it MUST warn the user. Implementers should consider giving a stronger warning for weak signatures on certificates and CRLs associated with newly received messages than the one given for certificates and CRLs associated with previously stored messages. Server implementations (e.g., secure mail list servers) where user warnings are not appropriate SHOULD reject messages with weak cryptography ๐Ÿ›ก๏ธ

If an implementation is concerned about compliance with National Institute of Standards and Technology (NIST) key size recommendations, then see [SP800-57] ๐Ÿ“–

7. References ๐Ÿ“š

7.1. Reference Conventions ๐ŸŽ€

[ESS] refers to [RFC2634] and [RFC5035].

[SMIMEv2] refers to [RFC2311], [RFC2312], [RFC2313], [RFC2314], and [RFC2315].

[SMIMEv3] refers to [RFC2630], [RFC2631], [RFC2632], [RFC2633], [RFC2634], and [RFC5035].

[SMIMEv3.1] refers to [RFC2634], [RFC3850], [RFC3851], [RFC3852], and [RFC5035].

[SMIMEv3.2] refers to [RFC2634], [RFC5035], [RFC5652], [RFC5750], and [RFC5751].

[SMIMEv4] refers to [RFC2634], [RFC5035], [RFC5652], [RFC8551], and this document ๐Ÿ’œ

7.2. Normative References ๐Ÿ“šโœจ

okay bestie, these are the sources the spec leans on so hard it can't function without them ๐Ÿ’… I'm keeping every single one, DOI and link included, so you can go check them yourself ๐Ÿซถ


7.3. Informative References ๐ŸŒธ

these ones are the extra reading ๐Ÿ“– nice to have, not strictly required, but they're full of the background bits if you're curious ๐Ÿงš


Appendix A. Historic Considerations ๐Ÿ•ฐ๏ธ๐Ÿ’–

A.1. Signature Algorithms and Key Sizes

okay so validating certificates on sufficiently historic messages is kinda messy ๐Ÿ˜ญ๐ŸŽ€ There are a bunch of problems, which is why it is strongly suggested that user agents treat these certificates differently from the ones on current messages โœจ The problems include the following:

  • CAs are not required to keep certificates on a CRL beyond one update after a certificate has expired ๐Ÿ™ˆ This means that unless CRLs are cached as part of the message, it is not always possible to check to see if a certificate has been revoked. The same problems exist with Online Certificate Status Protocol (OCSP) responses, since they may be based on a CRL rather than on the certificate database.
  • RSA and DSA keys of less than 2048 bits are now considered by many experts to be cryptographically insecure (due to advances in computing power) ๐Ÿ’€ Such keys used to be considered secure, so processing historic certificates will often result in the use of weak keys. Implementations that wish to support previous versions of S/MIME or process old messages need to consider the security risks that result from smaller key sizes (e.g., spoofed messages) versus the costs of denial of service.

[SMIMEv3.2] set the lower limit on suggested key sizes for creating and validation at 1024 bits. [SMIMEv3.1] set the lower limit at 768 bits. Prior to that, the lower bound on key sizes was 512 bits. ๐Ÿ“

  • Hash functions used to validate signatures on historic messages may no longer be considered secure (see below) ๐Ÿซ  While there are not currently any known practical pre-image or second pre-image attacks against MD5 or SHA-1, the fact that they are no longer considered to be collision resistant means the security level of any signature created with these hash algorithms should also be considered suspect.

The following algorithms have been called out for some level of support by previous S/MIME specifications, so let's look at the tea โ˜•

  • RSA with MD5 was dropped in [SMIMEv4]. MD5 is no longer considered to be secure, as it is no longer collision resistant. Details can be found in [RFC6151] ๐Ÿ’…
  • RSA and DSA with SHA-1 were dropped in [SMIMEv4]. SHA-1 is no longer considered to be secure, as it is no longer collision resistant. The IETF statement on SHA-1 can be found in [RFC6194], but it is out of date relative to the most recent advances ๐Ÿฅ€
  • DSA with SHA-256 support was dropped in [SMIMEv4]. DSA was dropped as part of a general movement from finite fields to elliptic curves ๐ŸŒˆ Issues related to dealing with non-deterministic generation of the parameter 'k' have come up (see [RFC6979]).

For 512-bit RSA with SHA-1, see [RFC3279] and [FIPS186-2] without Change Notice 1. For 512-bit RSA with SHA-256, see [RFC4055] and [FIPS186-2] without Change Notice 1. The first reference provides the signature algorithm's OID, and the second provides the signature algorithm's definition ๐Ÿงš

For 512-bit DSA with SHA-1, see [RFC3279] and [FIPS186-2] without Change Notice 1. For 512-bit DSA with SHA-256, see [RFC5758] and [FIPS186-2] without Change Notice 1. For 1024-bit DSA with SHA-1, see [RFC3279] and [FIPS186-2] with Change Notice 1. For 1024-bit through 3072-bit DSA with SHA-256, see [RFC5758] and [FIPS186-3]. The first reference provides the signature algorithm's OID, and the second provides the signature algorithm's definition ๐Ÿฆ‹


Appendix B. Moving S/MIME v2 Certificate Handling to Historic Status ๐Ÿ“

The S/MIME v3 [SMIMEv3], v3.1 [SMIMEv3.1], v3.2 [SMIMEv3.2], and v4.0 (this document) specifications are backward compatible with the S/MIME v2 Certificate Handling Specification [SMIMEv2], with the exception of the algorithms (dropped RC2/40 requirement, and added DSA and RSASSA-PSS requirements). Therefore, RFC 2312 [SMIMEv2] was moved to Historic status ๐Ÿ‘‘

Acknowledgements ๐Ÿซถ

Many thanks go out to the other authors of the S/MIME v2 Certificate Handling RFC: Steve Dusse, Paul Hoffman, and Jeff Weinstein. Without v2, there wouldn't be a v3, v3.1, v3.2, or v4.0 ๐Ÿ˜ญ๐Ÿ’–

A number of the members of the S/MIME Working Group have also worked very hard and contributed to this document. Any list of people is doomed to omission, and for that I apologize ๐ŸŒธ In alphabetical order, the following people stand out in my mind because they made direct contributions to this document.

Bill Flanigan, Trevor Freeman, Elliott Ginsburg, Alfred Hoenes, Paul Hoffman, Russ Housley, David P. Kemp, Michael Myers, John Pawling, and Denis Pinkas.

The version 4 update to the S/MIME documents was done under the auspices of the LAMPS Working Group โœจ๐ŸŒˆ

Authors' Addresses ๐Ÿ’Œ

Jim Schaad August Cellars

Email: ietf@augustcellars.com

Blake Ramsdell Brute Squad Labs, Inc.

Email: blaker@gmail.com

Sean Turner sn3rd

Email: sean@sn3rd.com

๐Ÿ“ฆ where this page comes from