Sha256: e1658d2cb174f8bffc2fbda319378c6752ac42e0213efdc4bc3cf3178c36d09a

Contents?: true

Size: 363 Bytes

Versions: 55

Compression:

Stored size: 363 Bytes

Contents

module Cobrato
  class Signature
    attr_accessor :secret

    def initialize(secret)
      @secret = secret
    end

    def check?(cobrato_request_id, signature_to_check, body)
      cobrato_signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha1'), secret, "#{cobrato_request_id}#{body}")
      signature_to_check == cobrato_signature
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
cobrato-client-1.1.7 lib/cobrato/signature.rb
cobrato-client-1.1.6 lib/cobrato/signature.rb
cobrato-client-1.1.5 lib/cobrato/signature.rb
cobrato-client-1.1.4 lib/cobrato/signature.rb
cobrato-client-1.1.3 lib/cobrato/signature.rb
cobrato-client-1.1.2 lib/cobrato/signature.rb
cobrato-client-1.1.1 lib/cobrato/signature.rb
cobrato-client-1.1.0 lib/cobrato/signature.rb
cobrato-client-1.0.1 lib/cobrato/signature.rb
cobrato-client-1.0.0 lib/cobrato/signature.rb
cobrato-client-0.27.0 lib/cobrato/signature.rb
cobrato-client-0.26.0 lib/cobrato/signature.rb
cobrato-client-0.25.0 lib/cobrato/signature.rb
cobrato-client-0.24.1 lib/cobrato/signature.rb
cobrato-client-0.24.0 lib/cobrato/signature.rb
cobrato-client-0.23.0 lib/cobrato/signature.rb
cobrato-client-0.23.0.beta12 lib/cobrato/signature.rb
cobrato-client-0.23.0.beta11 lib/cobrato/signature.rb
cobrato-client-0.23.0.beta10 lib/cobrato/signature.rb
cobrato-client-0.23.0.beta9 lib/cobrato/signature.rb