Skip to main content

algovoi-rfc9421-verifier (Python)

AlgoVoi-authored reference verifier for RFC 9421 (HTTP Message Signatures) plus RFC 9530 (Digest Fields for HTTP). Python and TypeScript, byte-for-byte parity, Apache 2.0.

What it does

  • Verify an incoming RFC 9421-signed HTTP request against a known public key.
  • Re-validate a captured request after it traverses a TLS-re-terminating proxy chain (the property pinned in the rfc9421_proxy_chain_v0 conformance fixture).
  • Build conformance test harnesses anchored to the RFC 8032 Section 7.1 deterministic Ed25519 reference keypair.

This package verifies HTTP message signatures (RFC 9421 + RFC 9530): the wire-level signing-base reconstruction, the Content-Digest check, and the Ed25519 signature check against a supplied public key. That is a different surface from the AlgoVoi JCS RFC 8785 receipt-body discipline. HTTP signature verification (this package) and receipt-content verification (the AlgoVoi receipt-format packages) are complementary: this verifier confirms wire-level message integrity; the JCS substrate confirms receipt-body canonical integrity.

Verification options

verify_request applies hardening on top of the signature check. Verifying the signature alone does not make an authentic request safe; these arguments enforce freshness, coverage, and algorithm policy:

  • required_components — reject unless every listed component (e.g. @method, @authority, @path) is covered by the signature (closes request-line-rewrite gaps).
  • require_content_digest (default True) — require content-digest to be a covered component and verify it against the body (no body-swap).
  • allowed_algorithms (default {"ed25519"}) — algorithm allow-list; an absent alg is always rejected.
  • now, max_age_seconds, max_skew_seconds, require_created, enforce_expires — freshness window; only signed created / expires are trusted.
  • nonce_seen — single-use nonce store probe (nonce, keyid) -> seen, checked after the signature verifies; fails closed on a store error.
  • expected_tag / require_tag — enforce the RFC 9421 tag (anti cross-protocol reuse).

Always on: non-canonical, off-curve, and small-order Ed25519 public keys are rejected before verification, and the Signature value must be canonical base64.

from algovoi_rfc9421_verifier import verify_request

result = verify_request(
    method="POST", authority="api.example", path="/pay",
    headers=headers, body=body, public_key=pubkey_hex,
    required_components=["@method", "@authority", "@path"],
    require_created=True, max_age_seconds=300,
    nonce_seen=store.seen,
)
if not result.valid:
    ...  # deny

Install

pip install algovoi-rfc9421-verifier

License

Apache 2.0. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

algovoi_rfc9421_verifier-0.4.4.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

algovoi_rfc9421_verifier-0.4.4-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file algovoi_rfc9421_verifier-0.4.4.tar.gz.

File metadata

  • Download URL: algovoi_rfc9421_verifier-0.4.4.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for algovoi_rfc9421_verifier-0.4.4.tar.gz
Algorithm Hash digest
SHA256 8644136f73602868c403f4ab219857d0ff53d232d72745113dbecfe984a8f918
MD5 2e53c1c3c552e54c43c4c803f5362618
BLAKE2b-256 80efa97501ca11983fa099499e7f80001a5e744c4efbd7bc188899fb4ea8222b

See more details on using hashes here.

File details

Details for the file algovoi_rfc9421_verifier-0.4.4-py3-none-any.whl.

File metadata

File hashes

Hashes for algovoi_rfc9421_verifier-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 15837971709569a1fefd01472789f0a6f357ec68632f77027de3f8d70176f955
MD5 9cbbb43cb28cdcfc94a6ed62bd938196
BLAKE2b-256 244a8e3612582f3b7a1ff2a96c90f353d1b75c20c1df266f354d9e86271191c4

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.4 This release

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.3

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page