Sha256: 121a3e1a84cb2f6841f81e4b9db578f5bfbbad67a9535451d89cdb770f24837d

Contents?: true

Size: 572 Bytes

Versions: 20

Compression:

Stored size: 572 Bytes

Contents

class Acme::Client::Certificate
  extend Forwardable

  attr_reader :x509, :x509_chain, :request, :private_key, :url

  def_delegators :x509, :to_pem, :to_der

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

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

  def x509_fullchain
    [x509, *x509_chain]
  end

  def fullchain_to_pem
    x509_fullchain.map(&:to_pem).join
  end

  def common_name
    x509.subject.to_a.find { |name, _, _| name == 'CN' }[1]
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
acme-client-1.0.0 lib/acme/client/certificate.rb
acme-client-0.6.3 lib/acme/client/certificate.rb
acme-client-0.6.2 lib/acme/client/certificate.rb
acme-client-0.6.1 lib/acme/client/certificate.rb
acme-client-0.6.0 lib/acme/client/certificate.rb
acme-client-0.5.5 lib/acme/client/certificate.rb
acme-client-0.5.4 lib/acme/client/certificate.rb
acme-client-0.5.3 lib/acme/client/certificate.rb
acme-client-0.5.2 lib/acme/client/certificate.rb
acme-client-0.5.1 lib/acme/client/certificate.rb
acme-client-0.5.0 lib/acme/client/certificate.rb
leap_cli-1.9 vendor/acme-client/lib/acme/client/certificate.rb
acme-client-0.4.1 lib/acme/client/certificate.rb
acme-client-0.4.0 lib/acme/client/certificate.rb
acme-client-0.3.7 lib/acme/client/certificate.rb
acme-client-0.3.6 lib/acme/client/certificate.rb
acme-client-0.3.5 lib/acme/client/certificate.rb
acme-client-0.3.4 lib/acme/client/certificate.rb
acme-client-0.3.3 lib/acme/client/certificate.rb
acme-client-0.3.2 lib/acme/client/certificate.rb