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("  nice openssl enc -d -aes-256-cbc -md sha256 \\\\\n    -in \#{input} \\\\\n    -out \#{output} \\\\\n    -kfile \#{ActiveRecord::Snapshot.config.ssl_key}\n  SH\nend\n")

.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("  nice openssl aes-256-cbc -md sha256 \\\\\n    -in \#{input} \\\\\n    -out \#{output} \\\\\n    -kfile \#{ActiveRecord::Snapshot.config.ssl_key}\n  SH\nend\n")