class Hiera::Backend::Eyaml::Encryptor

Attributes

options[RW]
tag[RW]

Public Class Methods

decode(string) click to toggle source
# File lib/hiera/backend/eyaml/encryptor.rb, line 28
def self.decode string
  Base64.decode64(string)
end
decrypt(*args) click to toggle source
# File lib/hiera/backend/eyaml/encryptor.rb, line 36
def self.decrypt *args
  raise StandardError, "decrypt() not defined for decryptor plugin: #{self}"
end
encode(binary_string) click to toggle source
# File lib/hiera/backend/eyaml/encryptor.rb, line 24
def self.encode binary_string
  Base64.encode64(binary_string).strip  
end
encrypt(*args) click to toggle source
# File lib/hiera/backend/eyaml/encryptor.rb, line 32
def self.encrypt *args 
  raise StandardError, "encrypt() not defined for encryptor plugin: #{self}"
end
find(encryption_scheme = nil) click to toggle source
# File lib/hiera/backend/eyaml/encryptor.rb, line 15
def self.find encryption_scheme = nil
  encryption_scheme = Eyaml.default_encryption_scheme if encryption_scheme.nil?
  require "hiera/backend/eyaml/encryptors/#{File.basename encryption_scheme.downcase}"          
  encryptor_module = Module.const_get('Hiera').const_get('Backend').const_get('Eyaml').const_get('Encryptors')
  encryptor_class = Utils.find_closest_class :parent_class => encryptor_module, :class_name => encryption_scheme
  raise StandardError, "Could not find hiera-eyaml encryptor: #{encryption_scheme}. Try gem install hiera-eyaml-#{encryption_scheme.downcase} ?" if encryptor_class.nil?
  encryptor_class
end

Protected Class Methods

debug(msg) click to toggle source
# File lib/hiera/backend/eyaml/encryptor.rb, line 66
def self.debug msg
  Utils::debug :from => plugin_classname, :msg => msg
end
format_message(msg) click to toggle source
# File lib/hiera/backend/eyaml/encryptor.rb, line 58
def self.format_message msg
  "[eyaml_#{plugin_classname}]:  #{msg}"
end
hiera?() click to toggle source
# File lib/hiera/backend/eyaml/encryptor.rb, line 54
def self.hiera?
  Utils::hiera?
end
info(msg) click to toggle source
# File lib/hiera/backend/eyaml/encryptor.rb, line 70
def self.info msg
  Utils::info :from => plugin_classname, :msg => msg
end
option(name) click to toggle source
# File lib/hiera/backend/eyaml/encryptor.rb, line 50
def self.option name
  Eyaml::Options[ "#{plugin_classname}_#{name}" ] || self.options[ "#{plugin_classname}_#{name}" ]
end
plugin_classname() click to toggle source
# File lib/hiera/backend/eyaml/encryptor.rb, line 42
def self.plugin_classname
  self.to_s.split("::").last.downcase
end
register() click to toggle source
# File lib/hiera/backend/eyaml/encryptor.rb, line 46
def self.register
  Hiera::Backend::Eyaml::Plugins.register_options :options => self.options, :plugin => plugin_classname
end
trace(msg) click to toggle source
# File lib/hiera/backend/eyaml/encryptor.rb, line 62
def self.trace msg
  Utils::trace :from => plugin_classname, :msg => msg
end
warn(msg) click to toggle source
# File lib/hiera/backend/eyaml/encryptor.rb, line 74
def self.warn msg
  Utils::warn :from => plugin_classname, :msg => msg
end