Class: Acme::Certificate

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/acme/certificate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(certificate, chain) ⇒ Certificate

Returns a new instance of Certificate.



8
9
10
11
# File 'lib/acme/certificate.rb', line 8

def initialize(certificate, chain)
  @x509 = certificate
  @x509_chain = chain
end

Instance Attribute Details

#x509Object (readonly)

Returns the value of attribute x509.



4
5
6
# File 'lib/acme/certificate.rb', line 4

def x509
  @x509
end

#x509_chainObject (readonly)

Returns the value of attribute x509_chain.



4
5
6
# File 'lib/acme/certificate.rb', line 4

def x509_chain
  @x509_chain
end

Instance Method Details

#chain_to_pemObject



13
14
15
# File 'lib/acme/certificate.rb', line 13

def chain_to_pem
  x509_chain.map(&:to_pem).join
end

#fullchain_to_pemObject



17
18
19
# File 'lib/acme/certificate.rb', line 17

def fullchain_to_pem
  [*x509_chain, x509].map(&:to_pem).join
end