garyf / json_web_token_ex

An Elixir implementation of the JSON Web Token (JWT) Standard, RFC 7519

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve RS256 documentation

ohanhi opened this issue · comments

Hey, thanks for this great lib!

I had a bit of trouble switching from HS256 to RS256, as the documentation only states to include < RSA private key > in the options. I think it would be worthwhile to reformat this into e.g. the following:

# sign with RSA SHA256 algorithm
private_key = JsonWebToken.Algorithm.RsaUtil.private_key("path/to/", "key.pem")
opts = %{
  alg: "RS256",
  key: private_key
}

closed with v0.2.5, bc73974