What is the difference between these openssl commands:

  • "openssl genrsa"
  • "openssl genpkey"
  • "openssl req -newkey rsa:bits [everything else]"

Which one should I be using when preparing a new CSR?


The key generation code is the same in all three cases anyway. This is just a matter of command-line interface.

For most usages, I recommend generating the private key with req because then that's only one command line to generate the key and the certificate request. All other things being equal, less complexity makes for more security.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.