Skip to main content

algovoi-rfc9421-keyid

SSRF-guarded resolution of an RFC 9421 signature keyid to a raw 32-byte Ed25519 public key, plus the inverse key-publication helpers. Companion to algovoi-rfc9421-verifier and algovoi-rfc9421-signer.

The verifier is a pure, offline function. Key resolution is a separate concern because it does outbound network I/O, so it lives in its own package with its own version and its own security surface.

Key sources

  • inline (did:key:z...): the key is encoded in the identifier itself, so no network call is made. This is the preferred, SSRF-safe path.
  • cache: a caller-supplied cache is consulted before any fetch.
  • resolver: an HTTPS GET of a did:web: DID or a plain https URL, accepting both a W3C did.json (Ed25519VerificationKey2020 / publicKeyMultibase / JWK) and the { "address", "public_key" } shape.

SSRF guard (resolver path)

  • https only.
  • Resolved addresses are checked against a non-public blocklist (private, loopback, link-local including cloud metadata, multicast, reserved).
  • The actual connected peer IP is re-checked after connect, which defeats a DNS rebind between the check and the connection.
  • Redirects are re-validated on every hop and capped.
  • Response size and total time are capped.

Install

pip install algovoi-rfc9421-keyid

did:key, did:web, hex, multibase, base64 and JWK key shapes are stdlib-only. PEM public keys additionally need the optional extra:

pip install algovoi-rfc9421-keyid[pem]

Usage

from algovoi_rfc9421_keyid import resolve_keyid, encode_did_key

# inline, no network
r = resolve_keyid(encode_did_key(pub_bytes))
assert r.key_source == "inline"

# did:web, SSRF-guarded HTTPS resolution
r = resolve_keyid("did:web:api.example.com")
verify_key = r.public_key  # raw 32-byte Ed25519 key

# publish your own key (the inverse)
from algovoi_rfc9421_keyid import build_did_document, build_key_source
did_json = build_did_document("did:web:api.example.com", pub_bytes)

Apache-2.0.

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_keyid-0.1.0.tar.gz (12.0 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_keyid-0.1.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file algovoi_rfc9421_keyid-0.1.0.tar.gz.

File metadata

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

File hashes

Hashes for algovoi_rfc9421_keyid-0.1.0.tar.gz
Algorithm Hash digest
SHA256 160ad19ddc447222e0550cbd40bb5d9ded5d9373885aa450c2174fdd80d904ac
MD5 0552329ef28eae4efe4d7a192f952825
BLAKE2b-256 1671efc0c1c0d78b715a2da12d95e7e6f9dbb24abecf91992bec6b91283609d5

See more details on using hashes here.

File details

Details for the file algovoi_rfc9421_keyid-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for algovoi_rfc9421_keyid-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79d1625d5115812d2eda5dda633077eee05cad1b84c7b935862bbfee07c348a9
MD5 b0dc347db1c2e8d69cbd54b459549b37
BLAKE2b-256 311f121d8bf1a1829c4d767e141d235994b8eb9ca3f7feb2e7b3a979ad8c6153

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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