lib/rapid-vaults/bindings/puppet_gpg_encrypt.rb
def gpg_encrypt(file, gpghome, password_file)
    begin
      require 'rapid-vaults'
    rescue LoadError
      raise 'Rapid Vaults is required to be installed on the puppet master to use this custom function!'
    end

    ENV['GNUPGHOME'] = gpghome

    RapidVaults::API.main(action: :encrypt, algorithm: :gpgme, file: file, pw: password_file)
  end
# Encrypts a file with GnuPG.
# @param [String] file The file to encrypt.
# @param [String] gpghome The path to the GnuPG home directory containing the credentials.
# @param [String] password_file The password file to use for encryption.
# @return [String] Returns a string of encrypted contents.
# @example Encrypting a file.
# gpg_encrypt('/path/to/data.txt', '/home/alice/.gnupg', '/path/to/password.txt') => 'asdnlfi378rth43rt78h4t8b3v844b'
Encrypts a file with GnuPG.
Encrypts a file with GnuPG .
def gpg_encrypt(file, gpghome, password_file)
    begin
      require 'rapid-vaults'
    rescue LoadError
      raise 'Rapid Vaults is required to be installed on the puppet master to use this custom function!'
    end
    ENV['GNUPGHOME'] = gpghome
    RapidVaults::API.main(action: :encrypt, algorithm: :gpgme, file: file, pw: password_file)
  end
def gpg_encrypt ( file , gpghome , password_file ) begin require 'rapid-vaults' rescue LoadError raise 'Rapid Vaults is required to be installed on the puppet master to use this custom function!' end ENV [ 'GNUPGHOME' ] = gpghome RapidVaults :: API . main ( action : :encrypt , algorithm : :gpgme , file : file , pw : password_file ) end
Encrypts a file with GnuPG.
Encrypts a file with GnuPG .
Returns a string of encrypted contents.
Returns a string of encrypted contents .
String
file
gpghome
password_file
password_file The password file to use for encryption.
password_file The password file to use for encryption .
example
Encrypting a file.
Encrypting a file .