Skip to main content

verify_jwt_es256

Function verify_jwt_es256 

Source
pub fn verify_jwt_es256(
    token: &str,
    public_key: &VerifyingKey<NistP256>,
) -> Option<Claims>
Available on crate features auth-asymmetric and auth only.
Expand description

Verify a JWT signed with ES256 (ECDSA using P-256 and SHA-256) against a P-256 public key.

Returns Claims on success. Returns None on any failure: bad format, a header alg other than "ES256", signature mismatch, or an expired exp claim.

JWT ES256 signatures are the raw 64-byte r || s concatenation, not the ASN.1 DER encoding OpenSSL produces by default.