Statement signing key: verify receipts yourself
Fetch the Ed25519 public key behind monthly statements and per-request model receipts as a JWK, without a key, and check any signature in your own code.
Monthly statements and per-request model receipts carry an Ed25519 signature, and GET https://api.uplinkswitch.com/v1/statements/public-key publishes the public key that checks them. The route needs no API key, allows requests from any origin, and its response is cached for an hour.
Response
| Field | Notes |
|---|---|
key_id | The RFC 7638 thumbprint of the live key's JWK, and so the same string as the JWK's kid. |
alg | Ed25519. |
jwk | The public key itself: kty OKP, crv Ed25519, x, kid, use sig and alg EdDSA. EdDSA, the JOSE algorithm name, appears only inside this object. |
verify | A one-line reminder of the check: an Ed25519 signature, base64url-encoded, over the UTF-8 bytes of a statement's or receipt's payload string. |
Checking a signature
- Read the
key_idprinted on the statement or receipt. - Fetch this route and confirm its
key_idis identical. - Decode the base64url
signatureand verify it against the exactpayloadstring, as UTF-8 bytes, with the JWK in any Ed25519 library or in Web Crypto.
A statement's signed payload includes a usage_csv object: the column names, the row count and the SHA-256, in hex, of the statement's CSV file. Hash the CSV you downloaded beside the statement and compare, and that one signature covers the CSV too.
Status codes
- 200: the key.
- 503
not_configured: statement signing is not set up, so there is no key to hand out.
Example
curl https://api.uplinkswitch.com/v1/statements/public-keyTo check without writing code, the statement verifier uses this same key inside your browser: give it a statement (with its CSV, if you have it) or a receipt, and nothing leaves the page.