-
-
Notifications
You must be signed in to change notification settings - Fork 649
Tutorial for JWT verification
TOP | DOWNLOADS | TUTORIALS | API REFERENCE | DEMOS
The 'jsrsasign' 4.8.0 or later supports validation for JSON Web Token(JWT) by KJUR.jws.JWS.verifyJWT method. To verify it, you need key for signature of JWT and some parameters.
If HMAC is used for JWT signing, you can specify shared key by a hexadecimal string of key. Otherwise, you may need to specify public key. Easiest way is to provide PEM text formatted X.509 public key certificate for JWT signer.
For example, certificate will be shown as following text.
----- BEGIN CERTIFICATE ----- MIIDET.... ... snip ... (Base64 encoded certificate) ----- END CERTIFICATE -----
When you have a string for PEM certificate, you can get public key object by following method.
var pubkey = KEYUTIL.getKey(certStr)