Convert Key file and Cer file to keystore [closed]

My boss has used Openssl to buy a certificate and now I have this files:

  • a key file, (yourdomain.key),
  • a csr file (yourdomain.csr),
  • a cer file (my_domain.cer) (IIS SSL Certificate (PKCS#7) received from comodo.com)

The file .cer has format

—–BEGIN PKCS7—–

…….

—–END PKCS7—–

In order to config my SSL certificate on my tomcat, I want to regenerate a keystore file. I google it but no answer could help me. Can anyone help me to do that ?

Answer

Use the Java keytool to create a keystore and import the certificates needed there

keytool -importcert -file my_domain.cer -keystore mykeystore.jks

Attribution
Source : Link , Question Author : Võ Quang Hòa , Answer Author : DoNuT

Leave a Comment