Skip to content

Commit

Permalink
Improve file encryption/decryption docs (#537)
Browse files Browse the repository at this point in the history
Fixes #510
  • Loading branch information
hadley authored Sep 4, 2024
1 parent 06e9133 commit d1b29d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion R/secret.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
#' @name secrets
#' @returns
#' * `secret_decrypt()` and `secret_encrypt()` return strings.
#' * `secret_decrypt_file()` returns a path to a temporary file;
#' `secret_encrypt_file()` encrypts the file in place.
#' * `secret_write_rds()` returns `x` invisibly; `secret_read_rds()`
#' returns the saved object.
#' * `secret_make_key()` returns a string with class `AsIs`.
Expand Down Expand Up @@ -112,7 +114,9 @@ secret_write_rds <- function(x, path, key) {
}
#' @export
#' @rdname secrets
#' @param path Path to `.rds` file
#' @param path Path to file to encrypted file to read or write. For
#' `secret_write_rds()` and `secret_read_rds()` this should be an `.rds`
#' file.
secret_read_rds <- function(path, key) {
enc <- readBin(path, "raw", file.size(path))
dec_cmp <- secret_decrypt_raw(enc, key)
Expand Down
6 changes: 5 additions & 1 deletion man/secrets.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d1b29d2

Please sign in to comment.