Difference: ImportingCertificateToJavaKeystore (1 vs. 2)

Revision 215 Jul 2017 - IvoVanGeel

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Importing a certificate into a Java keystore

Line: 28 to 28
 keytool -import -trustcacerts -alias -file <cacert.pem> -keystore
Changed:
<
<
-- IvoVanGeel - 13 Jun 2013
>
>
-- Ivo van Geel - 13 Jun 2013
 \ No newline at end of file

Revision 113 Jun 2013 - IvoVanGeel

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="WebHome"

Importing a certificate into a Java keystore

This document describes the steps needed to import / convert a certificate into a Java Keystore. The Keystore can be used with Tomcat, or other Java applications.

Converting the certificate to PKCS12 format

Execute the following command to convert a x509 encoded certificate and private key to a PKCS12 encoded certificate:

openssl pkcs12 -export -in <certificate.crt> -inkey <certificate.key> -out <certificate.p12> -name <cert-name> -CAfile <cacert.pem> -caname <ca-name> -chain

Please write down the passphrase you used to encode the PKCS12 encoded certificate, you will need it in later steps.

Importing the PKCS12 certificate into a keystore

Convert the PKCS12 encoded certificate into a Java keystore, by executing:

keytool -importkeystore -srckeystore <certificate.p12> -srcstoretype PKCS12 -srcstorepass '<PKCS12 passphrase>' -alias tomcat -deststorepass '<keystore password> -destkeypass '<keystore password>' -destkeystore <keystore filename>

Adding the root CA into the keystore

keytool -import -trustcacerts -alias <CA> -file <cacert.pem> -keystore <keystore filename>

-- IvoVanGeel - 13 Jun 2013

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2010-2019 by LANIS