ans-verify

command
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Command ans-verify is an offline verifier for SCITT COSE receipts served by the ANS Transparency Log. It mirrors the reference's `cmd/ans-verify` binary so third-party tooling written against the reference works unchanged against ans-tl.

Typical use:

ans-verify -url http://localhost:18081 -agent <agentId>

With the above invocation the tool:

  1. Fetches the TL's verification keys from /root-keys in the sumdb-note verification format.
  2. Fetches the receipt from /v1/agents/{agentId}/receipt as raw CBOR.
  3. Parses the COSE_Sign1 structure, decodes the protected header (algorithm, kid, VDS, CWT issuer/iat), and extracts the inclusion proof from the unprotected header (label 396 → {treeSize, leafIndex, path, rootHash}).
  4. Walks the proof from the leaf hash (RFC 6962: SHA-256(0x00 || event_bytes)) to the stored root.
  5. Verifies the ES256 signature against one of the fetched verification keys.
  6. Fetches the badge (/v1/agents/{agentId}) and cross-checks that the badge's merkleProof matches the receipt's proof.

If -pubkey <path> is given, the tool loads that PEM public key instead of fetching /root-keys. This is useful for air-gapped verification against a receipt saved to disk.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL