Sha256: d862187b15a427c96b77a7a06a1d186b8d608503ff7328ad05425a407d1b0873

Contents?: true

Size: 570 Bytes

Versions: 3

Compression:

Stored size: 570 Bytes

Contents

# frozen_string_literal: true
module RubyScep
  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 lib/ruby_scep/configuration.rb
ruby_scep-0.2.0 lib/ruby_scep/configuration.rb
ruby_scep-0.1.0 lib/ruby_scep/configuration.rb