my_key: Default key

Description Usage Details Examples

View source: R/mykey.R

Description

The default user key can be set in the USER_KEY variable and otherwise is ~/.ssh/id_rsa. Note that on Windows we treat '~' as the windows user home (and not the documents folder).

Usage

1
2
3

Details

The my_pubkey() function looks for the public key by appending .pub to the above key path. If this file does not exist, it reads the private key file and automatically derives the corresponding pubkey. In the latter case the user may be prompted for a passphrase if the private key is protected.

Examples

1
2
3
4
5
6
7
8
9
# Set random RSA key as default
key <- rsa_keygen()
write_pem(key, tmp <- tempfile(), password = "")
rm(key)
Sys.setenv("USER_KEY" = tmp)

# Check the new keys
print(my_key())
print(my_pubkey())

openssl documentation built on July 18, 2019, 9:08 a.m.