Class: LetsCert::FullChainFile

Inherits:
ChainFile show all
Defined in:
lib/letscert/io_plugin.rb

Overview

Fullchain file plugin

Author:

  • Sylvain Daubert

Constant Summary

Constants inherited from OpenSSLIOPlugin

OpenSSLIOPlugin::PEM_RE

Constants inherited from IOPlugin

IOPlugin::ALLOWED_PLUGINS

Instance Attribute Summary

Attributes inherited from IOPlugin

#name

Instance Method Summary collapse

Methods inherited from ChainFile

#load_from_content

Methods included from FileIOPluginMixin

#load_from_content, #save_to_file

Methods inherited from OpenSSLIOPlugin

#dump_key, #initialize, #load_cert, #load_key

Methods inherited from IOPlugin

empty_data, #initialize, register, registered

Methods included from Loggable

included, #logger

Constructor Details

This class inherits a constructor from LetsCert::OpenSSLIOPlugin

Instance Method Details

#loadHash

Load full certificate chain

Returns:

  • (Hash)


323
324
325
326
327
328
329
330
331
332
# File 'lib/letscert/io_plugin.rb', line 323

def load
  data = super
  if data[:chain].nil? or data[:chain].empty?
    cert, chain = nil, nil
  else
    cert, chain = data[:chain]
  end

  { account_key: data[:account_key], key: data[:key], cert: cert, chain: chain }
end

#persistedHash

Returns always get true for :cert and :chain keys.

Returns:

  • (Hash)

    always get true for :cert and :chain keys



317
318
319
# File 'lib/letscert/io_plugin.rb', line 317

def persisted
  @persisted ||= { cert: true, chain: true }
end

#save(data) ⇒ void

This method returns an undefined value.

Save fullchain.

Parameters:

  • data (Hash)


337
338
339
340
# File 'lib/letscert/io_plugin.rb', line 337

def save(data)
  super(account_key: data[:account_key], key: data[:key], cert: nil,
        chain: [data[:cert]] + data[:chain])
end