Create ssh keypairsSource:
Create openssl key pairs in the manner of
In general this should not be used (generate keys yourself with
ssh-keygen at the command line. However this is useful for
testing and demonstration so I have included it to make that
easier. Once a keypair has been generated it can be used with
ssh_keygen(path = tempfile(), password = TRUE, use_shell = FALSE)
A directory in which to create a keypair. If the path does not exist it will be created.
The password for the key. The default will prompt interactively (but without echoing the password). Other valid options are
FALSE(no password) or a string.
Try to use
ssh-keygen(the shell utility) rather than functions in the
opensslpackage. This will be necessary on at least very old versions of OS/X (Yosemite and older at least) where the keys generated by the
opensslpackage cannot be read by the system ssh commands (e.g.,
path, invisibly. This is useful in the case
# Generate a new key in a temporary directory: path <- cyphr::ssh_keygen(password = FALSE) dir(path) # will contain id_rsa and id_rsa.pub #>  "id_rsa" "id_rsa.pub" # This key can now be used via keypair_openssl: key <- cyphr::keypair_openssl(path, path) secret <- cyphr::encrypt_string("hello", key) cyphr::decrypt_string(secret, key) #>  "hello" # Cleanup unlink(path, recursive = TRUE)