Module: MuchKeys::CLI::MuchKeysExecutor

Extended by:
MuchKeysExecutor
Included in:
MuchKeysExecutor
Defined in:
lib/muchkeys/cli.rb

Instance Method Summary collapse

Instance Method Details

#decrypt(consul_key, public_key, private_key) ⇒ Object



42
43
44
# File 'lib/muchkeys/cli.rb', line 42

def decrypt(consul_key, public_key, private_key)
  MuchKeys.fetch_key(consul_key, public_key: public_key, private_key:private_key)
end

#encrypt(file, public_key) ⇒ Object



37
38
39
40
# File 'lib/muchkeys/cli.rb', line 37

def encrypt(file, public_key)
  string_to_encrypt = File.read(file)
  MuchKeys::Secret.encrypt_string(string_to_encrypt, public_key)
end

#fetch(consul_key) ⇒ Object



46
47
48
# File 'lib/muchkeys/cli.rb', line 46

def fetch(consul_key)
  MuchKeys.fetch_key(consul_key)
end