Email & Document Signing (S/MIME, CMS)
Master CMS structures for email signing and encryption — from classical S/MIME to post-quantum KEMs.
Why this matters: Signatures are long-lived: one trusted for 10 years must resist a quantum attacker who shows up in year 5.
Start here: Walk the CMS SignedData workflow in step 2: the ASN.1 structure is shown field by field, so you see where the ML-DSA signature and its certificate sit.
For your role
- Developer / Engineer
- Compare classical and PQC certificate structures, walk the CMS SignedData workflow and its ASN.1, then compare RSA key transport with KEM-based encryption (RFC 9629); the live step loads OpenSSL WASM with the PKCS#11 provider.
- Security Architect
- The KEM-based encryption step (RFC 9629) replaces key transport with KEMRecipientInfo; the certificate-structure step shows what a PQC S/MIME certificate changes for relying parties.
- Researcher / Academic
- The CMS SignedData and AuthEnvelopedData structures are shown in ASN.1 with the RFC references; the live step runs real OpenSSL 3.6 through the PKCS#11 provider.
- Curious Explorer
- A signature on an email has to be trustworthy for years; this module shows what a signed and an encrypted message are made of and what changes for post-quantum algorithms.
S/MIME & CMS Overview
, defined in RFC 5652, is the foundational format for digitally signing and encrypting arbitrary data. It powers (Secure/Multipurpose Internet Mail Extensions), the standard for end-to-end email security used by enterprises, governments, and military organizations worldwide.
“CMS is used to digitally sign, digest, authenticate, or encrypt arbitrary message content.”
— RFC 5652, Section 1
Creates a CMS SignedData structure: the sender's private key signs a hash of the message, and recipients verify using the sender's certificate.
Creates a CMS AuthEnvelopedData structure (RFC 5083): the message is AEAD-encrypted (-GCM) with a random content-encryption key (CEK), which is then wrapped for each recipient.
PQC in CMS
The LAMPS working group has published a series of RFCs that bring post-quantum cryptography into CMS. These standards define how PQC algorithms integrate with existing S/MIME infrastructure.
Together, these RFCs cover the main building blocks used in this module: ML-DSA for signing (RFC 9882), KEM-based encryption via KEMRecipientInfo (RFC 9629, with the ML-KEM conventions in RFC 9936), and for hash-based firmware and long-lived signatures (RFC 9708). See the References tab for full details on each standard.
RFC 9690 (RSA-KEM) is a different kind of entry. It puts RSA behind the same KEM interface; the RFC presents it as a replacement for PKCS #1 v1.5 key transport in new CMS applications, to avoid chosen-ciphertext weaknesses and gain a tighter security proof, and it ties the security of RSA-KEM to the RSA problem. Because that problem is what Shor's algorithm solves, RSA-KEM is a KEM but not a post-quantum KEM; ML-KEM is the post-quantum KEM here. These RFCs define message formats, not deadlines. Dates for retiring classical algorithms come from policy documents and apply to named algorithms and systems, so check the scope of the policy that applies to you before treating any date as a deadline for all email.
KEM vs Key Transport
Classical S/MIME encryption uses key transport: the sender encrypts the CEK directly with the recipient's RSA public key. PQC replaces this with a — a fundamentally different approach.
The CEK is directly encrypted — vulnerable to .
No direct encryption of CEK — quantum-resistant shared secret derivation.
standardized () as a KEM primitive, not a public-key encryption scheme: it produces a shared secret and a ciphertext, rather than encrypting the CEK itself. RFC 9629 bridges this gap by defining KEMRecipientInfo, a CMS structure carried as an OtherRecipientInfo (object identifier id-ori-kem). It adds a KEM-based way to deliver the CEK; it does not remove KeyTransRecipientInfo, and one message can carry either kind. Inside it, kemct (the KEM ciphertext, used to recompute the key-encryption key) and encryptedKey (the CEK wrapped under that key) are two separate ciphertexts with different purposes.
Certificate Requirements
S/MIME certificates carry specific extensions that bind an email address to a key pair and declare the permitted operations (signing vs encryption). PQC introduces new considerations for key usage and algorithm negotiation.
- • keyUsage: digitalSignature, nonRepudiation
- • extKeyUsage: id-kp-emailProtection
- • subjectAltName: rfc822Name (email)
- • Algorithm: -65 or P-256
- • keyUsage: keyEncipherment (RSA) or keyAgreement (). For ML-KEM certificates keyEncipherment is the only key usage set when keyUsage is present (RFC 9935 §5)
- • extKeyUsage: id-kp-emailProtection
- • subjectAltName: rfc822Name (email)
- • Algorithm: ML-KEM-768 or RSA-2048
In practice, users often have separate key pairs for signing and encryption. This is especially true for PQC migration, where signing keys (ML-DSA) and encryption keys (ML-KEM) use fundamentally different algorithms. The smimeCapabilities attribute in signed messages lists, in order of preference, algorithms the sender says it can handle (RFC 8551 section 2.5.2). It is a partial list, so a correspondent can use it to choose among the algorithms the sender lists, but the attribute does not carry out any migration.
OpenPGP: the other email standard
S/MIME is not the only way mail and files get signed and encrypted. (RFC 9580, the 2024 revision that introduced version 6 keys) has no X.509 certificates and no CA: keys carry their own identities and are trusted through signatures from other keys. Its PQC migration therefore arrives as new algorithm IDs inside keys and packets, not as new certificate profiles — and it is already a Proposed Standard: RFC 9980, Post-Quantum Cryptography in OpenPGP.
RFC 9980 takes a different line from the CMS RFCs above. Because lattice schemes are new, ML-KEM and ML-DSA are used only as PQ/T composites — each one is bound to an elliptic-curve partner so that, in the RFC's words, security is retained even if all schemes but one in the combination are broken. The one exception is SLH-DSA, whose hash-based security assumptions the RFC considers well enough understood to stand alone.
| ID | Algorithm (RFC 9980) | Role | Requirement | Replaces |
|---|---|---|---|---|
| 35 | ML-KEM-768+X25519 | Composite KEM (encryption) | MUST | ECDH / X25519, RSA key transport |
| 36 | ML-KEM-1024+X448 | Composite KEM (encryption) | SHOULD | ECDH / X448 |
| 30 | ML-DSA-65+Ed25519 | Composite signature | MUST | EdDSA, RSA, ECDSA signatures |
| 31 | ML-DSA-87+Ed448 | Composite signature | SHOULD | EdDSA (Ed448) |
| 32–34 | SLH-DSA-SHAKE-128s / 128f / 256s | Standalone signature | MAY | Long-lived signatures where a lattice assumption is unwanted |
A conformant implementation MUST implement ML-DSA-65+Ed25519 and ML-KEM-768+X25519; the 1024/448 pair is SHOULD. Deployment detail that bites: the PQ algorithms are for v6 keys only, with one exception — ML-KEM-768+X25519 (ID 35) is also allowed in v4 encryption-capable subkeys, so an existing v4 key can gain a post-quantum encryption subkey without a full key rollover, while PQ signing waits for a v6 primary key.
Compare with S/MIME: same primitives (ML-KEM, ML-DSA, SLH-DSA), same key-exchange → signature split, but OpenPGP mandates the hybrid pairing that LAMPS leaves to the deployment, and it has no certificate-profile work to do because it never had certificates. The Industry Landscape tracks this as the cross-industry use case “OpenPGP email & file encryption”.
Migration Challenges
Migrating email security to PQC is challenging because S/MIME needs compatibility between sender and recipient: the sender picks the algorithms before sending, using the recipient's certificate and any capability information it has (RFC 8551, Section 2.7.1), and the recipient must be able to use them. CMS encryption is store-and-forward — in RFC 9629's words, the originator and recipients do not need to be online at the same time — so nothing negotiates the choice at delivery time.
TLS also needs support at both ends: in TLS 1.3 a server may not send a key share for a group that the client did not list in its supported_groups extension (RFC 9846 key shares). The choice is negotiated live in each handshake that performs an asymmetric key exchange, so a server can add support first and clients that offer it benefit while others still connect with a classical group. Fallback of that kind keeps connections working but also means a classical-only peer gets classical protection, so deployment scope (which clients and servers can be updated) decides the outcome.
While some correspondents can only use classical algorithms, a user may need both a classical and a PQC certificate, which adds certificate management work.
Senders must find out which algorithms each recipient can handle before encrypting. The smimeCapabilities attribute (a signer's own partial list, in order of preference) and LDAP directory lookups are the places to look.
ML-DSA-65 signatures are ~3.3 KB (3,309 B, FIPS 204; vs ~72 bytes DER-encoded for ECDSA). As an illustration, one signature plus a leaf and an intermediate certificate that each carry a 1,952 B key and a 3,309 B signature add roughly 14 KB before base64 encoding, which matters for mobile clients and constrained networks.
A CMS message wraps one CEK once per RecipientInfo (RFC 5652, Section 6). If a sender adds both an RSA RecipientInfo and a KEMRecipientInfo for the same recipient so that either kind of client can open the message, anyone who can break the RSA entry recovers the same CEK, so confidentiality is that of the weakest decryption path the message allows. A cryptographically combined hybrid KEM instead merges the shared secrets of both algorithms into one key-encryption key; the IETF LAMPS composite ML-KEM work does this, and it was still an Internet-Draft, not an RFC, when this lesson was written.
These are two separate problems. To read an archived encrypted message later, someone must still hold a private key that can recover its CEK (RFC 9629: the recipient's private key is needed to recover the keying material); keeping that key preserves access but also keeps a long-lived target, so whether to retain, re-encrypt or store decrypted copies is a policy choice. To trust an archived signature later, you need evidence that it existed before its algorithm or certificate became unreliable: RFC 4998 describes timestamps renewed over time, and RFC 3161 time-stamp tokens carry a time value from a time-stamping authority, so the trustworthiness of that time source matters as much as the signature algorithm.
Email gateways, DLP systems, and archival solutions must understand PQC-signed CMS structures to avoid stripping or corrupting S/MIME attachments.
Related Resources
Explore S/MIME certificates, CMS signing structures, and KEM-based encryption.
Related modules
- MLS — Group MessagingSame track · Protocols · Same migration phase · Shares ML-DSA, JOSE
- TLS BasicsSame track · Protocols · Same migration phase · Shares ML-DSA, X.509
- API Security & JWTSame track · Protocols · Same migration phase · Shares ML-DSA, JOSE
- 5G SecuritySame migration phase · Shares ML-DSA, X.509
In the Industry Landscape
Check your understanding
10 questions on Email & Document Signing, each with its answer and the reason.
Take the quizNext step
Practice it: S/MIME & CMS WorkshopS/MIME & CMS Workshop is the hands-on version of this module: the same ideas, run in your browser.
Production Tool Capabilities & Verification ChecklistMessaging Architects & Enterprise PKI Engineers
Capabilities to require in your production tools:
- S/MIME 4.0 and CMS (RFC 5652 / RFC 9629 / RFC 9936) support for `KEMRecipientInfo` with `ML-KEM-768/1024` and `SignedData` with `ML-DSA` (RFC 9882) or `SLH-DSA` (RFC 9814).
- Automated recipient-capability discovery (S/MIME capabilities attribute or directory lookup) to select PQC vs classical encryption.
- Key-archival and escrow support for decapsulation private keys in enterprise KMS/HSM.
How to evaluate in your environment
Generate and verify CMS `SignedData` and `AuthEnvelopedData` (`KEMRecipientInfo`) using `openssl cms` (confirm KEMRecipientInfo support in your OpenSSL release) or another CMS toolkit, and test cross-client decryption in staging.
Production evidence to collect
ASN.1 dump (`openssl asn1parse`) showing `KEMRecipientInfo` (`id-ori-kem`, `1.2.840.113549.1.9.16.13.3`) with the `ML-KEM-768` key algorithm OID `2.16.840.1.101.3.4.4.2`, and verified signature receipt.
Completing this Hub module and its browser-based sample exercises teaches the technical and governance decision criteria for your role; it does not test, validate, or certify your deployed production systems.
Record evidence for your environment
Identify the tested build and configuration. Use reference IDs for observations. For a proposed exclusion, record the system boundary or rule and why it excludes this build.
Evidence missing. 0 of 3 requirements have a reference or scope rationale.
Learning module content can be inaccurate. Please double-check its information. Report inaccuracies in PQC Today GitHub Discussions.