Top Level Namespace
Defined Under Namespace
Modules: Rapidvaults Classes: Binding, Decrypt, Encrypt, Generate, RapidVaults
Instance Method Summary collapse
-
#gpg_decrypt ⇒ Object
returns decrypted_contents.
-
#gpg_encrypt ⇒ Object
returns encrypted_contents.
-
#gpg_generate ⇒ Object
returns exit code on status of gnupg setup.
-
#ssl_decrypt ⇒ Object
returns decrypted_contents.
-
#ssl_encrypt ⇒ Object
returns encrypted_contents, tag.
-
#ssl_generate ⇒ Object
returns key, nonce.
Instance Method Details
#gpg_decrypt ⇒ Object
returns decrypted_contents
60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/rapid-vaults/bindings/chef.rb', line 60 def gpg_decrypt ENV['GNUPGHOME'] = '/home/chris/.gnupg' = { action: :decrypt, algorithm: :gpgme, file: '/path/to/encrypted_data.txt', pw: File.read('/path/to/password.txt') } RapidVaults::API.main() end |
#gpg_encrypt ⇒ Object
returns encrypted_contents
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/rapid-vaults/bindings/chef.rb', line 47 def gpg_encrypt ENV['GNUPGHOME'] = '/home/bob/.gnupg' = { action: :encrypt, algorithm: :gpgme, file: '/path/to/data.txt', pw: File.read('/path/to/password.txt') } RapidVaults::API.main() end |
#gpg_generate ⇒ Object
returns exit code on status of gnupg setup
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/rapid-vaults/bindings/chef.rb', line 35 def gpg_generate ENV['GNUPGHOME'] = '/home/alice/.gnupg' = { action: :generate, algorithm: :gpgme, gpgparams: File.read('gpgparams.txt') } RapidVaults::API.main() end |
#ssl_decrypt ⇒ Object
returns decrypted_contents
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/rapid-vaults/bindings/chef.rb', line 22 def ssl_decrypt = { action: :decrypt, file: '/path/to/encrypted_data.txt', key: '/path/to/key.txt', nonce: '/path/to/nonce.txt', tag: '/path/to/tag.txt', pw: File.read('/path/to/password.txt') # optional } RapidVaults::API.main() end |
#ssl_encrypt ⇒ Object
returns encrypted_contents, tag
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rapid-vaults/bindings/chef.rb', line 10 def ssl_encrypt = { action: :encrypt, file: '/path/to/data.txt', key: '/path/to/key.txt', nonce: '/path/to/nonce.txt', pw: File.read('/path/to/password.txt') # optional } RapidVaults::API.main() end |
#ssl_generate ⇒ Object
returns key, nonce
4 5 6 7 |
# File 'lib/rapid-vaults/bindings/chef.rb', line 4 def ssl_generate = { action: :generate } RapidVaults::API.main() end |