Pure code in federation/protocol/signatures, one module per scheme and
a registry to pick them by name:
- draft-cavage: sign (request-target) host date digest with rsa-sha256;
verify rsa-sha256/hs2019, require the ActivityPub minimum, check
Digest and a ±12h Date window
- RFC 9421: sign @method @target-uri content-digest with
rsa-v1_5-sha256 and created/keyid/alg; verify with a generic
signature-base builder, created/expires checks and Content-Digest
(sha-256/sha-512); includes the RFC 8941 subset these headers use
- Failures carry a reason (missing, malformed, expired,
digest_mismatch, bad_signature, unsupported, unknown_key,
insufficient) for metrics
Tested against the published vectors (draft-cavage-12 C.1 and C.2,
RFC 9421's rsa-v1_5-sha256 example; test keys extracted from the
specs into tests/data), round trips, and tampering with body, URL,
method, date, key, coverage and clock.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW