Class: LetsCert::FullChainFile

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

Overview

Fullchain file plugin

Author:

  • Sylvain Daubert

Constant Summary

Constants inherited from OpenSSLIOPlugin

OpenSSLIOPlugin::PEM_RE

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

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)


35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/letscert/io_plugins/full_chain_file.rb', line 35

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

  { 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



29
30
31
# File 'lib/letscert/io_plugins/full_chain_file.rb', line 29

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

#save(data) ⇒ void

This method returns an undefined value.

Save fullchain.

Parameters:

  • data (Hash)


51
52
53
# File 'lib/letscert/io_plugins/full_chain_file.rb', line 51

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