Class: Acme::Client::Certificate
- Inherits:
-
Object
- Object
- Acme::Client::Certificate
- Extended by:
- Forwardable
- Defined in:
- lib/acme/client/certificate.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#x509 ⇒ Object
readonly
Returns the value of attribute x509.
-
#x509_chain ⇒ Object
readonly
Returns the value of attribute x509_chain.
Instance Method Summary collapse
- #chain_to_pem ⇒ Object
- #common_name ⇒ Object
- #fullchain_to_pem ⇒ Object
-
#initialize(certificate, chain, request) ⇒ Certificate
constructor
A new instance of Certificate.
- #x509_fullchain ⇒ Object
Constructor Details
#initialize(certificate, chain, request) ⇒ Certificate
Returns a new instance of Certificate.
8 9 10 11 12 |
# File 'lib/acme/client/certificate.rb', line 8 def initialize(certificate, chain, request) @x509 = certificate @x509_chain = chain @request = request end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
4 5 6 |
# File 'lib/acme/client/certificate.rb', line 4 def request @request end |
#x509 ⇒ Object (readonly)
Returns the value of attribute x509.
4 5 6 |
# File 'lib/acme/client/certificate.rb', line 4 def x509 @x509 end |
#x509_chain ⇒ Object (readonly)
Returns the value of attribute x509_chain.
4 5 6 |
# File 'lib/acme/client/certificate.rb', line 4 def x509_chain @x509_chain end |
Instance Method Details
#chain_to_pem ⇒ Object
14 15 16 |
# File 'lib/acme/client/certificate.rb', line 14 def chain_to_pem x509_chain.map(&:to_pem).join end |
#common_name ⇒ Object
26 27 28 |
# File 'lib/acme/client/certificate.rb', line 26 def common_name x509.subject.to_a.find {|name, _, _| name == "CN" }[1] end |
#fullchain_to_pem ⇒ Object
22 23 24 |
# File 'lib/acme/client/certificate.rb', line 22 def fullchain_to_pem x509_fullchain.map(&:to_pem).join end |
#x509_fullchain ⇒ Object
18 19 20 |
# File 'lib/acme/client/certificate.rb', line 18 def x509_fullchain [x509, *x509_chain] end |