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, #logger, logger=, register, registered

Constructor Details

This class inherits a constructor from LetsCert::OpenSSLIOPlugin

Instance Method Details

#load_from_content(content) ⇒ Object



272
273
274
275
276
277
278
# File 'lib/letscert/io_plugin.rb', line 272

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

#persistedObject



268
269
270
# File 'lib/letscert/io_plugin.rb', line 268

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

#save(data) ⇒ Object



280
281
282
# File 'lib/letscert/io_plugin.rb', line 280

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