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 plainhttpsURL, accepting both a W3Cdid.json(Ed25519VerificationKey2020 / publicKeyMultibase / JWK) and the{ "address", "public_key" }shape.
SSRF guard (resolver path)
httpsonly.- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
160ad19ddc447222e0550cbd40bb5d9ded5d9373885aa450c2174fdd80d904ac
|
|
| MD5 |
0552329ef28eae4efe4d7a192f952825
|
|
| BLAKE2b-256 |
1671efc0c1c0d78b715a2da12d95e7e6f9dbb24abecf91992bec6b91283609d5
|
File details
Details for the file algovoi_rfc9421_keyid-0.1.0-py3-none-any.whl.
File metadata
- Download URL: algovoi_rfc9421_keyid-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79d1625d5115812d2eda5dda633077eee05cad1b84c7b935862bbfee07c348a9
|
|
| MD5 |
b0dc347db1c2e8d69cbd54b459549b37
|
|
| BLAKE2b-256 |
311f121d8bf1a1829c4d767e141d235994b8eb9ca3f7feb2e7b3a979ad8c6153
|