Class: LetsCert::ChainFile

Inherits:
OpenSSLIOPlugin show all
Includes:
FileIOPluginMixin
Defined in:
lib/letscert/io_plugin.rb

Overview

Chain file plugin

Direct Known Subclasses

FullChainFile

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 included from FileIOPluginMixin

#load, #save_to_file

Methods inherited from OpenSSLIOPlugin

#dump_key, #initialize, #load_cert, #load_key

Methods inherited from IOPlugin

empty_data, #initialize, #load, register, registered

Methods included from Loggable

included, #logger

Constructor Details

This class inherits a constructor from LetsCert::OpenSSLIOPlugin

Instance Method Details

#load_from_content(content) ⇒ Hash

Returns:

  • (Hash)


293
294
295
296
297
298
299
# File 'lib/letscert/io_plugin.rb', line 293

def load_from_content(content)
  chain = []
  split_pems(content) do |pem|
    chain << load_cert(pem)
  end
  { chain: chain }
end

#persistedHash

Returns always get true for :chain key.

Returns:

  • (Hash)

    always get true for :chain key



288
289
290
# File 'lib/letscert/io_plugin.rb', line 288

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

#save(data) ⇒ void

This method returns an undefined value.

Save chain.

Parameters:

  • data (Hash)


304
305
306
# File 'lib/letscert/io_plugin.rb', line 304

def save(data)
  save_to_file(data[:chain].map { |c| dump_cert(c) }.join)
end