Launch on 01/01/2027Licenses available from 01/01/2027
PreviewThis page documents the release that launches on 01/01/2027. Packages, images and sign-up open then, and details may change before it.
Docs / Certificates & PKI / The certificate contract

The certificate contract

Ready

The certificate contract is what any certificate authority (CA) issues for a Ydentifi deployment: the root, the intermediates under it, the server’s certificate, and the certificates of relying parties, operators and metrics scrapers. A CA that issues to the contract can serve a deployment. The step-ca recipes issue to it.

Each rule below names where it is checked. “At boot” means that the server refuses to start on a certificate that breaks the rule, and that a certificate replaced while it runs is refused while the old one keeps serving. “At the handshake” means that a client certificate that breaks the rule is refused when it connects. A rule that names no place is not checked by the server: the CA alone holds to it.

Names#

  • Every server and client certificate carries exactly one URI name, a SPIFFE ID of the form spiffe://<trust domain>/<role>/<name>. The root and the intermediates carry none. A SPIFFE ID is a URI that names the holder of a certificate.
  • The trust domain of client certificates is the server’s YDFI_SERVER_TRUST_DOMAIN, or ydentifi.local when it is not set. A trust domain is lowercase letters, digits, ., - and _, in labels separated by single dots; the server refuses to start on any other value. The server’s own certificate may use any trust domain, since phones identify a deployment by its pinned root and its host name.
  • <name> is one SPIFFE path segment: letters, digits, ., - and _. The handshake checks the role and the trust domain, not the number of segments.
RoleSPIFFE IDExtended key usage
Server, every listenerspiffe://<trust domain>/server/<instance>serverAuth. Under step-ca, clientAuth is listed beside it, because step-ca’s renewal authenticates with the certificate it renews; the server does not check it, and another CA may leave it out.
Relying partyspiffe://<trust domain>/rp/<relying party ID>clientAuth
Operatorspiffe://<trust domain>/operator/<ID>clientAuth
Metrics scraperspiffe://<trust domain>/monitoring/<instance>clientAuth

Client certificates list clientAuth alone, so that a standard TLS client refuses one offered as a server’s. The server also accepts a client certificate that lists both, as a SPIFFE CA issues them, or none. Client certificates name no DNS name or IP address, and carry no common name equal to the server’s host name. Not checked by the server.

Who may obtain which name is the CA’s own control. A relying party’s certificate names the relying party the operator created, never a name taken from the request: in step-ca, a token minted for that ID; in Vault, a role per relying party with allowed_uri_sans; in cert-manager, an approver that checks the request’s URI against the requester. Not checked by the server. The configurations of HashiCorp Vault, cert-manager and Google CA Service are in Certificate issuers and deployment platforms.

The root#

  • A CA certificate that names itself as its issuer, may issue (basic constraints CA, and keyCertSign when it states a key usage), and is within its dates. At boot.
  • Its key is ECDSA on P-256, P-384 or P-521, or RSA of 2048 to 8192 bits. At boot. A root over an Ed25519 key is read, and the server then refuses to start: the phone listener serves no certificate signed with Ed25519.
  • It is signed with ECDSA with SHA-256, SHA-384 or SHA-512, RSA PKCS#1 v1.5 with SHA-1, SHA-256, SHA-384 or SHA-512, or Ed25519. RSA-PSS, the newer RSA signature scheme, is refused. At boot. Its own signature is not checked: clients hold a root by its name and key.
  • It is long-lived. Phones pin the SHA-256 hash of its public key. After a change of root every phone enrols again, with one exception: the new root is the backup root whose pin the phones hold, and no CA key of the old root is stolen. A CA key is the root’s own, or an intermediate’s. A phone keeps the pin of every root it was given, so after a theft it goes on trusting what the stolen key signs, until it enrols again.
  • The server is given its certificate (YDFI_SERVER_ROOT_CA_CERT_PATH) and appends it to every chain it serves. Its key stays with the deployer’s CA and is never given to the server: the server signs nothing, and refuses to start while YDFI_SERVER_ROOT_CA_KEY_PATH is set. The step-ca recipe with an offline root keeps the key on a machine that is not networked; the recipe in which step-ca keeps its root keeps it in the CA’s volume.
  • A backup root may be given beside it (YDFI_SERVER_BACKUP_ROOT_CA_CERT_PATH): a second root, its key kept offline apart from the first. Phones learn its pin when they enrol. Phones pin whatever root the file holds, so the pin the server logs at boot (backup root pin resolved, spki_pin) is compared with the one printed for it where it was made (offline.sh root, or offline.sh pin for a root made elsewhere, in the step-ca recipes) before any phone enrols.
  • A backup root is held to the root’s rules, and to these. At boot, and at every replacement of the phone listener’s certificate:
    • its key is ECDSA, and is not the main root’s key;
    • the extended key usages it lists, if any, include clientAuth;
    • its name constraints, if any, admit the names of the phone listener’s certificate.
    Not checked by the server: its name constraints also admit every other listener’s names, and where the CA issues through an intermediate, its path length is not 0. A backup root that has expired stops every replacement of the phone listener’s certificate, and stops the server from starting. The server warns of its expiry from 30 days before.

Intermediates#

  • A CA, with keyCertSign when it states a key usage. At boot.
  • Either no extended key usage, or one that lists serverAuth where it issues server certificates and clientAuth where it issues client certificates. At boot, “any usage” in place of serverAuth is refused. At the handshake, an intermediate in a client’s chain that lists extended key usages without clientAuth is refused; one that lists “any usage” is accepted there, and is outside the contract.
  • Its key is ECDSA on P-256, P-384 or P-521, or RSA of 2048 to 8192 bits. It is signed with ECDSA, or with RSA PKCS#1 v1.5, and SHA-256, SHA-384 or SHA-512. SHA-1 is accepted on the root alone. RSA-PSS and Ed25519 are refused. At boot.
  • It outlives every certificate issued under it. A client checks the dates of each certificate in the chain, so a certificate that outlives its intermediate fails when the intermediate expires. The step-ca recipe with an offline root signs intermediates for 3 years and replaces them every year; a relying party’s certificate lives at most 2. Not checked by the server: a certificate that outlives its intermediate is issued, and fails later.

The server’s certificates#

Each listener is given a certificate pair of its own: the relying-party listener, the phone listener and the admin listener. The internal metrics listener serves the relying-party listener’s pair. Clients check 2 things of a server’s certificate: the server’s role in its SPIFFE ID, and the host name they dial. The pairs are therefore told apart by their host names alone, and the admin listener is given a host name of its own.

  • Not a CA. At boot.
  • The certificate file holds the leaf first, then each intermediate in order. The root may be left out. At boot.
  • Exactly one URI name, spiffe://<trust domain>/server/<instance>. At boot. The admin and metrics listeners carry the same role.
  • DNS names or IP addresses naming every host that clients dial; the common name is not read. On the phone listener, it names the host of YDFI_SERVER_DEPLOYMENT_URL. At boot.
  • serverAuth; a key usage, when one is stated, includes digitalSignature. At boot.
  • Key: ECDSA on P-256 or P-384, or RSA of 2048 to 8192 bits. Ed25519 and P-521 are refused: the TLS libraries of phones and of the Python SDK do not accept a handshake signature from them. At boot.
  • On the phone listener, which serves phones, more is refused. At boot:
    • a certificate over an RSA key: the key is ECDSA on P-256 or P-384;
    • a chain of more than 5 certificates, the root included;
    • below the root, a certificate signed other than with ECDSA, or with RSA PKCS#1 v1.5, and SHA-256, SHA-384 or SHA-512;
    • a wildcard DNS name with fewer than 2 labels after the *, which matches no host on a phone;
    • an IPv4 host that the certificate names other than as a 4-byte address;
    • where a backup root is given, a key other than ECDSA, or the backup root’s own key.
  • Critical extensions: key usage, basic constraints, subject alternative name and name constraints alone. At boot.
  • Lifetime: any. A phone allows 5 minutes of clock skew at each end, so the phone listener warns of a certificate that lives less than 24 hours.

Client certificates (relying parties, operators, metrics scrapers)#

  • Issued under a CA in the listener’s trust bundle. At the handshake.
  • Exactly one URI name, a SPIFFE ID in the trust domain, on its role’s path; each listener admits only the roles it serves. At the handshake.
  • clientAuth, or no extended key usage; never “any usage” without clientAuth. At the handshake.
  • Not a CA, and digitalSignature among its key usages when it states any. At the handshake.
  • Key: ECDSA on P-256, P-384 or P-521, Ed25519, or RSA of 2048 to 4096 bits. At the handshake, an RSA key over 4096 bits is refused; the other bounds are not checked by the server.
  • The chain a client sends is bounded before it is verified: at most 4 certificates and 12 KiB, no RSA key over 4096 bits, and one certificate per CA name. The chain is sent without its root. At the handshake.
  • Lifetime: the CA’s choice. The step-ca recipes issue 2 years for a relying party, and 90 days for an operator or a scraper. No certificate is pinned: any certificate the CA issues that names the relying party is that relying party, so a new certificate overlaps the one it replaces. The Python SDK reads new files within 1 minute. The Go SDK reads them at its next connection, up to the server’s maximum connection age later.
  • A certificate is withdrawn by its expiry. Suspending a relying party refuses all of its certificates at once (Operate & maintain, Incident response).
  • A client certificate cannot be renewed by its holder alone: the CA issues the next on the operator’s authority, or on the platform’s. Not checked by the server.

Phones#

Phones are not issued certificates by any CA. A phone presents a certificate it signs itself over its device key, and the server reads only the key.

Opens on 01/01/2027

Available at launch

Until then, you can try the whole ceremony on your own phone.