Class: Bolt::Secret

Inherits:
Object
  • Object
show all
Defined in:
lib/bolt/secret.rb,
lib/bolt/secret/base.rb

Defined Under Namespace

Classes: Base

Class Method Summary collapse

Class Method Details

.execute(plugins, outputter, options) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/bolt/secret.rb', line 5

def self.execute(plugins, outputter, options)
  enc = plugins.by_name('pkcs7')
  case options[:action]
  when 'createkeys'
    enc.secret_createkeys
  when 'encrypt'
    outputter.print_message(enc.secret_encrypt('plaintext-value' => options[:object]))
  when 'decrypt'
    outputter.print_message(enc.secret_decrypt('encrypted-value' => options[:object]))
  end

  0
end