Method: Conceal::CLI#encrypt
- Defined in:
- lib/conceal/cli.rb
#encrypt(key_file) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/conceal/cli.rb', line 28 def encrypt(key_file) require 'conceal' # load the key raise Thor::Error, 'ERROR: key file is not readable or does not exist' unless File.readable?(key_file) key = IO.read(key_file) # encrypt from stdin plaintext = $stdin.read encrypted_data = Conceal.encrypt(plaintext, key: key) $stdout.write(encrypted_data) $stdout.write("\n") if [:newline] end |