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.86.0 lib/braintree/sha256_digest.rb
braintree-2.85.0 lib/braintree/sha256_digest.rb
braintree-2.84.0 lib/braintree/sha256_digest.rb
braintree-2.83.0 lib/braintree/sha256_digest.rb
braintree-2.82.0 lib/braintree/sha256_digest.rb
braintree-2.81.0 lib/braintree/sha256_digest.rb
braintree-2.80.1 lib/braintree/sha256_digest.rb
braintree-2.80.0 lib/braintree/sha256_digest.rb
braintree-2.79.0 lib/braintree/sha256_digest.rb
braintree-2.78.0 lib/braintree/sha256_digest.rb
braintree-2.77.0 lib/braintree/sha256_digest.rb
braintree-2.76.0 lib/braintree/sha256_digest.rb
braintree-2.75.0 lib/braintree/sha256_digest.rb
braintree-2.74.0 lib/braintree/sha256_digest.rb
braintree-2.73.0 lib/braintree/sha256_digest.rb
braintree-2.72.0 lib/braintree/sha256_digest.rb
braintree-2.71.0 lib/braintree/sha256_digest.rb
braintree-2.70.0 lib/braintree/sha256_digest.rb
braintree-2.69.1 lib/braintree/sha256_digest.rb
braintree-2.69.0 lib/braintree/sha256_digest.rb