Learn R Programming

encryptr (version 0.1.4)

decrypt_file: Decrypt a file

Description

See encrypt_file for details.

Usage

decrypt_file(.path, file_name = NULL, private_key_path = "id_rsa")

Value

The decrypted file is saved with optional file name.

Arguments

.path

Quoted path to file to encrypt.

file_name

Optional new name for unencrypted file.

private_key_path

Quoted path to private key, created with genkeys.

Examples

Run this code

#' # For CRAN and testing:
if (FALSE) {
# Run only once in decrypt_file example
temp_dir = tempdir() # temp directory for testing only
genkeys(file.path(temp_dir, "id_rsa"))
write.csv(gp, file.path(temp_dir, "gp.csv"))
encrypt_file(file.path(temp_dir, "gp.csv"), public_key_path = file.path(temp_dir, "id_rsa.pub"))
}

if (FALSE) {
# For CRAN and testing:
temp_dir = tempdir() # temp directory for testing only
genkeys(file.path(temp_dir, "id_rsa4"))
write.csv(gp, file.path(temp_dir, "gp.csv"))
encrypt_file(file.path(temp_dir, "gp.csv"), public_key_path = file.path(temp_dir, "id_rsa4.pub"))
decrypt_file(file.path(temp_dir, "gp.csv.encryptr.bin"),
  private_key_path = file.path(temp_dir, "id_rsa4"),
  file_name = "file.path(temp_dir, gp2.csv)")
  }

Run the code above in your browser using DataLab