Description Usage Arguments Details Value Note Author(s) Examples
getPassword
retireves a password stored in the keychain
setPassword
adds or modifies a password stored in the keychain
rmPassword
removes a password from the kaychain
1 2 3 | getPassword(service, user = NULL, quiet = FALSE, keychain = NULL)
setPassword(service, user = NULL, password, keychain = NULL)
rmPassword(service, user = NULL, keychain = NULL)
|
service |
Name (arbitrary string) identifying the service |
user |
User name (if |
quiet |
if |
password |
new password (single string) |
keychain |
Keychain to operate on. If |
The above functions access and modify passwords in the current user's keychain. A keychain is a secure storage of information that can be locked and ulocked by the user. The functions above manipulate passwords associated with (service, user) pairs.
The actual storage and method of determining user authorization is system-dependent. The current implementation uses the Security framework to work with users' keychain.
getPassword
: the currently stored password (decrypted) or
NULL
of quiet=TRUE
and no password was found.
setPassword
: previous password or NULL
if the password
was just created.
rmPassword
: previous password
The current implementation uses default system keychain where supported. The system may ask the user for authentication to open the keychain.
The passwords are stored as generic passwords. Note that the actual service name used at the system level is prefixed with an R-specific prefix to prevent abuse by reading other passwords (such as your internet passwords etc.). However, malicious users could modify the package to allow arbitrary access, so be wary of the source from which you install this package.
Please note that once you authorize R to access the keychain, it may be open for subsequent access.
Simon Urbanek
1 2 3 4 5 | pwd <- getPassword("foo", quiet=TRUE)
if (is.null(pwd)) cat("foo doesn't exist yet\n")
setPassword("foo",, "bar")
pwd <- getPassword("foo")
rmPassword("foo")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.