0

I am trying to create a JKS file from existing private key and certificate and currently following the steps mentioned in this documentation.

I was able to generate PKCS12 file using the private key (which is myrhelserver_cpy_dot_com.key ) and CA signed certificate (which is CertificateBundle1.pem) as shown below:

[tan@myrhelserver cert_related]$ openssl pkcs12 -export -in CertificateBundle1.pem -inkey myrhelserver_cpy_dot_com.key -certfile CertificateBundle1.pem -out activemq_p_keystore.p12
Enter Export Password:
Verifying - Enter Export Password:

I pressed Enter key when it asked me to Enter Export Password and Verifying – Enter Export Password. After this I saw activemq_p_keystore.p12 generated inside the directory as shown in the ls command below.

[tan@myrhelserver cert_related]$ ls
activemq_p_keystore.p12   CertificateBundle1.pem  myrhelserver_cpy_dot_com.key  

After this I ran the keytool command as mentioned in the Step 2 of the documentation - which is asking me to generate the JKS file in the following manner:

keytool -importkeystore -srckeystore testkeystore.p12 -srcstoretype pkcs12 -destkeystore wso2carbon.jks -deststoretype JKS

Here is my actual command :

[tan@myrhelserver cert_related]$ keytool -importkeystore -srckeystore activemq_p_keystore.p12 -srcstoretype pkcs12 -destkeystore wso2carbon.jks -deststoretype JKS
Importing keystore activemq_p_keystore.p12 to wso2carbon.jks...
Enter destination keystore password:
Re-enter new password:
They don't match. Try again
Enter destination keystore password:
Re-enter new password:
Enter source keystore password:
 
*****************  WARNING WARNING WARNING  *****************
* The integrity of the information stored in the srckeystore*
* has NOT been verified!  In order to verify its integrity, *
* you must provide the srckeystore password.                *
*****************  WARNING WARNING WARNING  *****************
 
keytool error: java.lang.NullPointerException: invalid null input

It’s asking for so many passwords as you can see above. So I did the following:

For Enter destination keystore password: and Re-enter new password: I entered nothing and pressed Enter key. It then asked me for Enter destination keystore password: and then Re-enter new password: and Enter source keystore password: “. I was lost after this.

What am I doing wrong here? Should I be creating new password at any of the steps above?

Tan
  • 1,433
  • 5
  • 27
  • 47
  • This seems related: https://stackoverflow.com/questions/20904657/using-a-p12-file-without-a-password-in-java – President James K. Polk Jan 25 '21 at 23:58
  • The above post is for java related questions but I tried to look at the `This Page` link which is not working anymore and other links are not much helpful. – Tan Jan 26 '21 at 23:14

0 Answers0