Sobamail Platform PKI¶
Warning
This document is under heavy development. Please get in touch to let us know which sections we should prioritize.
Table of contents¶
Overview¶
The Sobamail PKI is a closed, operator-controlled private certificate hierarchy. It provides cryptographic identity for three roles: TLS authentication of Sobamail servers, email data signing by users, and TLS authentication of mailbox replicas, toward Sobamail Servers and toward each other.
The PKI is designed around four explicit constraints:
- Per-replica cryptographic isolation. A compromise of one replica's keys stays confined to that replica.
- Role separation by hierarchy branch. Server TLS, S/MIME data signing and replica client authentication live in separate sub-CA branches, with EKU-enforced boundaries between them.
- Exclusive use of EC. ECDSA on P-256 with SHA-256 throughout.
- Structural defense over policy. Cert extensions (Name Constraints, EKU chaining, path length, criticality) enforce the security properties, so they hold independently of operator discipline.
Architecture¶
The PKI is a hierarchy with three parallel sub-CA branches sharing a single offline root. The diagram shows the 2027 set, the one new issuance uses. The 2025 and 2026 vintages stay in every store for validation (see Trust).
---
title: Current Certificate Hierarchy
config:
flowchart:
nodeSpacing: 60
rankSpacing: 70
---
flowchart TD
root["<b>Root 2027</b><br/>offline"]
server["<b>Server</b><br/>intermediate"]
peer["<b>Peer</b><br/>intermediate"]
data["<b>Data</b><br/>intermediate"]
serverleaf["Server TLS<br/>leaf"]
localca["<b>Local CA</b><br/>(one per replica)"]
dataleaf["Data-signing<br/>leaf"]
inkclientleaf["Sobamail Client<br/>TLS Leaf"]
peerserverleaf["Peer Server<br/>TLS leaf"]
peerclientleaf["Peer Client<br/>TLS leaves"]
root --> server --> serverleaf
root --> peer --> localca
localca --> inkclientleaf
localca --> peerserverleaf
localca --> peerclientleaf
root --> data --> dataleaf The EKU of each branch is in Branch separation below.
-
Root is offline. Its private key comes online once a year for the annual ceremony. In the ceremony a new root is generated, and the oldest root still in its three-year signing window signs the year's sub-roots.
-
Issuing intermediates are online. They are reissued annually under a new sub-root cert signed with the oldest root still inside its three-year signing window. Each handles issuance for exactly one branch:
-
Server issues TLS server certificates solely for Sobamail infrastructure.
-
Data issues data-signing leaves directly to users, so users can sign their email.
-
Peer issues local certificate authorities to user replicas. Local CAs are name-constrained to the DN subtree of that replica, with a path length of 0 (see Name Constraints).
-
-
Leaves carry the actual operational identities. They are short-lived (leaf certs in client custody nominally live 33 days) and rotate automatically.
Replica authentication¶
The replica's local CA signs its own TLS client certificate, which authenticates the replica to Sobamail Servers. The local CA also signs the replica's own mTLS server certificate and its peers' client certificates, for the peer-to-peer connections.
Outside the Server branch, validation reads the UID and DC attributes of the subject. A peer TLS client certificate carries two more attributes, E and CN, naming the peer it was issued to. In every other certificate the CN value is free text.
Peer-to-peer authentication¶
Two replicas on the same network connect to each other directly, over mutually authenticated TLS (mTLS). Both certificates of such a connection come from the local CA of the replica accepting it, and from no central authority:
- To connect to replica R, a peer presents a TLS client certificate that R's own local CA issued to it. The peer asks for it with a certificate signing request sent to R's user as signed email. R signs a request for its own subtree alone, and only when the address in CSR matches both the sender address and the email signer. R answers, again as signed email, with a signed certificate bundled with every valid local CA certificate of its own. The peer takes that answer from the replica it asked alone, for the key its request was made with. It keeps R's local CA certificates as the anchors of its check on R.
- R accepts a connection only with a client certificate one of its own valid local CAs issued, matched by key. R then names the peer by the address and the replica it wrote into that certificate itself.
- R's local CA signs R's own TLS server certificate (EKU
serverAuth), which R presents when peers connect. The connecting peer verifies that one of the local CA certificates of R it holds issued the server certificate. - Each side builds the other's chain from R's local CAs, the Peer Authentication Intermediates and the Sobamail roots, and from those alone. The connecting peer reaches R at the network address R announces on the local network.
- Each direction of a peer relationship has a certificate of its own. The peer renews it as described in Rotation and revocation. It also asks again when R presents a server certificate of a local CA newer than any it holds, at most once a day.
The client certificate a peer presents to R has a subject DN inside R's subtree, so a compromised local CA can fabricate credentials for connecting to its own replica, and nothing more.
Branch separation¶
The three branches are independent. Every level enforces EKU chaining, so a CA produces valid certs for its own branch's role only:
| Branch | EKU | NSS validation usage |
|---|---|---|
| Server | serverAuth | certificateUsageSSLServer |
| Data | emailProtection | certificateUsageEmailSigner |
| Peer | serverAuth, clientAuth | certificateUsageSSLClient |
The Peer branch and its local CAs declare both serverAuth and clientAuth: the subtree holds client certificates and each replica's own TLS server certificate.
Signed data format¶
Signed data travels in one of two formats, both made with the sender's data-signing leaf. A message for Sobamail recipients carries the Sobamail envelope. A message for recipients on other mail clients carries, beside it, an S/MIME rendition those clients verify.
-
The Sobamail envelope is a structured object. It holds the sender address, the format tags of its payload, the payload itself, the signing certificate, the signature over the payload and, when one was obtained, timestamps that attest when the signature existed. The envelope ships with its signing certificate alone. On reception, the receiver validates the certificate against the local certificate store and checks the signature against the payload. The message's
Frommust equal the certificate'sUID@DCor anrfc822Nameits issuer attested. When the envelope carries timestamps, each is verified against its own signer's certificate, and the earliest one anchors the check. An envelope without one is checked against the current clock. If everything verifies, the envelope is stored together with the whole validating certificate chain in the local message database. The archived chain keeps old signatures verifiable after the issuing certificates expire and their roots leave the codebase. -
The S/MIME rendition is an RFC 8551
multipart/signedof protocolapplication/pkcs7-signaturewithmicalg=sha-256. Its first part, the Cryptographic Payload, is the whole message in canonical form (CRLF, 7-bit). That is every body part and attachment, a structured message's envelope as itsMessage-Structureattachment, and a copy of every header butBcc. The rootContent-Typecarrieshp="clear"(RFC 9788 header protection). Its second part is a detached CMSSignedData(smime.p7s). It carries the signing leaf and the intermediates above it, short of the root, and asigningTimeequal to the message'sDate, which for a delayed send is its delivery time. TheMessage-IDandDateare fixed before signing, so the copies a server regenerates equal the signed bytes. A verifier outside Sobamail needs the roots from Trust anchors. The message brings the rest of the chain along, and the signature verifies in any client that implements RFC 8551 with ECDSA P-256. On reception, Sobamail parses an S/MIME message whose payload protects its headers as that payload.
Name Constraints¶
EKU bounds what kinds of certs a CA can issue. Name Constraints bound what names it can put in them.
Constraint scope¶
Local CAs in the Peer branch carry a permittedSubtrees constraint whose base is the CA's own subject DN, the replica's OU=peer subtree.
The Peer Authentication Intermediate can issue sub-intermediates that carry a broader constraint scoped to the deployment's DC space. This is defense in depth: should per-replica enforcement ever be bypassed, the chain is still confined to the Sobamail DN space.
Enforcement¶
NSS reports a leaf outside its issuing CA's permitted subtree as SEC_ERROR_CERT_NAME_CONSTRAINT_VIOLATION, and its verify log names the CA that enforced the constraint.
What this prevents¶
The concrete attacks that Name Constraints structurally blocks:
- A compromised local CA is confined to its own replica's identity. It can sign a cert naming another replica, another user, or a central service, and every compliant validator rejects the resulting chain.
- The next validation catches an issuance-pipeline bug that constructs a leaf with the wrong subject DN, before the bug yields a usable credential.
Rotation and revocation¶
Every rotation in the PKI issues a fresh keypair, from the root down to the leaves.
Roots and intermediates are generated mid-year, ship with the next release, and become valid on the following January 1st. Clients thus hold them before the issuance pipeline starts to use them. A root signs intermediates for its first three years and stays in every store for validation until the end of its fifth year, when it leaves the codebase. A new root therefore propagates for three years before it signs anything. An intermediate is valid for 16 months, January 1st to around April 27th of the following year. Consecutive intermediates thus overlap by about four months, and the population below migrates onto the new one through its own renewals.
Local CAs and leaves renew on their own, on a one-third-of-validity cadence: a 33-day leaf attempts renewal around day 11 and day 22, and the 3-month local CA monthly. The outgoing certificate stays in the store until the last thing it signed expires.
A peer TLS client leaf renews on the same cadence, asked for by the peer that holds it from the replica that issues it. A replica that renews its local CA keeps accepting the client certificates the outgoing one issued until they expire. A peer that meets a server certificate of a local CA it does not hold yet asks for a new client certificate, which brings that local CA along.
Trust¶
On every start, the client loads its store with the retained roots (2025, 2026 and 2027) and the 2026 and 2027 intermediates of every branch. The retained roots anchor every purpose. Each intermediate is trusted for its own branch's purpose alone (Server for TLS servers, Peer for TLS clients, Data for email). The 2025 and 2026 vintages predate the EKU extension, so new issuance uses the 2027 set. They stay trusted until retention retires them.
A replica also holds the local CA certificates of the peers it connects to, trusted for nothing in its store: the peer-to-peer check pins them by key (see Peer-to-peer authentication).
Trust anchors¶
The retained roots, DER-encoded, exactly as the client bundles them. A relying party outside Sobamail installs these roots. A signed message brings its leaf and the intermediates along.
| Root | Subject | SHA-256 fingerprint | DER |
|---|---|---|---|
ca_2025 | CN=Sobamail Root 2025, C=TR | 658322ac96cb4c2c9e00bb63c3c7c95ae6c9291f76b3801b27cf07332afb3bfd | ca_2025.der |
ca_2026 | CN=Sobamail Root 2026, C=TR | 9490ac2f21d65aafe76dc1dcf2c7077858f62a02cc7d4f7f32dbaa9bb39c456e | ca_2026.der |
ca_2027 | CN=Sobamail Root 2027, C=TR | 1ece064370b1749d263a8d2c3b65afea084f50c8e86ad4464e25f0708f219681 | ca_2027.der |
After the download, check the fingerprint:
sha256sum ca_2027.der
openssl x509 -inform DER -in ca_2027.der -noout -subject -dates -fingerprint -sha256
Install all three: each chain validates through its own vintage. The set changes once a year, when a new root enters and the oldest leaves retention.
For an NSS store (Thunderbird, Firefox, or a certutil database), to trust a root for email signatures:
For OpenSSL, convert to PEM and name it as a trusted CA:
openssl x509 -inform DER -in ca_2027.der -out ca_2027.pem
openssl cms -verify -in message.eml -CAfile ca_2027.pem -purpose smimesign
Windows takes a DER file directly into the current user's trusted root store (certutil -addstore -user Root ca_2027.der), and macOS through Keychain Access or security add-trusted-cert.
Blast radius¶
Every structural constraint at once bounds a compromise of any key in the hierarchy:
- Key Usage limits what the key signs.
- EKU chaining limits the role its certs validate for.
- The path length limits the depth it can build.
- Name Constraints limit the names it can assert.
- Validity limits how long any of it lasts.
| Compromised key | Maximum impact |
|---|---|
| Root | Total PKI compromise. Recovery is a trust-store reset across all relying parties |
| An intermediate | Its branch alone: server impersonation (Server), email-signature forgery (Data), rogue local CAs (Peer). All intermediates share operator custody, so one compromised is the tier compromised. Recovery via reissuance plus a root-signed CRL |
| Local CA | That one replica, for up to 3 months: rogue credentials for connecting to it, and its impersonation toward Sobamail Servers and toward its peers. Recovery via reissuance plus a CRL from the Peer Authentication Intermediate |
| Leaf in client custody | One credential, for up to 33 days |
The expected event is a leaf compromise, which the design absorbs: the 33-day validity bounds the window and rotation is automatic. Three things rest on others: the integrity of the relying party's host, the strength of P-256 and SHA-256, and the conduct of whoever holds an issuing key. Their mitigations are host hardening, a migration path to post-quantum algorithms, and HSM-protected keys with audited, multi-party ceremonies.