Skip to content
Sign in Create account

Public JWKS

Endpoints

One JWKS document is served at all three of these URLs. Fetch any one of them and look up the receipt kid. Do not hardcode a kid.

  • https://api.cloakapi.io/.well-known/openreceipt-pubkeys.jwks
  • https://api.cloakapi.io/api/.well-known/cloakapi-receipt-pubkeys.jwks
  • https://api.cloakapi.io/api/.well-known/jwks.json
  • PEM of the active key: https://api.cloakapi.io/api/.well-known/cloakapi-receipt-pubkey.pem

The JWKS is a standard RFC 7517 JSON Web Key Set:

{
"keys": [
{
"kty": "EC",
"crv": "P-256",
"kid": "gw-prod-2026-q2",
"x": "BASE64URL_X",
"y": "BASE64URL_Y",
"use": "sig",
"alg": "ES256",
"x-cloakapi-status": "active",
"x-cloakapi-active": true
}
]
}

A retired entry has x-cloakapi-status retired, x-cloakapi-active false, and x-cloakapi-retired-at set to the UTC time it stopped signing. A receipt signed by that key still verifies. A receipt whose kid is not in the document does not.

Key rotation

  • Gateway kids follow gw-<region>-<year>-q<quarter>, for example gw-prod-2026-q4. The name is the quarter the key was activated, not an expiry date.
  • bin/receipt-key-rotate.sh creates that quarter’s key, makes it active, and keeps every earlier key in the document as retired with a date. A second run in the same quarter does nothing.
  • A 64-hex value is not a gateway kid. It is SHA-256(SPKI DER) of a device public key (receipt_keys.fingerprint). Older documents published that fingerprint as an active kid. This JWKS does not. Device keys are not the gateway trust root.
  • Compromise: take the key out of the published set. The document has no separate revoked claim. A key that remains, with status retired, still verifies.

See Key rotation policy for the rotation target and procedure.

Caching

Cache the JWKS locally for at most 1 hour, and fetch it again whenever you meet an unknown kid, to pick up rotations. The endpoint sends Cache-Control: public, max-age=300.

Key names

The active gateway key is the entry with x-cloakapi-status active. Its kid matches gw-<region>-<year>-q<quarter>. Fetch the JWKS; do not hardcode a kid.