SDK reference · Verifiers
provenanceauth-verify (Python)
provenanceauth-verify (Python) in the Verifiers: 37 methods. Offline token checks for Python, with no API key.
Methods
verify_intent_token
provenanceauth_verify.verify_intent_token(token: str, jwks: dict, now: Optional[int] = …) -> VerifyResultVerify an ES256 intent token against a JWKS (authenticity + expiry only).
verify_trace_manifest
provenanceauth_verify.verify_trace_manifest(token: str, jwks: dict, graph: Any = …) -> TraceManifestResultVerify a Trace manifest (ES256 JWS, typ provenance-trace+jwt) against a JWKS; optionally check a graph against its graph_hash / public_graph_hash.
verify_trace_diff_manifest
provenanceauth_verify.verify_trace_diff_manifest(token: str, jwks: dict, report: Any = …) -> TraceDiffManifestResultVerify a Neuron-CI diff manifest (ES256 JWS, typ provenance-trace-diff+jwt) against a JWKS; optionally check a snake_case report against its report_hash.
fetch_jwks
provenanceauth_verify.fetch_jwks(base_url: str, timeout: float = …) -> dictap2_hash
provenanceauth_verify.ap2_hash(value: str) -> strBase64url(SHA-256(ascii value)): how AP2 and SD-JWT hash disclosures, presentations and Checkout JWTs.
verify_ap2_user_mandate
provenanceauth_verify.verify_ap2_user_mandate(serialized: str, issuers: list, expected: dict, now: Optional[int] = …, kb_max_age_seconds: int = …, accept_chains: bool = …) -> Ap2ResultVerify an AP2 v0.2 mandate SD-JWT (or delegate chain) against issuers ([{"name", "jwks"}], your own list) and expected (origin, checkout_jwt, payee_id, amount in minor units, currency).
verify_authority_proof
provenanceauth_verify.verify_authority_proof(token: str, jwks: dict, expect: Optional[dict] = …, holder: Optional[dict] = …, online: bool = …, api_base: Optional[str] = …, status: Optional[dict] = …, now_ms: Optional[int] = …, timeout: float = …) -> AuthorityProofResultCheck an authority proof; see the module docstring.
canonical
provenanceauth_verify.canonical(value: Any) -> strCanonical JSON (sorted keys, no whitespace, JS number formatting): the offer-hash pre-image.
offer_hash
provenanceauth_verify.offer_hash(payload: dict) -> strSha256 (hex) of the offer's canonical JSON payload: what the acceptance token binds.
content_hash
provenanceauth_verify.content_hash(content: Union[bytes, str]) -> strSha256 (hex) of delivered bytes or text.
items_total
provenanceauth_verify.items_total(items: list, currency: str) -> floatdecode_jws
provenanceauth_verify.decode_jws(jws: str) -> Optional[tuple]Header, payload, signing_input, signature) of a compact JWS, or None (no signature check).
offer_shape_error
provenanceauth_verify.offer_shape_error(p: dict, now: Optional[int] = …) -> Optional[str]Why an offer payload is malformed (one line), or None.
sign_offer
provenanceauth_verify.sign_offer(payload: dict, private_jwk: dict, now: Optional[int] = …, ttl_seconds: int = …) -> dictSign an offer with the seller agent's Ed25519 key (a JWK with d).
verify_offer
provenanceauth_verify.verify_offer(offer: str, keys: list, now: Optional[int] = …, buyer_agent_id: Optional[str] = …, seller: Optional[str] = …) -> OfferResultVerify a signed offer against the seller's registered keys ([{kty, crv, x, kid, status?}]).
sign_delivery
provenanceauth_verify.sign_delivery(payload: dict, private_jwk: dict) -> dictSign a delivery receipt (deal_id, offer_hash, content_hash, …) with the seller's key.
verify_delivery
provenanceauth_verify.verify_delivery(receipt: str, keys: list, seller: Optional[str] = …) -> boolverify_deal_acceptance
provenanceauth_verify.verify_deal_acceptance(token: str, offer: Union[str, dict], jwks: dict, seller: Optional[str] = …, revocations: Optional[dict] = …, now: Optional[int] = …) -> AcceptanceResultThe seller's offline check of a buyer's acceptance token (parity with verifyDealAcceptance).
verify_counterparty
provenanceauth_verify.verify_counterparty(api_base: str, kid: Optional[str] = …, agent_id: Optional[str] = …, origin: Optional[str] = …, cache_seconds: int = …, timeout: float = …) -> dictGET /v1/public/counterparties/check (keyless), cached for 5 minutes per query.
holder_thumbprint
provenanceauth_verify.holder_thumbprint(jwk: dict) -> strRFC 7638: the SHA-256 thumbprint of a P-256 key, over {"crv","kty","x","y"} in that order, base64url.
access_token_hash
provenanceauth_verify.access_token_hash(token: str) -> strath: the base64url SHA-256 of the token a proof rides with.
htu_of
provenanceauth_verify.htu_of(url: str) -> strRFC 9449: htu is compared without the query and the fragment.
holder_jwk_problem
provenanceauth_verify.holder_jwk_problem(jwk: Any) -> Optional[str]The problem with a holder key, or None when it's a P-256 public JWK.
check_holder_proof
provenanceauth_verify.check_holder_proof(proof: str, method: str, url: str, token: Optional[str], now: int, nonce: Optional[str] = …, max_age_seconds: int = …) -> HolderProofResultCheck a DPoP proof.
grant_holder_jkt
provenanceauth_verify.grant_holder_jkt(payload: dict) -> Optional[str]The grant's cnf.jkt: None for a bearer grant, "malformed" for a cnf we can't use (fails closed).
holder_reason
provenanceauth_verify.holder_reason(token: str, jkt: str, holder: Optional[dict], now_ms: int) -> Optional[str]The holder check on a bound grant: None when it holds, else the reason.
need_fits
provenanceauth_verify.need_fits(authority: dict, need: Optional[dict]) -> Optional[str]The first limit need breaks, or None.
verify_mandate
provenanceauth_verify.verify_mandate(token: str, jwks: dict, need: Optional[dict] = …, online: bool = …, api_base: Optional[str] = …, now_ms: Optional[int] = …, timeout: float = …, holder: Optional[dict] = …) -> MandateResultCheck another agent's mandate token; see the module docstring.
verify_tab
provenanceauth_verify.verify_tab(token: str, jwks: dict, seller: str, revocations: Optional[CachedRevocations], amount: Optional[float] = …, now_ms: Optional[int] = …) -> TabResultThe seller's offline check of one call's tab token.
verify_revocation_list
provenanceauth_verify.verify_revocation_list(jws: str, jwks: dict, aud: str) -> Optional[dict]The list's payload when its signature, typ and audience check out, else None.
fetch_revocations
provenanceauth_verify.fetch_revocations(api_base: str, aud: str, jwks: dict, current: Optional[CachedRevocations] = …, timeout: float = …) -> Optional[CachedRevocations]GET /v1/public/revocations?aud= with If-None-Match.
sign_usage_statement
provenanceauth_verify.sign_usage_statement(payload: dict, private_jwk: dict) -> dictSign a usage statement (tab_id, period_start, period_end, calls, amount) with the seller's key.
verify_usage_statement
provenanceauth_verify.verify_usage_statement(statement: str, keys: list, seller: Optional[str] = …) -> boolucp_hashed_checkout
provenanceauth_verify.ucp_hashed_checkout(checkout: dict) -> dictThe checkout minus UCP_HASH_EXCLUDED (the members checkout_hash covers).
ucp_checkout_hash
provenanceauth_verify.ucp_checkout_hash(checkout: dict) -> strcheckout_hash: SHA-256 hex of the JCS form of the checkout minus UCP_HASH_EXCLUDED.
ucp_binding_payload
provenanceauth_verify.ucp_binding_payload(checkout: dict, payee: str) -> dictThe object an intent token's payload_hash binds for this checkout.
ucp_binding_hash
provenanceauth_verify.ucp_binding_hash(checkout: dict, payee: str) -> strThe payload_hash an intent token carries for this checkout.