/

Verifying an ECDSA-signed JWT using jsrsasign

JWTJavaScriptECDSA
Table of contents
  • Source
  • Further Reading

It's as easy as:

javascript
import jsrsasign from "jrsasign";
const publicKey = jsrsasign.KEYUTIL.getKey(publicKeyStr);
const isVerified = jsrsasign.KJUR.jws.JWS.verifyJWT(jwt, publicKey, {
alg: ["ES256", "ES384", "ES512"],
});

Source

  • Tutorial for JWT verification

Further Reading

Want to make your own site like this? Try gatsby-theme-code-notes by Zander Martineau.
Notes on code. My second brain, by Sal Rahman.