Description Usage Arguments Details Value Examples
ONE-LINER WHAT DO THESE GROUP OF FUNCS DO? (or the name of the main function)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | show_default_rcreds_key_file()
create_key(bytes = 32, depth = 8, seed = NULL, showWarnings = TRUE,
verbose = getOption("verbose.rcreds", default = TRUE))
is.key_rcreds(key)
save_key(file_full_path = file.path(folder, file_name),
file_name = getOption("rcreds.key.file_name", default = ".crypt_key.rds"),
folder = get_default_rcreds_key_folder(), key, bytes = 32, depth = 8,
seed = NULL, zArchive_existing = TRUE, overwrite_existing = FALSE,
showWarnings = TRUE, allow_root_user = FALSE,
verbose = getOption("verbose.rcreds", default = TRUE))
read_key_from_file(file_full_path = file.path(folder, file_name),
file_name = getOption("rcreds.key.file_name", default = ".crypt_key.rds"),
folder = get_default_rcreds_key_folder(), create_if_not_exist = TRUE,
showWarnings = FALSE, verbose = getOption("verbose.rcreds", default =
TRUE))
|
bytes |
Number of bytes used for the key.
Values should normally be one of Defaults to: 32 |
depth |
Bit depth for key. Defaults to: 8 |
seed |
An integer passed to Defaults to: NULL |
showWarnings |
A TRUE/FALSE flag. If FALSE, warnings will be silenced Defaults to: TRUE |
verbose |
A TRUE/FALSE flag. Defaults to: getOption(\"verbose.rcreds\", default = TRUE) |
key |
A key object of class Alternatively, a full file path to a key stored on disk can be given which will be read to disk. |
file_full_path |
The full path to the creds (or key) file, where it should be read from or written to.
if NOTE: When Defaults to: file.path(folder, file_name) |
file_name |
name of the file where the key will be written to or read from. Should be a string of length 1 Defaults to: getOption(\"rcreds.key.file_name\", default = \".crypt_key.rds\") |
folder |
folder where the credentials will be written to or read from. Defaults to: get_default_rcreds_key_folder() |
zArchive_existing |
A TRUE/FALSE flag. If Defaults to: TRUE |
overwrite_existing |
A TRUE/FALSE flag. If Defaults to: FALSE |
allow_root_user |
A TRUE/FALSE flag. If FALSE and user is root, then writing and saving functions will fail This is a safety to make sure the user understands they are operating under root. Defaults to: FALSE |
create_if_not_exist |
A TRUE/FALSE flag. for Defaults to: TRUE |
DETAILED DESCRIPTION of what these functions do
for create_key
and read_key_from_file
: An object of class key_rcreds
for save_key
and show_default_rcreds_key_file
: A full file path. In the case of save_key
, this is where the key has been written to.
for is.key_rcreds
: A TRUE/FALSE value indidcating if the input is of class "key_rcreds"
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
### ---------------------------------------------- ###
## Default Folders need to be set. This shold be in an .Rprofile file
### ---------------------------------------------- ###
## generally use: set_default_rcreds_ALL(parent_folder = "~/.rcreds/")
set_default_rcreds_ALL(parent_folder = file.path(tempdir(), ".rcreds/"),
create_if_not_exist = TRUE)
### ---------------------------------------------- ###
library(rcreds)
key <- create_key()
file_creds <- write_credentials_to_file(username="cosmo", password="too many secrets", key=key)
file_key <- save_key(folder="different/key/location")
### IN ANOTHER FILE
key <- read_key_from_file(folder="different/key/location")
creds <- read_credentials_from_file(key=key, fail_if_cant_decrypt=FALSE, showWarnings=FALSE)
## normally, leave the above flags as their default TRUE. Using FALSE for this example only.
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.