Skip to content

Latest commit

 

History

History
58 lines (37 loc) · 1.21 KB

README.md

File metadata and controls

58 lines (37 loc) · 1.21 KB

JWTe TravisCI build License

By Thomas Bhatia ([email protected])

Description

A light and compact yet fully IETF RFC 7518 compliant JSON Web Token (JWT) library for Erlang.

Supports the following algorithms:

  • HMAC with SHA-2
  • HS256
  • HS384
  • HS512
  • RSA PKCS1-v1_5 rsassa_pkcs1_sign / rsassa_pkcs1_verify
  • RS256
  • RS384
  • RS512
  • ECDSA rsaes_pkcs1_encrypt / rsaes_pkcs1_verify
  • ES256 - secp256r1
  • ES384 - secp384r1
  • ES512 - secp512r1

Installation

Add JWTe to your rebar.config dependencies:

{deps, [
    {jwte,{git , "[email protected]:thomasbhatia/jwte.git", {tag, "v0.5.0"}}}
]}.

Usage

Encode

jwte:encode(#{foo => bar}, Key).

Decode

Decode payload with verification

jwte:decode(<<"XXXX">>, Key).

Peek

Decode without verifying the payload

jwte:peek(<<"XXXX">>).

License

JWTe is released under BSD (see LICENSE).