| key_get {keyring} | R Documentation |
These functions manipulate keys in a keyring. You can think of a keyring as a secure key-value store.
key_get(service, username = NULL, keyring = NULL) key_get_raw(service, username = NULL, keyring = NULL) key_set(service, username = NULL, keyring = NULL) key_set_with_value(service, username = NULL, password = NULL, keyring = NULL) key_set_with_raw_value(service, username = NULL, password = NULL, keyring = NULL) key_delete(service, username = NULL, keyring = NULL) key_list(service = NULL, keyring = NULL)
service |
Service name, a character scalar. |
username |
Username, a character scalar, or |
keyring |
For systems that support multiple keyrings, specify
the name of the keyring to use here. If |
password |
The secret to store. For |
key_get queries a key from the keyring.
key_get_raw queries a key and returns it as a raw vector.
Most credential stores allow storing a byte sequence with embedded null
bytes, and these cannot be represented as traditional null bytes
terminated strings. If you don't know whether the key contains an
embedded null, it is best to query it with key_get_raw instead of
key_get.
key_set sets a key in the keyring. The contents of the key is read
interactively from the terminal.
key_set_with_value is the non-interactive pair of key_set, to set
a key in the keyring.
key_set_raw_with_value sets a key to a byte sequence from a raw
vector.
key_delete deletes a key.
key_list lists all keys of a keyring, or the keys for a certain
service (if service is not NULL).
key_get returns a character scalar, the password or other
confidential information that was stored in the key.
key_list returns a list of keys, i.e. service names and usernames,
in a data frame.
# These examples use the default keyring, and they are interactive,
# so, we don't run them by default
## Not run:
key_set("R-keyring-test-service", "donaldduck")
key_get("R-keyring-test-service", "donaldduck")
if (has_keyring_support()) key_list(service = "R-keyring-test-service")
key_delete("R-keyring-test-service", "donaldduck")
## This is non-interactive, assuming that that default keyring
## is unlocked
key_set_with_value("R-keyring-test-service", "donaldduck",
password = "secret")
key_get("R-keyring-test-service", "donaldduck")
if (has_keyring_support()) key_list(service = "R-keyring-test-service")
key_delete("R-keyring-test-service", "donaldduck")
## End(Not run)