Search code examples
tomcatcertificatekeystorekeytoolp7b

Regenerate keystore.jks file from p7b or crt file


I'm in a rather unlucky situation, as the keystore generated when creating a CSR file with the keytool is "lost".

I have received the p7b file and I also have the crt file available, which both are produced from the CSR.

Is it somehow possible to create a keystore from these files with the keytool ?

I tried to create a new keystore, but this doesn't work as I get a "Certificate reply does not contain public key for ...." when importing the p7b certificate file.

Would really much appreciate help on this.


Found a solution, which is to generate a new keystore and csr file, and re-key the certificate with the newly generated csr file.


Solution

  • Found a solution, which is to generate a new keystore and csr file using the keytool. Afterwards the already purchased certificate is re-keyed at the certificate provider using the new generated CSR. Re-keying was an online process, so no problems doing this.