class AcmeManager::Certificate

Represents a certificaate managed by acme-manager

Attributes

name[RW]
not_after[RW]

Public Class Methods

all() click to toggle source

Fetch a list of all certificates that acme-manager is currently managing

@return [Array<Certificate>] All currently managed certificates

# File lib/acme_manager/certificate.rb, line 21
def self.all
  Request.make('list').map do |cert_info|
    AcmeManager.logger.info "Requesting list of certificates"
    new(cert_info['name'], Time.iso8601(cert_info['not_after']))
  end
end
new(name, not_after) click to toggle source

@param [String] name Domain name the certificate relates to @param [Time] not_after Timestamp representing the expiry time of the certificate

# File lib/acme_manager/certificate.rb, line 8
def initialize(name, not_after)
  self.name = name
  self.not_after = not_after
end

Public Instance Methods

expired?() click to toggle source

Certificate is expired when we’re past it’s expiry time

# File lib/acme_manager/certificate.rb, line 14
def expired?
  Time.now.utc > not_after
end