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.
Metadata
Release files for algovoi-rfc9421-keyid 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| algovoi_rfc9421_keyid-0.1.0.tar.gz | 12.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| algovoi_rfc9421_keyid-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.7 kB
Release files / algovoi_rfc9421_keyid-0.1.0.tar.gz
| Download URL | algovoi_rfc9421_keyid-0.1.0.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
160ad19ddc447222e0550cbd40bb5d9ded5d9373885aa450c2174fdd80d904ac
|
|
BLAKE2b-256 checksum How to use checksums |
1671efc0c1c0d78b715a2da12d95e7e6f9dbb24abecf91992bec6b91283609d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / algovoi_rfc9421_keyid-0.1.0-py3-none-any.whl
| Download URL | algovoi_rfc9421_keyid-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
79d1625d5115812d2eda5dda633077eee05cad1b84c7b935862bbfee07c348a9
|
|
BLAKE2b-256 checksum How to use checksums |
311f121d8bf1a1829c4d767e141d235994b8eb9ca3f7feb2e7b3a979ad8c6153
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for algovoi-rfc9421-keyid 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.