Sha256: 56587a5b474b717e30d314708b1b3084ae472618fc09ea172b3405dbb5a44907

Contents?: true

Size: 673 Bytes

Versions: 1

Compression:

Stored size: 673 Bytes

Contents

%w{version errors asn1 crl_validator ocsp}.each { |f| require "cert_validator/#{f}" }

class CertValidator
  attr_reader :certificate
  attr_reader :ca

  def initialize(cert, ca)
    @certificate = cert
    @ca = ca
  end

  def crl=(crl)
    crl_validator.crl = crl
  end

  def crl_available?
    crl_validator.available?
  end

  def crl_valid?
    crl_validator.valid?
  end

  def ocsp_available?
    ocsp_validator.available?
  end

  def ocsp_valid?
    ocsp_validator.valid?
  end

  private
  def crl_validator
    @crl_validator ||= CrlValidator.new certificate, ca
  end

  def ocsp_validator
    @ocsp_validator ||= OcspValidator.new certificate, ca
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cert_validator-0.0.1 lib/cert_validator.rb