Skip to content

Commit

Permalink
chore: use correct arguments for custom algo example
Browse files Browse the repository at this point in the history
  • Loading branch information
aedryan authored and anakinj committed Sep 25, 2024
1 parent 3d0a573 commit a40f8d7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

**Fixes and enhancements:**

- Updated README to correctly document `OpenSSL::HMAC` documentation [#617](https://github.com/jwt/ruby-jwt/pull/617) ([@aedryan](https://github.com/aedryan))
- Your contribution here

## [v2.9.1](https://github.com/jwt/ruby-jwt/tree/v2.9.1) (2024-09-23)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ module CustomHS512Algorithm
end

def self.sign(data:, signing_key:)
OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha512'), data, signing_key)
OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha512'), signing_key, data)
end

def self.verify(data:, signature:, verification_key:)
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/readme_examples_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def self.alg
end

def self.sign(data:, signing_key:)
OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha512'), data, signing_key)
OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha512'), signing_key, data)
end

def self.verify(data:, signature:, verification_key:)
Expand Down

0 comments on commit a40f8d7

Please sign in to comment.