Class: Hiera::Backend::Eyaml::Encryptor
- Inherits:
-
Object
- Object
- Hiera::Backend::Eyaml::Encryptor
show all
- Defined in:
- lib/hiera/backend/eyaml/encryptor.rb
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.options ⇒ Object
Returns the value of attribute options.
10
11
12
|
# File 'lib/hiera/backend/eyaml/encryptor.rb', line 10
def options
@options
end
|
.tag ⇒ Object
Returns the value of attribute tag.
11
12
13
|
# File 'lib/hiera/backend/eyaml/encryptor.rb', line 11
def tag
@tag
end
|
Class Method Details
.decode(string) ⇒ Object
27
28
29
|
# File 'lib/hiera/backend/eyaml/encryptor.rb', line 27
def self.decode string
Base64.decode64(string)
end
|
.decrypt(*args) ⇒ Object
35
36
37
|
# File 'lib/hiera/backend/eyaml/encryptor.rb', line 35
def self.decrypt *args
raise StandardError, "decrypt() not defined for decryptor plugin: #{self}"
end
|
.encode(binary_string) ⇒ Object
23
24
25
|
# File 'lib/hiera/backend/eyaml/encryptor.rb', line 23
def self.encode binary_string
Base64.encode64(binary_string).strip
end
|
.encrypt(*args) ⇒ Object
31
32
33
|
# File 'lib/hiera/backend/eyaml/encryptor.rb', line 31
def self.encrypt *args
raise StandardError, "encrypt() not defined for encryptor plugin: #{self}"
end
|
.find(encryption_scheme = nil) ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/hiera/backend/eyaml/encryptor.rb', line 14
def self.find encryption_scheme = nil
encryption_scheme = Eyaml.default_encryption_scheme if encryption_scheme.nil?
require "hiera/backend/eyaml/encryptors/#{encryption_scheme.downcase}"
encryptor_module = Module.const_get('Hiera').const_get('Backend').const_get('Eyaml').const_get('Encryptors')
encryptor_class = self.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
|