#jwt #jws #jwk #jwks #verification #digital-signature #class #set #first #support

jwtk

JWT signing (JWS) and verification, with first class JWK and JWK Set (JWKS) support

7 releases

0.2.4 Jun 24, 2022
0.2.3 Apr 29, 2022
0.2.2 Jan 26, 2022
0.2.0 Aug 12, 2021
0.1.1 Aug 10, 2021

#300 in Cryptography

Download history 8905/week @ 2022-08-04 9209/week @ 2022-08-11 10398/week @ 2022-08-18 10344/week @ 2022-08-25 8594/week @ 2022-09-01 9309/week @ 2022-09-08 13891/week @ 2022-09-15 12799/week @ 2022-09-22 5732/week @ 2022-09-29 10623/week @ 2022-10-06 11279/week @ 2022-10-13 10854/week @ 2022-10-20 10579/week @ 2022-10-27 7729/week @ 2022-11-03 5780/week @ 2022-11-10 3852/week @ 2022-11-17

30,183 downloads per month

MIT license

85KB
2.5K SLoC

JWT signing (JWS) and verification, with first class JWK and JWK Set (JWKS) support.

Supports almost all JWS algorithms:

  • HS256, HS384, HS512
  • Ed25519
  • ES256, ES384, ES512, ES256K
  • RS256, RS384, RS512
  • PS256, PS384, PS512

Supports exp and nbf validations. (Other validations will not be supported, because they are mostly application specific and can be easily implemented by applications.)

Supports converting public/private keys to/from PEM/JWK. Supports working with generic keys (where the algorithm is determined at runtime), i.e. SomePrivateKey/SomePublicKey.

Uses good old openssl for crypto.

See the examples folder for some examples.

Dependencies

~2–11MB
~212K SLoC