Verify a JWT signature to prove the token was issued by whoever holds the key and was not changed since. Tokens signed with HS256, HS384 or HS512 need the shared secret; RS*, PS* and ES* tokens need the issuer's public key, as PEM (-----BEGIN PUBLIC KEY-----), a JWK, or the whole JWKS from the issuer's /.well-known/jwks.json (the key is picked by the token's kid).
The algorithm comes from the token header, but a public key is never used as an HMAC secret, so the classic "algorithm confusion" forgery fails here, and unsigned alg: none tokens are refused. The exp and nbf claims are checked against your clock.
Verification uses the browser's Web Crypto API: the token and the key never leave your machine. Still, avoid pasting production secrets into any website. To only read a token's claims, use the JWT Decoder .
It depends on the alg in the header. HS256, HS384 and HS512 tokens need the same shared secret that signed them. RS, PS and ES tokens need the issuer's public key, as PEM, a JWK, or the JWKS published by the identity provider.
Not by itself. Also check that it has not expired (exp), is already valid (nbf), and that the issuer (iss) and audience (aud) are the ones your application expects.
Verification runs in your browser with the Web Crypto API and nothing is sent to a server. Even so, treat production secrets with care and prefer test keys when debugging.