Class: UDAPSecurityTestKit::DefaultCertFileLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/udap_security_test_kit/default_cert_file_loader.rb

Class Method Summary collapse

Class Method Details

.load_default_ca_pem_fileObject



3
4
5
6
7
# File 'lib/udap_security_test_kit/default_cert_file_loader.rb', line 3

def self.load_default_ca_pem_file
  raw_cert = File.read(File.join(File.dirname(__FILE__), 'certs/InfernoCA.pem'))
  cert = OpenSSL::X509::Certificate.new raw_cert
  cert.to_pem
end

.load_default_ca_private_key_fileObject



9
10
11
12
13
# File 'lib/udap_security_test_kit/default_cert_file_loader.rb', line 9

def self.load_default_ca_private_key_file
  raw_key = File.read(File.join(File.dirname(__FILE__), 'certs/InfernoCA.key'))
  private_key = OpenSSL::PKey::RSA.new raw_key
  private_key.to_pem
end

.load_test_client_cert_pem_fileObject



15
16
17
18
19
# File 'lib/udap_security_test_kit/default_cert_file_loader.rb', line 15

def self.load_test_client_cert_pem_file
  raw_cert = File.read(File.join(File.dirname(__FILE__), 'certs/TestClient.pem'))
  cert = OpenSSL::X509::Certificate.new raw_cert
  cert.to_pem
end

.load_test_client_private_key_fileObject



21
22
23
24
25
# File 'lib/udap_security_test_kit/default_cert_file_loader.rb', line 21

def self.load_test_client_private_key_file
  raw_key = File.read(File.join(File.dirname(__FILE__), 'certs/TestClientPrivateKey.key'))
  key = OpenSSL::PKey::RSA.new raw_key
  key.to_pem
end