Skip to main content

jwks_ed25519_keys

Function jwks_ed25519_keys 

Source
pub fn jwks_ed25519_keys(jwks: &Value) -> Vec<[u8; 32]>
Expand description

Extract every Ed25519 public key from a JWKS document (RFC 7517), decoded to raw 32-byte keys (#137 stage 2, JWKS fallback path).

Mirrors FederationKeyResolver::fetch_ed25519_key’s parse: an OKP key with crv == "Ed25519" and a base64url x of exactly 32 bytes. Keys that don’t match that shape (wrong kty/crv, malformed x) are skipped. A JWKS with no usable Ed25519 key yields an empty vec (→ no match → reject).

NOTE: this does not itself enforce a “federation”-tagged use; the caller supplies the federation JWKS document (e.g. the per-issuer jwks_uri already resolved/cached by FederationKeyResolver), and tag filtering, if any, is the caller’s policy. This keeps the decode pure and reuses the existing JWKS cache rather than adding a new fetch pipeline.