Handles the loading and caching of certificates and private keys.
# File lib/ssl_test/certificate_manager.rb, line 5 def initialize(certinfo) @certinfo = certinfo end
# File lib/ssl_test/certificate_manager.rb, line 13 def get_cert(name) OpenSSL::X509::Certificate.new(get_raw_cert(name)) end
# File lib/ssl_test/certificate_manager.rb, line 25 def get_chain(list) list.map { |name| get_cert(name) } end
# File lib/ssl_test/certificate_manager.rb, line 21 def get_key(name) OpenSSL::PKey.read(get_raw_key(name)) end
# File lib/ssl_test/certificate_manager.rb, line 29 def get_keychain(list) list.map { |name| get_key(name) } end
# File lib/ssl_test/certificate_manager.rb, line 9 def get_raw_cert(name) File.read(File.join('certs',name+"cert.pem")) end
# File lib/ssl_test/certificate_manager.rb, line 17 def get_raw_key(name) File.read(File.join('certs',name+"key.pem")) end