Class: LetsCert::FullChainFile
- Inherits:
-
ChainFile
- Object
- IOPlugin
- OpenSSLIOPlugin
- ChainFile
- LetsCert::FullChainFile
- Defined in:
- lib/letscert/io_plugins/full_chain_file.rb
Overview
Fullchain file plugin
Constant Summary
Constants inherited from OpenSSLIOPlugin
Instance Attribute Summary
Attributes inherited from IOPlugin
Instance Method Summary collapse
-
#load ⇒ Hash
Load full certificate chain.
-
#persisted ⇒ Hash
Always get
true
for:cert
and:chain
keys. -
#save(data) ⇒ void
Save fullchain.
Methods inherited from ChainFile
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
Constructor Details
This class inherits a constructor from LetsCert::OpenSSLIOPlugin
Instance Method Details
#load ⇒ Hash
Load full certificate chain
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 |
#persisted ⇒ Hash
Returns 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.
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 |