When an organisation publishes S/MIME certificates in an LDAP directory, which attributes hold them, and what must a sender's client still check?
answer
- inetOrgPerson carries the mailbox
- one attribute preferred for S/MIME
- certificate values travel as binary
- a directory delivers, it does not vouch
basics
~20 sLDAP holds them in userCertificate (transferred as userCertificate;binary) or userSMIMECertificate, which RFC 2798 prefers because it carries the chain and capabilities. The client must still validate the certificate, check it is current and match its address.
solid answer
~40 sIn an LDAP directory, a person's entry (object class `inetOrgPerson`, RFC 2798) carries the `mail` address and can carry certificates in two attributes. `userCertificate` (RFC 4523) holds X.509 certificates, which MUST be transferred with the `;binary` option, so clients ask for `userCertificate;binary`. `userSMIMECertificate` holds a CMS signed-data object with the person's whole chain and their S/MIME capabilities, and RFC 2798 prefers it over `userCertificate` for S/MIME when present. The directory only delivers a candidate: before encrypting, the client still validates the certificate to an anchor it accepts, checks it has not expired or been revoked, and checks that it names the recipient's address and allows key management. NIST SP 800-177 Rev. 1 notes that directory lookup is common inside an organisation; exposing it to partners is a separate decision.
go deeper
Recall that an organisation's directory can answer which certificate an address has, so users can encrypt to colleagues who never signed mail to them.
Explain userCertificate;binary against userSMIMECertificate and why RFC 2798 prefers the latter for S/MIME, and what the client checks on any returned value.
Diagnose senders encrypting to an old key by checking whether renewal updated the directory entry and removed superseded values.
Decide whether partners get access to the directory, at the cost of exposing the staff list, or receive certificates by another route.
## Why S/MIME uses a directory at all To encrypt to someone, an S/MIME client needs that person's certificate. Harvesting it from signed mail works only after they have written to you. RFC 8550 therefore expects clients to be able to look certificates up: receiving agents SHOULD be able to handle messages without certificates "by using a database or directory lookup scheme" (section 2.3), and a client "might resort to checking a centralized certificate retrieval mechanism" when its local store has nothing (section 4). NIST SP 800-177 Rev. 1 states that inside an organisation it is common to obtain a correspondent's certificate from an LDAP directory server. ## The attributes that hold certificates An LDAP **entry** is a set of attributes. For people, the common structural object class is **`inetOrgPerson`** (RFC 2798), which allows these relevant attributes: | Attribute | Defined in | What a value holds | How a client requests it | |---|---|---|---| | `mail` | listed in `inetOrgPerson`, RFC 2798 | the person's mail address, which is what a client searches on | as text | | `userCertificate` | RFC 4523, 4.1 | an X.509 certificate issued to the user, DER encoded | `userCertificate;binary` | | `userSMIMECertificate` | RFC 2798, 2.8 | a CMS / PKCS #7 signed-data object carrying the person's entire chain and an S/MIME capabilities field | `userSMIMECertificate;binary` | | `cACertificate` | RFC 4523, 4.2 | certificates issued to a certification authority, on the CA's own entry | `cACertificate;binary` | Points worth knowing: - **`;binary` is required for certificate syntax.** RFC 4523 says certificate values SHOULD be DER encoded and MUST only be transferred using the `;binary` transfer option, so the attribute description a client sends is `userCertificate;binary`. - **`userSMIMECertificate` is preferred for S/MIME.** RFC 2798 says that, if available, it "is preferred over the userCertificate attribute for S/MIME applications", because one value gives the client the chain and the capabilities it would otherwise learn from a signed message. - **Both are multi-valued.** A person with separate signing and encryption certificates, or one mid-renewal, may have several values; the client must pick one that allows key management and is current. - **`userPKCS12` is not a publishing attribute.** RFC 2798 also defines `userPKCS12`, whose values are PKCS #12 containers that normally hold a private key with its certificate. Whatever its use for moving a user's own credentials, it is not how certificates are offered to correspondents, and a directory that partners can read is no place for one. ## What the client still has to check A directory answer establishes only that the directory returned this value. The client still has to treat it like any other candidate certificate: 1. **Validate it** up to a trust anchor the client accepts (covered with certificate path validation). 2. **Check it is current** — not expired, not revoked (revocation checking is its own subject). 3. **Check the address**: the certificate should name the mailbox being written to in its `subjectAltName`. 4. **Check it can encrypt**: the key usage must allow key management (the profile itself belongs to the material on the mailbox certificate profile). Protecting the LDAP session with TLS protects the lookup in transit and authenticates the directory server; it does not turn a stale or wrongly issued certificate into a good one. ## Running the directory For the administrator, the directory is a publishing system with its own failure modes: - **Renewal lag.** If a renewed certificate is not written to the entry, senders keep encrypting to the old one. The recipient can still open those messages only while they hold the old private key. - **Stale values.** Leaving superseded certificates in a multi-valued attribute invites clients to choose the wrong one; removing them on renewal is part of the issuance workflow. - **Reach.** An internal directory solves discovery between colleagues. Partners need either access to it (which exposes the staff list and every address) or another route, such as exchanging signed mail or certs-only files. - **Client configuration.** Each mail client has to be told which directory to query and with which search base, which is a deployment task in its own right. ## The short version for an interview A directory is a delivery channel: it answers "what certificate does this address have?", and RFC 2798 and RFC 4523 define where the answer lives. It is never the trust decision; validation, currency and the address match stay with the client.
- Why would a client prefer a userSMIMECertificate value over userCertificate when both exist?Because RFC 2798 defines userSMIMECertificate as a signed-data object carrying the person's entire certificate chain plus an S/MIME capabilities field. One lookup then gives the client what it needs to build the path and to choose a cipher the recipient supports, which userCertificate alone, a single certificate, does not.
- What breaks for senders when a renewed S/MIME certificate never reaches the directory entry?Senders who look the recipient up keep encrypting to the superseded certificate. The recipient can open those messages only while they still hold the old private key, and once the old certificate expires, careful clients stop using it and cannot encrypt at all. Writing the new certificate and removing the old value belong in the renewal workflow.
- A certificate returned by the internal directory needs no validation.
- Using LDAP over TLS makes every returned certificate trustworthy.
- The directory should publish each user's PKCS #12 file for partners.
- Certificate attributes can be requested without the ;binary option.
- The directory decides which certificate a sender's client must trust.