SSL, Tomcat

Keytool SSL certificate request

How To create Keytool SSL certificate request? We can divide the request in three steps:

  1. The creation of the certificate’s Private Key
  2. The generation of the CSR (This is the information that you must submit to your SSL provider for the creation of the certificate)
  3. The import of the certificate in your keystore via keytool

Below the commands for the described steps:

  1. Keytool -genkey -alias AliasName -keyalg RSA -keysize 2048 -keystore “PathKeystore”
  2. keytool -certreq -alias AliasName -keyalg RSA -file FileName.csr -keystore “PathKeystore” -ext SAN=dns:DNSName.it,Hostname,…
  3. keytool -import -alias AliasName -keystore “PathKeystore” -file FileName.cer

For more information check the Keytool Oracle Documentation