Class: LetsCert::ChainFile
- Inherits:
-
OpenSSLIOPlugin
- Object
- IOPlugin
- OpenSSLIOPlugin
- LetsCert::ChainFile
- Includes:
- FileIOPluginMixin
- Defined in:
- lib/letscert/io_plugin.rb
Overview
Chain file plugin
Direct Known Subclasses
Constant Summary
Constants inherited from OpenSSLIOPlugin
Constants inherited from IOPlugin
Instance Attribute Summary
Attributes inherited from IOPlugin
Instance Method Summary collapse
- #load_from_content(content) ⇒ Hash
-
#persisted ⇒ Hash
Always get
truefor:chainkey. -
#save(data) ⇒ void
Save chain.
Methods included from FileIOPluginMixin
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
Constructor Details
This class inherits a constructor from LetsCert::OpenSSLIOPlugin
Instance Method Details
#load_from_content(content) ⇒ 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 |
#persisted ⇒ Hash
Returns 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.
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 |