Source apiKey list PGP encrypted R script

nsoApiGPG(file = system.file("apiKey.R.gpg", package = "nsoApi"),
  gpg = file.path("D:", "GPG", "gpg2.exe"), passphrase = NULL,
  shell = file.path("C:", "Windows", "System32", "cmd.exe"), keep = FALSE)

Arguments

file

path to gpg key file

gpg

path to GnuPG executable

passphrase

character password used for decryption. suggested to store as environment variable and use with Sys.getenv()

shell

if on Windows, you may need to specify the path to cmd.exe

keep

boolean set to TRUE if you want to keep the decoded file

Value

Creates decrypted file in the package installation folder. The key file is gpg encryped. In Windows, use GPG Plugin Portable: http://portableapps.com/apps/security/gpg-plugin-portable

Details

Source apiKey list PGP encrypted R script with keys for various webservices of National Statics Offices.

Examples

# NOT RUN {
nsoApiGPG(keep = TRUE)
file.apiKey <- system.file("apiKey.R", package = "nsoApi")

if (file.exists(file.apiKey)) {
  filecon <- file(file.apiKey)
  cat(paste0(readLines(con = filecon), '\n'))
  close(filecon)
}
# }