Class: ActiveRecord::Snapshot::OpenSSL

Inherits:
Object
  • Object
show all
Defined in:
lib/active_record/snapshot/commands/openssl.rb

Class Method Summary collapse

Class Method Details

.decrypt(input:, output:) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/active_record/snapshot/commands/openssl.rb', line 13

def self.decrypt(input:, output:)
  system(<<-SH)
  nice openssl enc -d -aes-256-cbc -md sha256 \\
    -in #{input} \\
    -out #{output} \\
    -kfile #{ActiveRecord::Snapshot.config.ssl_key}
  SH
end

.encrypt(input:, output:) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/active_record/snapshot/commands/openssl.rb', line 4

def self.encrypt(input:, output:)
  system(<<-SH)
  nice openssl aes-256-cbc -md sha256 \\
    -in #{input} \\
    -out #{output} \\
    -kfile #{ActiveRecord::Snapshot.config.ssl_key}
  SH
end