Sha256: 24bfc492c0a45ee891fea6060f374d1206edce706be1222691b1b9f2d0c6e83e

Contents?: true

Size: 333 Bytes

Versions: 8

Compression:

Stored size: 333 Bytes

Contents

module Braintree
  module SHA256Digest
    def self.hexdigest(private_key, string)
      _hmac(private_key, string)
    end

    def self._hmac(key, message)
      key_digest = ::Digest::SHA256.digest(key)
      sha256 = OpenSSL::Digest.new("sha256")
      OpenSSL::HMAC.hexdigest(sha256, key_digest, message.to_s)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
braintree-4.23.0 lib/braintree/sha256_digest.rb
braintree-4.22.0 lib/braintree/sha256_digest.rb
braintree-4.21.0 lib/braintree/sha256_digest.rb
braintree-4.20.0 lib/braintree/sha256_digest.rb
braintree-4.19.0 lib/braintree/sha256_digest.rb
braintree-4.18.0 lib/braintree/sha256_digest.rb
braintree-4.17.0 lib/braintree/sha256_digest.rb
braintree-4.16.0 lib/braintree/sha256_digest.rb