Top Level Namespace

Defined Under Namespace

Modules: Rapidvaults Classes: Binding, Decrypt, Encrypt, Generate, RapidVaults

Instance Method Summary collapse

Instance Method Details

#gpg_decryptObject

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'

  options = {
    action: :decrypt,
    algorithm: :gpgme,
    file: '/path/to/encrypted_data.txt',
    pw: File.read('/path/to/password.txt')
  }
  RapidVaults::API.main(options)
end

#gpg_encryptObject

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'

  options = {
    action: :encrypt,
    algorithm: :gpgme,
    file: '/path/to/data.txt',
    pw: File.read('/path/to/password.txt')
  }
  RapidVaults::API.main(options)
end

#gpg_generateObject

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'

  options = {
    action: :generate,
    algorithm: :gpgme,
    gpgparams: File.read('gpgparams.txt')
  }
  RapidVaults::API.main(options)
end

#ssl_decryptObject

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
  options = {
    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(options)
end

#ssl_encryptObject

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
  options = {
    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(options)
end

#ssl_generateObject

returns key, nonce



4
5
6
7
# File 'lib/rapid-vaults/bindings/chef.rb', line 4

def ssl_generate
  options = { action: :generate }
  RapidVaults::API.main(options)
end