Sha256: abfcd3bb798f4bfae8f7ec357fb708ca31e9bba5b556ee673ea27fc7490064ae

Contents?: true

Size: 338 Bytes

Versions: 4

Compression:

Stored size: 338 Bytes

Contents

# frozen_string_literal: true

module Veriff
  module Security
    def generate_signature(options)
      Digest::SHA256.hexdigest(
        "#{options[:signature] || options[:body]}#{configuration.api_secret}"
      )
    end

    def validate_signature(body, signature)
      generate_signature(body: body) == signature
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
veriff-0.2.2 lib/veriff/security.rb
veriff-0.2.1 lib/veriff/security.rb
veriff-0.2.0 lib/veriff/security.rb
veriff-0.1.0 lib/veriff/security.rb