Back to DashboardProtocolsPhase 5 · Pilots & Migrationintermediate40 min

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.
Practice in the Simulation

S/MIME & CMS Overview

, defined in RFC 5652, is the foundational format for digitally signing and encrypting arbitrary data. It powers S/MIME (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

S/MIME Signing

Creates a CMS SignedData structure: the sender's private key signs a hash of the message, and recipients verify using the sender's certificate.

S/MIME Encryption

Creates a CMS AuthEnvelopedData structure (RFC 5083): the message is AEAD-encrypted (AES-GCM) with a random content-encryption key (CEK), which is then wrapped for each recipient.

Where CMS is used
• Email (S/MIME)• Document signing• Code signing• Timestamping• PDF signatures• SCEP / EST• Firmware updates• eIDAS signatures

PQC in CMS

The IETF 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 provide a complete PQC story for CMS: ML-DSA for signing (RFC 9882), KEM-based encryption via KEMRecipientInfo (RFC 9629), RSA-KEM as a transitional KEM option (RFC 9690), and HSS/LMS for hash-based firmware and long-lived signatures (RFC 9708). See the References tab for full details on each standard.

KEM vs Key Transport

Classical S/MIME encryption uses RSA key transport: the sender encrypts the CEK directly with the recipient's RSA public key. PQC replaces this with a Key Encapsulation Mechanism (KEM) — a fundamentally different approach.

Classical: Key Transport
Generate random CEK
↓
RSA-OAEP encrypt CEK with recipient's public key
↓
Store encryptedKey in KeyTransRecipientInfo

The CEK is directly encrypted — vulnerable to Shor's algorithm.

PQC: KEM + Key Wrap
KEM Encapsulate → shared secret + ciphertext
↓
KDF (HKDF-SHA256) → key-wrap key from shared secret
↓
AES-WRAP the CEK with derived key
↓
Store kemct + wrappedCEK in KEMRecipientInfo

No direct encryption of CEK — quantum-resistant shared secret derivation.

Why KEMs replace key transport

Post-quantum public-key encryption (like lattice-based encryption) is less efficient and harder to standardize than KEM + symmetric key wrap. NIST standardized ML-KEM (FIPS 203) as a KEM primitive, not a public-key encryption scheme. RFC 9629 bridges this gap by defining KEMRecipientInfo, a new CMS structure that replaces KeyTransRecipientInfo.

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.

Signing Certificate
  • • keyUsage: digitalSignature, nonRepudiation
  • • extKeyUsage: id-kp-emailProtection
  • • subjectAltName: rfc822Name (email)
  • • Algorithm: ML-DSA-65 or ECDSA P-256
Encryption Certificate
  • • keyUsage: keyEncipherment (RSA) or keyAgreement (ECDH). KEM keyUsage is still being standardized
  • • 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 advertises supported algorithms, enabling gradual PQC rollout.

OpenPGP: the other email standard

S/MIME is not the only way mail and files get signed and encrypted. OpenPGP (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.

IDAlgorithm (RFC 9980)RoleRequirementReplaces
35ML-KEM-768+X25519Composite KEM (encryption)MUSTECDH / X25519, RSA key transport
36ML-KEM-1024+X448Composite KEM (encryption)SHOULDECDH / X448
30ML-DSA-65+Ed25519Composite signatureMUSTEdDSA, RSA, ECDSA signatures
31ML-DSA-87+Ed448Composite signatureSHOULDEdDSA (Ed448)
32–34SLH-DSA-SHAKE-128s / 128f / 256sStandalone signatureMAYLong-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 uniquely challenging because S/MIME requires bidirectional compatibility — both sender and recipient must support the same algorithms. This creates a chicken-and-egg problem that doesn't exist in TLS (where servers can unilaterally upgrade).

Dual-Algorithm Certificates

During transition, organizations must issue both classical and PQC certificates for each user. Certificate management complexity doubles.

Recipient Capability Discovery

Senders must discover which algorithms each recipient supports before encrypting. The smimeCapabilities attribute and LDAP directory lookups become critical.

Message Size Impact

ML-DSA-65 signatures are ~3.3 KB (3,309 B, FIPS 204; vs ~72 bytes DER-encoded for ECDSA). Signed emails with certificate chains can grow by 10-15 KB, impacting mobile clients and constrained networks.

Archival & Long-Term Validation

Signed emails must remain verifiable for years or decades. Organizations need both classical and PQC signatures during the transition to ensure long-term validation.

Gateway & Relay Compatibility

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.

In the Industry Landscape

Check your understanding

10 questions on Email & Document Signing, each with its answer and the reason.

Take the quiz

Next step

Practice it: S/MIME & CMS Workshop

S/MIME & CMS Workshop is the hands-on version of this module: the same ideas, run in your browser.

Learning module content can be inaccurate. Please double-check its information. Report inaccuracies in PQC Today GitHub Discussions.