talira

dart_jsonwebtoken

Sign, verify and decode JSON Web Tokens in Dart and Flutter

open sourceMITfree

dart_jsonwebtoken is a JSON Web Token (RFC 7519) library for Dart: you sign, verify and decode tokens with one call each. It covers 14 algorithms, HMAC (256/384/512), RSA-PKCS1, RSA-PSS, ECDSA (including secp256k1) and EdDSA on ed25519, loads secrets, PEM private keys and public keys from certificates, checks the iss, sub, aud, exp, nbf, iat and jti claims when verifying, and throws typed exceptions such as JWTExpiredException. It runs wherever Dart does: Flutter mobile and web, the Dart VM server and Dart CLIs.

Problems it solves

  • verify a JWT from my backend inside a Flutter app
  • sign a JSON Web Token with an RSA key in a Dart server
  • check a token's expiry and audience in Dart

Features

  • sign, verify and decode with one call each
  • 14 algorithms: HMAC, RSA-PKCS1, RSA-PSS, ECDSA (incl. secp256k1) and EdDSA (ed25519)
  • secrets, PEM private keys and public keys from certificates
  • iss, sub, aud, exp, nbf, iat and jti checked at verify time
  • typed exceptions such as JWTExpiredException
  • Flutter mobile and web, Dart VM server and CLI