Skip to main content

aauth-signing

Standalone HTTP Message Signatures (RFC 9421) and the Signature-Key header, with the algorithm and validation rules used by AAuth Protocol draft -11.

from aauth_signing import sign_request, verify_signature
from aauth_signing.keys.keypair import generate_ed25519_keypair

private_key, public_key = generate_ed25519_keypair()
headers = {"Content-Type": "application/json"}
body = b'{"message":"hello"}'
headers.update(sign_request(
    "POST", "https://resource.example/data", headers, body, private_key,
    sig_scheme="hwk",
    additional_signature_components=["content-digest", "content-type"],
))
assert verify_signature(
    "POST", "https://resource.example/data", headers, body,
    headers["Signature-Input"], headers["Signature"], headers["Signature-Key"],
)

Supports hwk, jwks_uri, jwt, and jkt-jwt. AAuth agents use jwt; the generic schemes remain available for other callers. X.509 verification is not implemented.

Generated keys carry alg (Ed25519, ES256, or ES384). Verifiers reject missing or incompatible algorithms, missing/stale signature creation timestamps, expired signatures, missing required components, and body/digest mismatches. The default required components are @method, @authority, @path, and signature-key; configure required_components for the recipient's additional requirements. authorization is automatically covered when present.

Bodies are signed when requested through additional_signature_components. PS/AS and revocation callers must include content-digest and content-type. Verification checks the digest against received bytes. HTTP verification supports EC DER and P1363 signatures; JWT encoding uses standard JOSE encoding.

jwks_fetcher(issuer, dwk, kid) is synchronous and must perform admitted, identity-checked discovery and caching. The signing layer authenticates key possession; applications enforce JWT type, issuer trust, audience, authorization, and revocation. Use the aauth package for those protocol checks.

Development from the repository root:

pip install -e ./aauth-signing

Metadata

Release files for aauth-signing 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aauth-signing 0.2.0
File Size Uploaded
aauth_signing-0.2.0.tar.gz 20.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aauth-signing 0.2.0
File Interpreter ABI Platform
aauth_signing-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 44.4 kB

Release files / aauth_signing-0.2.0.tar.gz

Download URL aauth_signing-0.2.0.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2f2532bd15df0c8206911e678b0add7f5d3148a1d05459c206506bf08f549392
BLAKE2b-256 checksum
How to use checksums
dc728600e0ed64179e8dcaa84e7e49cd59a2b94947a818f211e6f4054f0c6684
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / aauth_signing-0.2.0-py3-none-any.whl

Download URL aauth_signing-0.2.0-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac646f959fb8e58fc902db9e789954c8d958d61c5e3afd41a4c26ccd488ccaee
BLAKE2b-256 checksum
How to use checksums
696a9077b9469ba84552e274ed2365b9d78c58df446528c0bc8affe9a2cb1722
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page