Class: LetsCert::AccountKey

Inherits:
IOPlugin show all
Includes:
FileIOPluginMixin, JWKIOPluginMixin
Defined in:
lib/letscert/io_plugins/account_key.rb

Overview

Account key IO plugin

Author:

  • Sylvain Daubert

Instance Attribute Summary

Attributes inherited from IOPlugin

#name

Instance Method Summary collapse

Methods included from JWKIOPluginMixin

#dump_jwk, #load_jwk, #urlsafe_decode64, #urlsafe_encode64

Methods included from FileIOPluginMixin

#load, #save_to_file

Methods inherited from IOPlugin

empty_data, #initialize, #load, register

Methods included from Loggable

included, #logger

Constructor Details

This class inherits a constructor from LetsCert::IOPlugin

Instance Method Details

#load_from_content(content) ⇒ Hash

Returns:

  • (Hash)


36
37
38
# File 'lib/letscert/io_plugins/account_key.rb', line 36

def load_from_content(content)
  { account_key: load_jwk(content) }
end

#persistedHash

Returns always get true for :account_key key.

Returns:

  • (Hash)

    always get true for :account_key key



31
32
33
# File 'lib/letscert/io_plugins/account_key.rb', line 31

def persisted
  { account_key: true }
end

#save(data) ⇒ void

This method returns an undefined value.

Save account key.

Parameters:

  • data (Hash)


43
44
45
# File 'lib/letscert/io_plugins/account_key.rb', line 43

def save(data)
  save_to_file(dump_jwk(data[:account_key]))
end