#!/usr/bin/env bash # # End-to-end demonstration of every evidence-seal feature, run against the CLI. # # Exercises seal, verify, chain, keygen, sign, and RFC 3161 timestamping — # including the adversarial cases that must fail — and prints a pass/fail tally. # Exits non-zero if any check does not behave as expected. # # The timestamp tokens are minted by a local self-signed TSA (scripts/_local_tsa.py) # so the full flow, including signature verification, runs offline. Needs the # optional extras: pip install -e ".[sign,timestamp]" # # Usage: scripts/e2e.sh set -u SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO="$(dirname "$SCRIPT_DIR")" # Prefer the project venv; fall back to whatever is on PATH. if [[ -x "$REPO/.venv/bin/python" ]]; then PY="$REPO/.venv/bin/python" else PY="$(command -v python3 || command -v python)" fi ES="$PY -m evidence_seal" TSA="$PY $SCRIPT_DIR/_local_tsa.py" W="$(mktemp -d)" trap 'rm -rf "$W"' EXIT pass=0; fail=0 step() { printf '\n\033[1m━━━ %s\033[0m\n' "$*"; } run() { printf '$ %s\n' "$*"; eval "$*"; } # assert_exit