Skip to content

Commit

Permalink
chore: Fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
anakinj committed Sep 15, 2024
1 parent 059a3da commit 075e7d7
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,22 @@

A library extending the ruby-jwt gem with EdDSA algorithms. Based on [RFC 8037](https://datatracker.ietf.org/doc/html/rfc8037).

**NOTE: This gem is still WIP**

Work is currently done in [ruby-jwt](https://github.com/jwt/ruby-jwt/pull/607) to allow extending the algorithms.

Plan is to replace rbnacl with something else in the near future.

## Installation

Will only work with the WIP branch, so adding the following to your the Gemfile should do the trick:
Add the following to your Gemfile

```
gem "jwt", github: "anakinj/ruby-jwt", branch: "extendable-algos"
gem "jwt-eddsa"
```

```
require "jwt/eddsa" # not verified if this actually works
require "jwt/eddsa"
```

## Usage

```ruby
private_key = RbNaCl::Signatures::Ed25519::SigningKey.new("b" * 32)
private_key = Ed25519::SigningKey.new("b" * 32)
token = JWT.encode({pay: "load"}, private_key, "EdDSA")
payload, header = JWT.decode(token, private_key.verify_key, true, algorithm: "EdDSA")
```
Expand Down

0 comments on commit 075e7d7

Please sign in to comment.