Class: Uninterruptible::TLSServerFactory::CertificateChain
- Inherits:
-
Object
- Object
- Uninterruptible::TLSServerFactory::CertificateChain
- Defined in:
- lib/uninterruptible/tls_server_factory.rb
Overview
Extracts pulling multiple certificates out of one file
Instance Attribute Summary collapse
-
#cert_file ⇒ Object
readonly
Returns the value of attribute cert_file.
Instance Method Summary collapse
-
#initialize(cert_file) ⇒ CertificateChain
constructor
A new instance of CertificateChain.
- #to_a ⇒ Object
Constructor Details
#initialize(cert_file) ⇒ CertificateChain
Returns a new instance of CertificateChain.
11 12 13 |
# File 'lib/uninterruptible/tls_server_factory.rb', line 11 def initialize(cert_file) @cert_file = cert_file end |
Instance Attribute Details
#cert_file ⇒ Object (readonly)
Returns the value of attribute cert_file.
9 10 11 |
# File 'lib/uninterruptible/tls_server_factory.rb', line 9 def cert_file @cert_file end |
Instance Method Details
#to_a ⇒ Object
15 16 17 18 |
# File 'lib/uninterruptible/tls_server_factory.rb', line 15 def to_a certs = cert_file.scan(/-----BEGIN CERTIFICATE-----.+?-----END CERTIFICATE-----/m) certs.map { |cert| OpenSSL::X509::Certificate.new(cert) } end |