@hiogawa/tiny-jwt
TypeScript icon, indicating that this package has built-in type declarations

0.2.8-pre.2 • Public • Published

tiny-jwt

Minimal JWT library base on WebCrypto API.

See tests ./src/*.test.ts for the usage.

# generate key in JWK format
tiny-jwt keygen HS256
{
  "key_ops": [
    "sign",
    "verify"
  ],
  "ext": true,
  "kty": "oct",
  "k": "eIlE_krFljjdMaGOEUHqTkvBgknkEQK_Q3VjMHDagJlde-36x1YXfjowvKs8mTSH6gJyml6HvW1qLhG75HOW_g",
  "alg": "HS256"
}

todo

  • [x] JWS (json web signature)
    • [x] HMAC (alg = HS256)
    • [x] ECDSA (alg = ES256)
  • [x] JWE (json web encryption)
    • [x] AES-GCM (alg = dir, enc = A256GCM)
  • [x] support exp
  • [ ] more tests
  • [x] demo cli (key generation, etc...)
  • [ ] demo frontend

references

Readme

Keywords

none

Package Sidebar

Install

npm i @hiogawa/tiny-jwt

Weekly Downloads

893

Version

0.2.8-pre.2

License

MIT

Unpacked Size

58 kB

Total Files

16

Last publish

Collaborators

  • hiogawa