Class: EncryptedYaml::CLI::Encrypt

Inherits:
Object
  • Object
show all
Defined in:
lib/encrypted_yaml/cli/encrypt.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Encrypt

Returns a new instance of Encrypt.



6
7
8
9
10
# File 'lib/encrypted_yaml/cli/encrypt.rb', line 6

def initialize(options)
  @keyfile = options[:keyfile]
  @ivfile = options[:ivfile]
  @filename = options[:filename]
end

Instance Method Details

#encryptObject



12
13
14
15
16
17
# File 'lib/encrypted_yaml/cli/encrypt.rb', line 12

def encrypt
  data = File.read(@filename)

  cipher = get_cipher
  cipher.update(data) + cipher.final
end