Class: Backup::Encryptor::OpenSSL
- Defined in:
- lib/backup/encryptor/open_ssl.rb
Constant Summary
Constants included from CLI::Helpers
Instance Attribute Summary collapse
-
#base64 ⇒ Object
Determines whether the ‘base64’ should be used or not.
-
#password ⇒ Object
The password that’ll be used to encrypt the backup.
-
#password_file ⇒ Object
The password file to use to encrypt the backup.
-
#salt ⇒ Object
Determines whether the ‘salt’ flag should be used.
Instance Method Summary collapse
-
#encrypt_with {|"#{ utility(:openssl) } #{ options }", '.enc'| ... } ⇒ Object
This is called as part of the procedure run by the Packager.
-
#initialize(&block) ⇒ OpenSSL
constructor
Creates a new instance of Backup::Encryptor::OpenSSL and sets the password attribute to what was provided.
Methods included from Configuration::Helpers
Constructor Details
#initialize(&block) ⇒ OpenSSL
Creates a new instance of Backup::Encryptor::OpenSSL and sets the password attribute to what was provided
27 28 29 30 31 32 33 34 35 |
# File 'lib/backup/encryptor/open_ssl.rb', line 27 def initialize(&block) super @base64 ||= false @salt ||= true @password_file ||= nil instance_eval(&block) if block_given? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Backup::Configuration::Helpers
Instance Attribute Details
#base64 ⇒ Object
Determines whether the ‘base64’ should be used or not
18 19 20 |
# File 'lib/backup/encryptor/open_ssl.rb', line 18 def base64 @base64 end |
#password ⇒ Object
The password that’ll be used to encrypt the backup. This password will be required to decrypt the backup later on.
10 11 12 |
# File 'lib/backup/encryptor/open_ssl.rb', line 10 def password @password end |
#password_file ⇒ Object
The password file to use to encrypt the backup.
14 15 16 |
# File 'lib/backup/encryptor/open_ssl.rb', line 14 def password_file @password_file end |
#salt ⇒ Object
Determines whether the ‘salt’ flag should be used
22 23 24 |
# File 'lib/backup/encryptor/open_ssl.rb', line 22 def salt @salt end |
Instance Method Details
#encrypt_with {|"#{ utility(:openssl) } #{ options }", '.enc'| ... } ⇒ Object
This is called as part of the procedure run by the Packager. It sets up the needed options to pass to the openssl command, then yields the command to use as part of the packaging procedure. Once the packaging procedure is complete, it will return so that any clean-up may be performed after the yield.
43 44 45 46 |
# File 'lib/backup/encryptor/open_ssl.rb', line 43 def encrypt_with log! yield "#{ utility(:openssl) } #{ }", '.enc' end |