Sha256: 2765eca3085e7614bd3571042712ad235881686bef546e775f2319d5f5aa27fb

Contents?: true

Size: 343 Bytes

Versions: 92

Compression:

Stored size: 343 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.new("sha256")
      OpenSSL::HMAC.hexdigest(sha256, key_digest, message.to_s)
    end
  end
end

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
braintree-2.68.2 lib/braintree/sha256_digest.rb
braintree-2.68.1 lib/braintree/sha256_digest.rb
braintree-2.68.0 lib/braintree/sha256_digest.rb
braintree-2.67.0 lib/braintree/sha256_digest.rb
braintree-2.66.0 lib/braintree/sha256_digest.rb
braintree-2.65.0 lib/braintree/sha256_digest.rb
braintree-2.64.0 lib/braintree/sha256_digest.rb
braintree-2.63.0 lib/braintree/sha256_digest.rb
braintree-2.62.0 lib/braintree/sha256_digest.rb
braintree-2.61.1 lib/braintree/sha256_digest.rb
braintree-2.61.0 lib/braintree/sha256_digest.rb
braintree-2.60.0 lib/braintree/sha256_digest.rb
braintree-2.59.0 lib/braintree/sha256_digest.rb
braintree-2.58.0 lib/braintree/sha256_digest.rb
braintree-2.57.0 lib/braintree/sha256_digest.rb
braintree-2.56.0 lib/braintree/sha256_digest.rb
braintree-2.55.0 lib/braintree/sha256_digest.rb
braintree-2.54.0 lib/braintree/sha256_digest.rb
braintree-2.50.0 lib/braintree/sha256_digest.rb
braintree-2.49.0 lib/braintree/sha256_digest.rb