lib/signature.rb in signature-0.1.2 vs lib/signature.rb in signature-0.1.3
- old
+ new
@@ -1,6 +1,6 @@
-require 'hmac-sha2'
+require 'openssl'
module Signature
class AuthenticationError < RuntimeError; end
class Token
@@ -88,10 +88,11 @@
end
private
def signature(token)
- HMAC::SHA256.hexdigest(token.secret, string_to_sign)
+ digest = OpenSSL::Digest::SHA256.new
+ OpenSSL::HMAC.hexdigest(digest, token.secret, string_to_sign)
end
def string_to_sign
[@method, @path, parameter_string].join("\n")
end