Released docs. You are viewing the documentation published with v0.48.0. Development docs are available at Latest.
If your application reads Registry Evidence (Evidence) answers with its own code instead of the Evidence client, you must make every check the client makes. A response with a valid signature can still be expired, meant for another relying party, or the answer to a different request.
With the Evidence client
Section titled “With the Evidence client”The Python and Node clients generate the request nonce, keep it, and make every check on this page when they verify a response. Use them where you can: Request Evidence from your application shows how. The rest of this page is for code that does not use them.
Send a new request nonce with every request
Section titled “Send a new request nonce with every request”Every POST /v1/evidence request carries a requestNonce. It must be:
- 32 bytes from a cryptographically secure random source
- encoded as unpadded base64url, which makes exactly 43 characters from
AtoZ,atoz,0to9,-, and_ - generated again for every request, and for every item in a batch request
In Python:
import base64import secrets
request_nonce = base64.urlsafe_b64encode(secrets.token_bytes(32)).rstrip(b"=").decode()In Node:
const { randomBytes } = require('node:crypto')
const requestNonce = randomBytes(32).toString('base64url')Keep the nonce with the request you sent, because you compare it with the answer. Do not use a UUID, a counter, a timestamp, or a value derived from the person or the case.
Evidence refuses any other value with a 400 problem whose code is request.nonce-invalid and
whose detail states the format. It refuses it before it checks your token or contacts a source.
In a batch request, two items with the same nonce are refused in the same way.
Evidence signs the nonce back into the answer but never stores it or checks whether it was used before. The nonce ties an answer to your request only if you compare it, as described in Check the response.
What the response is
Section titled “What the response is”Send Accept: application/jose+json, or no Accept header. A successful response is a flattened
JWS JSON object with exactly three members: protected, payload, and signature.
The payload is the Evidence assertion itself, not a JWT claim set. It has no exp, iat, nbf,
or aud claim. The members that matter for verification are:
requestNonce, the exact nonce you sentaudience, the audience your access token was issued forissuedAt,observedAt, andvalidUntil, as RFC 3339 date-time strings
validUntil is the only claim that bounds how long the answer is valid. A check written for exp
finds nothing and passes every answer, however old.
Check the response
Section titled “Check the response”Make these checks in this order and stop at the first one that fails. A failure means you have no answer: do not use any value from the payload, and do not retry with the same nonce.
- Parse the body as JSON and refuse it if any member is repeated. It must have exactly
protected,payload, andsignature, and noheadermember. - Decode
protectedfrom unpadded base64url and parse it the same way. It must have exactly these members:algset toES256,typset toevidence+jws,ctyset toapplication/evidence+json, andkid. Refuse any other member, includingjku,x5u,jwk,x5c,crit, andb64. - Refuse a
kidyou have revoked. Then look up thekidonly in the key set you pinned for this provider. Never fetch a key the response names. You read/.well-known/evidence/jwks.jsonto decide which keys to pin, but it is not proof of who the provider is. - Verify the ES256 signature. The signing input is the
protectedstring, a full stop, and thepayloadstring, exactly as received. The decodedsignatureis 64 bytes:rthens. Do not read the payload before this check passes. - Decode
payloadand validate it against the Evidence JSON Schema. - Compare the payload with values you hold yourself, never with values copied from this response.
Each of these must be equal:
requestNonceand the nonce you sent with this requestaudienceand the audience your access token was issued forassuranceProfile,issuedBy,providedBy,supportsRequirement,isConformantTo,purpose, andconfigurationRevision, and the values you expect from this provider and requirementsubjectBindingandaudience-scopedchanneland a channel you accept, which issourceunless you accept holder-presented answers- the
roleandbindingpairs insubjectsand the pairs you expect, in any order - the concepts in
supportedValuesand the concepts you expect, each in its declared form
- Check the times.
observedAtmust not be later thanissuedAt, andvalidUntilmust be later than both.validUntilminusissuedAtmust not be longer than the longest lifetime you accept. The answer is current only if the time now is beforevalidUntil, andissuedAtandobservedAtare not later than now.validUntilis exclusive: at that instant the answer has expired. Allow only the clock skew you have chosen, of at most 5 minutes.
A subject binding is a value only the provider can compute. On the first request for a subject you cannot know it in advance, so the Evidence client either takes bindings you pinned from an earlier answer or accepts the response’s bindings on first use and pins them. Accepting on first use proves every other check, but not that the answer is about the person you meant. The client API reference describes both.
A failed check on a response you already accepted, for example a later replay after validUntil,
does not mean the answer was forged. Report authenticity and current validity separately when you
keep answers as records.
Test your checks against the published vector
Section titled “Test your checks against the published vector”Registry Stack publishes a synthetic signed response with everything a verifier needs, so your own test suite can prove each check before you call a live service. The consumer verification vector has:
response.json, a response body as Evidence returns itjwks.json, the public key set to pinpolicy.json, the expected values, including therequestNoncethe request sentcases.json, the instants and changes your verifier must accept or refuse
Run every case in cases.json. Your verifier must accept the response at 2026-08-02T23:59:59Z
and refuse it at 2026-08-03T00:00:00Z, the validUntil instant. It must also refuse it against
another request’s nonce, against another audience, and with one character of the payload changed.
A verifier that accepts any of those is missing a check.
- Errors and problem codes, for what each refusal from Evidence means
- Verify an assertion as a consumer, to replay a kept answer with the Evidence client
- Manage verifier trust, to choose which provider keys you pin
Cookies on Registry Stack
We use optional cookies to understand how you use the main Registry Stack website and this documentation. If you contact us, we may link this activity to your enquiry. You can change your choice at any time. Read the privacy policy.
Your browser asks sites not to track you, so optional tracking stays off.
We could not use or save that choice. Optional tracking remains off.