Sha256: e81b49155ab9cb40e2f881c0dd4b5290b62e2b08ab7420c7403112eb72e4ab10

Contents?: true

Size: 544 Bytes

Versions: 29

Compression:

Stored size: 544 Bytes

Contents

# typed: true

# Copyright (c) 2015 Sqreen. All Rights Reserved.
# Please refer to our terms for more information: https://www.sqreen.com/terms.html

require 'openssl'

## Rules signature
module Sqreen
  # Perform an EC + digest verification of a message.
  class SignatureVerifier
    def initialize(key, digest)
      @pub_key              = OpenSSL::PKey.read(key)
      @digest               = digest
    end

    def verify(sig, val)
      hashed_val = @digest.digest(val)
      @pub_key.dsa_verify_asn1(hashed_val, sig)
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
sqreen-1.22.0-java lib/sqreen/signature_verifier.rb
sqreen-1.22.0 lib/sqreen/signature_verifier.rb
sqreen-1.21.1-java lib/sqreen/signature_verifier.rb
sqreen-1.21.1 lib/sqreen/signature_verifier.rb
sqreen-1.21.0-java lib/sqreen/signature_verifier.rb
sqreen-1.21.0 lib/sqreen/signature_verifier.rb
sqreen-1.20.4-java lib/sqreen/signature_verifier.rb
sqreen-1.20.4 lib/sqreen/signature_verifier.rb
sqreen-1.21.0.beta3-java lib/sqreen/signature_verifier.rb
sqreen-1.21.0.beta3 lib/sqreen/signature_verifier.rb
sqreen-1.20.4.beta1 lib/sqreen/signature_verifier.rb
sqreen-1.19.4 lib/sqreen/signature_verifier.rb
sqreen-1.20.3 lib/sqreen/signature_verifier.rb
sqreen-1.20.2 lib/sqreen/signature_verifier.rb
sqreen-1.21.0.beta2 lib/sqreen/signature_verifier.rb
sqreen-1.21.0.beta1 lib/sqreen/signature_verifier.rb
sqreen-1.20.1-java lib/sqreen/signature_verifier.rb
sqreen-1.20.1 lib/sqreen/signature_verifier.rb
sqreen-1.20.0-java lib/sqreen/signature_verifier.rb
sqreen-1.20.0 lib/sqreen/signature_verifier.rb