Class: LetsCert::CertFile

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

Overview

Cert file plugin

Author:

  • Sylvain Daubert

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)


357
358
359
# File 'lib/letscert/io_plugin.rb', line 357

def load_from_content(content)
  { cert: load_cert(content) }
end

#persistedHash

Returns always get true for :cert key.

Returns:

  • (Hash)

    always get true for :cert key



352
353
354
# File 'lib/letscert/io_plugin.rb', line 352

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

#save(data) ⇒ void

This method returns an undefined value.

Save certificate.

Parameters:

  • data (Hash)


364
365
366
# File 'lib/letscert/io_plugin.rb', line 364

def save(data)
  save_to_file(dump_cert(data[:cert]))
end