Sha256: b114e1e3e1fed9979ee8dd62d9379863526ad1a97f96fb14813cade0103287aa

Contents?: true

Size: 351 Bytes

Versions: 10

Compression:

Stored size: 351 Bytes

Contents

module Braintree
  module SHA256Digest # :nodoc:
    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::Digest.new("sha256")
      OpenSSL::HMAC.hexdigest(sha256, key_digest, message.to_s)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
braintree-2.37.0 lib/braintree/sha256_digest.rb
braintree-2.36.0 lib/braintree/sha256_digest.rb
braintree-2.35.0 lib/braintree/sha256_digest.rb
braintree-2.34.1 lib/braintree/sha256_digest.rb
braintree-2.34.0 lib/braintree/sha256_digest.rb
braintree-2.33.1 lib/braintree/sha256_digest.rb
braintree-2.33.0 lib/braintree/sha256_digest.rb
braintree-2.32.1 lib/braintree/sha256_digest.rb
braintree-2.31.0 lib/braintree/sha256_digest.rb
braintree-2.30.2 lib/braintree/sha256_digest.rb