I have received the three certificates(.CER files) to access the production server. How I am going to add/convert these certificates into PKCS12 file.
how to add/convert certificate file into pkcs12 file
17.1k views Asked by Rohit At
4
There are 4 answers
0
On
the server on which you sign your certification $(hostname -f).pem should have the same java version as the nodes you plan to import cert like the following:
$JAVA_HOME/bin/keytool -importcert -alias $(hostname -f) -file /opt/cloudera/security/pki/$(hostname -f).pem -keystore /opt/cloudera/security/pki/$(hostname -f).jks
if you take lower version on the server to sign your certification but you take new java version on the nodes for TLS/SSL, you will see the warning.
First export your certificates to a keystore and then import the keystore as a pkcs12 file. If you jave java installed you can use keytool command to accomplish both.
1) /jre/bin/keytool -importcert -alias cert1 -keystore keystore.jks -file Cert1.cer
2) /jre/bin/keytool -importkeystore -srckeystore keystore.jks -srcalias cert1 -destkeystore keystore.p12 -deststoretype PKCS12
Similar steps can be done using openssl too.