0

I got a certificate.pem file from the CA, that have structure like below:

-----BEGIN CERTIFICATE-----
encrypted text of the public key
-----END CERTIFICATE-----

From this, we need to generate the keystore file that could be read by the Jetty server.

2 Answers 2

1
  1. Use any of the Cygwin, Linux, Solaris machine, OpenSSL:
pkcs12 -export -inkey ls09953_server.key -in certiface.pem -out certiface.pkcs12
  • ls09953_server.key -> is the private key file that was used to generate the csr and send to CA.
  • certiface.pem -> is the .pem file send by your CA.
  1. From the command prompt where your Java is located, such as c:/program files/java/jdk1.6.x.x/bin/ (run as administrator) generate a keystore and provide a password. Other details can be left; just press enter.
keytool -genkey -keyalg RSA -alias endeca -keystore certiface.ks
  1. Now delete extra info from the keystore:
keytool -delete -alias endeca -keystore certiface.ks
  1. You have .pks12 file (from step 1) and the blank keystore (from step 3). Now, import the pkcs12 file into this keystore:
keytool -importkeystore -srckeystore certiface.pkcs12 -srcstoretype PKCS12 -destkeystore certiface.ks
  1. Place this in your certificate directory and use it like a regular one.
0
-1

The Tomcat doc has a pretty good tutorial on this topic: https://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration

basicly: read the chapter "Prepare the Certificate Keystore" and "Importing the Certificate"

3
  • You should quote and cite the relevant information from your reference link. Your answer alone, should be able to answer the question, it currently does not.
    – Ramhound
    Feb 2, 2017 at 16:14
  • basicly, the whole link is a how-to-tutorial, so you just need... well, everything from the link - so I didn't see the point of quoting
    – etraff
    Nov 2, 2017 at 13:07
  • Let me clear, I don't need to read the link, I already know how to do it. However, everyone else might need assistance, so my comment is for those people. You now know how to fix your answer.
    – Ramhound
    Nov 2, 2017 at 13:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .