rsa_keygen() generates a pair of RSA (Rivest-Shamir-Adleman) private and
public keys for your project.
Arguments
- dir
- (optional) a string specifying the directory to save the generated keys (default: - "./inst/ssh")
- password
- (optional) a string specifying the password to protect the private key. If - NULL, the private key will not be protected (default:- NULL).
- bits
- (optional) an integer number specifying the length of the RSA key in bits (default: - 2048).
Examples
temp_dir = tempfile("dir")
dir.create(temp_dir)
rsa_keygen(dir = temp_dir, password = "test", bits = 2048)
#> Keys successfully created at '/tmp/RtmpoFK8iT/dir1d2e6b351f57'.
list.files(temp_dir)
#> [1] "id_rsa"     "id_rsa.pub"