Class: PGP::Decryptor
- Inherits:
-
Object
- Object
- PGP::Decryptor
- Includes:
- KeysImporter
- Defined in:
- lib/pgp/decryptor.rb
Instance Attribute Summary collapse
-
#passphrase ⇒ Object
Returns the value of attribute passphrase.
Instance Method Summary collapse
Methods included from KeysImporter
#add_keys, #add_keys_from_file
Instance Attribute Details
#passphrase ⇒ Object
Returns the value of attribute passphrase.
5 6 7 |
# File 'lib/pgp/decryptor.rb', line 5 def passphrase @passphrase end |
Instance Method Details
#decrypt(encrypted_data) ⇒ Object
7 8 9 10 |
# File 'lib/pgp/decryptor.rb', line 7 def decrypt(encrypted_data) result = GPG::Engine.new.decrypt(encrypted_data, self.passphrase) result[1] end |
#decrypt_file(file_path) ⇒ Object
12 13 14 |
# File 'lib/pgp/decryptor.rb', line 12 def decrypt_file(file_path) decrypt File.read(file_path) end |