generating a Certificate Signing Request (CSR)

Generate a Private Key and a CSR

create a 2048-bit private key (domain.key) and a CSR (domain.csr)
openssl req -newkey rsa:2048 -nodes -keyout domain.key -out domain.csr

  • newkey rsa:2048 option specifies that the key should be 2048-bit, generated using the RSA algorithm
  • nodes option specifies that the private key should not be encrypted with a pass phrase
  • new option, which is not included here but implied, indicates that a CSR is being generated

Generate a CSR from an Existing Private Key

create a new CSR (domain.csr) based on an existing private key (domain.key)
openssl req -key domain.key -new -out domain.csr

Generate a CSR from an Existing Certificate and Private Key

create a new CSR (domain.csr) based on an existing certificate (domain.crt) and private key (domain.key)
openssl x509 -in domain.crt -signkey domain.key -x509toreq -out domain.csr