Knowledgebase: SSL Technical FAQs
How do I import an openssl based generated private key and certificate into java keystore?

To import an openssl based generated private key and certificate into java keystore, follow the instructions below.

First you will have to create a new text file, which contains the cert from 'yourdomain.crt' and the private key from 'yourdomain.key'.
It must be like this:

BEGIN CERTIFICATE
lines of text between the Begin and End
END CERTIFICATE
BEGIN RSA PRIVATE KEY
lines of text between the Begin and End
END RSA PRIVATE KEY

NOTE: Do not include the extra text which is inserted by openssl

Save the text file as 'cert_with_key.pem'

Using the Java Keytool command:
keytool -import -file cert_with_key.pem -alias sitecertkey

You will also need to import the other certificates that came with your site certificate for the certificates to chain to a trusted root.
These will be attached to the email you received, or can be downloaded from:
https://ssl.comodo.com/support

Then follow the import instructions for the intermediate/roots at:
https://ssl.comodo.com/support

(1922 vote(s))
Helpful
Not helpful
Comments (0)