Spindle_http.JwsJSON Web Signatures in the compact serialization (RFC 7515 §7.1): a header, a payload and a signature, checked against public keys (Jwk) by RS256, ES256 or EdDSA. No other algorithm is checked: "none" signs nothing, and an HMAC's key is a secret both ends hold, which a public key set never is.
let* jws = Jws.of_string token in
let* payload = Jws.verify jws ~keys in
...type error = | Malformed of stringnot three base64url parts, or a header that is no JSON object of what RFC 7515 §4.1 asks; in words, quoting nothing
*)| Unsupported_algorithm of stringan "alg" other than the three
| Critical of string lista "crit": RFC 7515 §4.1.11 has a reader refuse every extension it does not understand, and this one understands none
| No_keyno key of the alg's kind, and of the "kid" where one is named
| Bad_signatureval error_to_string : error -> stringA compact JWS: each part base64url without padding, the header a JSON object naming "alg", no member given twice (RFC 7515 §4). The payload is not read.
val alg : t -> stringval kid : t -> string optionval typ : t -> string optionThe header's "typ", as written: a media type, compared without case.