class Dor::CertificateAuthenticatedRestResourceFactory

Private Instance Methods

cert() click to toggle source

@return [OpenSSL::X509::Certificate]

# File lib/dor/certificate_authenticated_rest_resource_factory.rb, line 18
def cert
  @cert ||= OpenSSL::X509::Certificate.new(File.read(cert_file)) if cert_file
end
cert_file() click to toggle source
# File lib/dor/certificate_authenticated_rest_resource_factory.rb, line 22
def cert_file
  Dor::Config.ssl.cert_file
end
connection_options() click to toggle source

@return [Hash] options for creating a RestClient::Resource

Calls superclass method
# File lib/dor/certificate_authenticated_rest_resource_factory.rb, line 10
def connection_options
  params = super
  params[:ssl_client_cert] = cert if cert
  params[:ssl_client_key]  = key if key
  params
end
key() click to toggle source

@return [OpenSSL::PKey::RSA]

# File lib/dor/certificate_authenticated_rest_resource_factory.rb, line 35
def key
  @key ||= OpenSSL::PKey::RSA.new(File.read(key_file), key_pass) if key_file
end
key_file() click to toggle source
# File lib/dor/certificate_authenticated_rest_resource_factory.rb, line 26
def key_file
  Dor::Config.ssl.key_file
end
key_pass() click to toggle source
# File lib/dor/certificate_authenticated_rest_resource_factory.rb, line 30
def key_pass
  Dor::Config.ssl.key_pass
end