Sha256: 81a0a03a3ec827ae2b48908c76ee828d2c442cf699f7ea93aaca367ee3105405

Contents?: true

Size: 568 Bytes

Versions: 3

Compression:

Stored size: 568 Bytes

Contents

# frozen_string_literal: true
module Server
  class Configuration
    attr_accessor :ca_cert_path, :ca_key_path,
                  :ca, :ca_key,
                  :certificates_store

    def ca
      @ca ||= OpenSSL::X509::Certificate.new(File.read(@ca_cert_path))
    end

    def ca_key
      @ca_key ||= OpenSSL::PKey::RSA.new(File.read(@ca_key_path))
    end

    def certificates_store
      return @certificates_store if defined?(@certificates_store)
      @certificates_store = OpenSSL::X509::Store.new
      @certificates_store.add_cert(ca)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ruby_scep-0.2.1 example_server/configuration.rb
ruby_scep-0.2.0 example_server/configuration.rb
ruby_scep-0.1.0 example_server/configuration.rb