Closed richfitz closed 8 years ago
The password is added on the level of the pem
encoding. To create a password protected key:
library(openssl)
key <- rsa_keygen()
write_pem(key, "mykey.pem", password = "supersecret")
Now if you try to read the key from the pem file you will be asked for the password:
read_key("mykey.pem")
Oh, thanks! I wondered if I was being dense. Could I suggest you add that to the help file ?rsa_keygen
Sure, I accept PR's :)
I'll see what I can do.
Closed https://github.com/jeroenooms/openssl/commit/dc6e2e3baa69d0d3e8727414ea33c35c33757832. Thanks for the suggestion.
Your
openssl::read_key
function accepts a string or callback as an argument to unlock a key with a password, perhapsrsa_keygen
(and other_keygen
functions) could take a similar password argument to generate a password with a phrase?