skip to content

In S/MIME, why can you sign a message to anyone but encrypt only to correspondents whose certificate your mail client already holds?

level: juniorimportance: must knowfreq 48%

answer

  1. whose key does each operation use
  2. content key wrapped per recipient
  3. only a certificate supplies that key
  4. signed mail carries the sender's certificate

basics

~20 s

Signing uses your own private key, which you always hold. Encryption wraps the message key under each recipient's public key, found in their certificate, so the client must first obtain and trust it, usually from a signed message they sent.

solid answer

~40 s

An S/MIME signature is made with the sender's private key and checked with the sender's certificate, which the signed message normally carries itself, so you can sign to a stranger. Encryption runs the other way: the client generates a content-encryption key and wraps a copy of it for every recipient with that recipient's public key, and only the recipient's certificate supplies that key. With no certificate for an address, the client cannot encrypt to it at all. Clients fill the gap from signed mail the correspondent sent earlier (the certificates travel inside the signature), from an organisation's directory, from a certificate file exchanged out of band, or by asking the person for a signed reply, which RFC 8550 names as the minimum for a first deployment.

go deeper

for a junior

Recall which party's key each operation uses: signing with the sender's private key, encryption with each recipient's public key from their certificate.

for a middle

Explain where a client gets a correspondent's certificate: the certificates carried in signed mail, a directory, a certs-only file, or a request for a signed reply.

for a senior

Show that a found certificate is only a candidate: it must still validate, be current and name the address being written to before the client encrypts with it.

for a principal

Treat certificate distribution as the real cost of an encryption rollout, and weigh sign-by-default against publishing certificates in a directory.

## Two operations, two different keys S/MIME offers two protections for a mail message, and they use keys belonging to **different people**. Getting this straight is what explains why encryption stalls in a new rollout while signing does not. | Operation | Key used to apply it | Key used to check or open it | Who must find a certificate first | |---|---|---|---| | Signing | the **sender's private key** | the sender's public key, from the sender's certificate | the reader, but the message usually brings it | | Encryption | each **recipient's public key**, from that recipient's certificate | the recipient's private key | the **sender**, before writing | A **certificate** is a signed statement from a certification authority binding a public key to an identity, here a mailbox address. It never contains a private key. ## Why signing needs no lookup When a client signs, it uses a private key the user already holds. The resulting CMS `SignedData` structure has a field for certificates, and RFC 8550 (section 2.3) says sending agents SHOULD include the signer's certificate and the issuer certificates above it. That is especially important "when sending a signed message to a new recipient". So the recipient's client usually receives everything it needs to check the signature in the message itself, and the sender never had to look anything up. ## Why encryption needs a lookup first Encryption does not use the sender's key at all. The client: 1. generates a random **content-encryption key** and encrypts the body with it; 2. for each recipient, protects a copy of that content key with the recipient's **public key** (the details of the per-recipient structures belong to the material on encrypted message formats); 3. sends the result, which only a holder of one of the matching private keys can open. Step 2 is impossible without the recipient's certificate. If the client has no certificate for one address on the message, it cannot produce a copy that recipient can open, so it must either leave that recipient out or not send the message encrypted. This is why S/MIME documents describe certificate retrieval as something every agent "need[s] to provide" (RFC 8550, section 4). ## Where a client gets a correspondent's certificate RFC 8550 section 4 and NIST SP 800-177 Rev. 1 describe the usual sources: - **Incoming signed mail.** The client stores the certificates carried in a correspondent's signed message and remembers them for that address. NIST calls exchanging signed messages the traditional route. - **A directory.** Inside an organisation it is common to look certificates up in an LDAP directory. - **A certificate file.** A CMS "certs-only" object (`application/pkcs7-mime` with `smime-type=certs-only`, file extension `.p7c`) carries a certificate and its chain, and RFC 8550 says agents SHOULD support importing and exporting it. - **DNS.** RFC 8162 defines an experimental `SMIMEA` record that publishes a certificate under the mail domain, protected by DNSSEC. - **Asking.** RFC 8550 notes that, at a minimum for an initial deployment, a client could send the intended recipient a message requesting their certificate in a signed reply. RFC 8550 also expects clients to "store and protect" correspondents' certificates so they can be retrieved later, in effect an address book with certificates in it. ## Finding is not trusting A certificate in hand is only a candidate. Before using it, the client still checks that it validates up to a trust anchor the client accepts and has not expired or been revoked (each covered with certificate path validation and revocation), and that the mailbox address it names is the address being written to. A certificate that fails those checks should not be used to encrypt. ## What it means for an organisation - Signing can be switched on for every user on day one; encryption to partners only works once their certificates have reached your users' clients. - Asking staff to **sign by default** spreads certificates to correspondents automatically, which is the cheapest way to make encryption possible later. - Help-desk tickets that read "the encrypt button is greyed out for one recipient" are almost always a missing or unusable certificate for that address, not a fault in the client.

  • Can a correspondent's signed S/MIME message arrive without their certificate inside it?
    Yes. RFC 8550 makes including certificates a SHOULD, not a MUST, and lets senders leave them out inside a group that already shares certificates through a directory or manual distribution. The receiving client is then expected to find the certificate by a database or directory lookup; if it cannot, it can neither check the signature nor keep a certificate for encrypting later.
  • If you encrypt one S/MIME message to three recipients, how many recipient certificates does your client need?
    All three. Each recipient gets their own protected copy of the content key, made with that recipient's public key, so the client needs a usable certificate for every address on the message. Where one is missing, that recipient cannot be given a copy they can open, so the client must drop them or not encrypt.

  • You encrypt a message to someone with your own private key.
  • Signing a message to a new correspondent first requires their certificate.
  • A certificate holds the private key needed to read encrypted mail.
  • Any certificate found for an address can be used without further checks.
  • Encryption only needs the sender's certificate attached to the message.