frank_jwt 2.1.1

Implementation of JSON JWT
Documentation

Frank JWT Build Status crates.io

Implementation of JSON Web Tokens in Rust. It supports HS256, 384 and 512 signature algorithms.

Usage

Put this in your Cargo.toml:

[dependencies]
frank_jwt = "*"

And this in your crate root:

extern crate frank_jwt;

use frank_jwt::Header;
use frank_jwt::Payload;
use frank_jwt::encode;
use frank_jwt::decode;
use frank_jwt::Algorithm;

Example

let mut payload = Payload::new();
payload.insert("key1".to_string(), "val1".to_string());
payload.insert("key2".to_string(), "val2".to_string());
payload.insert("key3".to_string(), "val3".to_string());

let secret = "secret123";
let header = Header::new(Algorithm::HS256);

let jwt = encode(header, secret.to_string(), payload.clone());

License

Apache 2.0

Tests

cargo test

I'm available for hire

I'm a freelance developer and looking forward to new challenges.

My email: me [/at] gildedhonour.com

Website: www.gildedhonour.com, my CV can be found there.