{"action":"created","issue":{"url":"https://api.github.com/repos/jeroenooms/openssl/issues/16","repository_url":"https://api.github.com/repos/jeroenooms/openssl","labels_url":"https://api.github.com/repos/jeroenooms/openssl/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/jeroenooms/openssl/issues/16/comments","events_url":"https://api.github.com/repos/jeroenooms/openssl/issues/16/events","html_url":"https://github.com/jeroenooms/openssl/issues/16","id":131046379,"number":16,"title":"Can rsa_keygen and friends take a password argument","user":{"login":"richfitz","id":1558093,"avatar_url":"https://avatars.githubusercontent.com/u/1558093?v=3","gravatar_id":"","url":"https://api.github.com/users/richfitz","html_url":"https://github.com/richfitz","followers_url":"https://api.github.com/users/richfitz/followers","following_url":"https://api.github.com/users/richfitz/following{/other_user}","gists_url":"https://api.github.com/users/richfitz/gists{/gist_id}","starred_url":"https://api.github.com/users/richfitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richfitz/subscriptions","organizations_url":"https://api.github.com/users/richfitz/orgs","repos_url":"https://api.github.com/users/richfitz/repos","events_url":"https://api.github.com/users/richfitz/events{/privacy}","received_events_url":"https://api.github.com/users/richfitz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-03T14:45:10Z","updated_at":"2016-02-03T14:48:48Z","closed_at":null,"body":"Your `openssl::read_key` function accepts a string or callback as an argument to unlock a key with a password, perhaps `rsa_keygen` (and other `_keygen` functions) could take a similar password argument to generate a password with a phrase?"},"comment":{"url":"https://api.github.com/repos/jeroenooms/openssl/issues/comments/179273221","html_url":"https://github.com/jeroenooms/openssl/issues/16#issuecomment-179273221","issue_url":"https://api.github.com/repos/jeroenooms/openssl/issues/16","id":179273221,"user":{"login":"jeroenooms","id":216319,"avatar_url":"https://avatars.githubusercontent.com/u/216319?v=3","gravatar_id":"","url":"https://api.github.com/users/jeroenooms","html_url":"https://github.com/jeroenooms","followers_url":"https://api.github.com/users/jeroenooms/followers","following_url":"https://api.github.com/users/jeroenooms/following{/other_user}","gists_url":"https://api.github.com/users/jeroenooms/gists{/gist_id}","starred_url":"https://api.github.com/users/jeroenooms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeroenooms/subscriptions","organizations_url":"https://api.github.com/users/jeroenooms/orgs","repos_url":"https://api.github.com/users/jeroenooms/repos","events_url":"https://api.github.com/users/jeroenooms/events{/privacy}","received_events_url":"https://api.github.com/users/jeroenooms/received_events","type":"User","site_admin":false},"created_at":"2016-02-03T14:48:48Z","updated_at":"2016-02-03T14:48:48Z","body":"The password is added on the level of the `pem` encoding. To create a password protected key:\r\n\r\n```r\r\nlibrary(openssl)\r\nkey <- rsa_keygen()\r\nwrite_pem(key, \"mykey.pem\", password = \"supersecret\")\r\n```\r\n\r\nNow if you try to read the key from the pem file you will be asked for the password:\r\n\r\n```r\r\nread_key(\"mykey.pem\")\r\n```"}}