0

I am using the following steps to generate Keystore and then corresponding CSR, then have sent the CSR to godaddy for signing and received respective certificate files. But when I try to import the received .crt file to the keystore i get

"keytool error: java.lang.Exception: Certificate reply does not contain public key for ".

Following are the list of steps that i followed in the process.

1.keytool -genkey -alias server -keyalg RSA -keysize 2048 -keystore your_site_name.jks (and then added the reqquired information)

2.keytool -certreq -alias server -file csr.txt -keystore your_site_name.jks

// sent the csr to godaddy and received the crt files

3.keytool -import -alias server -file your_site_name.crt -keystore your_site_name.jks

// this is the step in which the am getting the above error

"keytool error: java.lang.Exception: Certificate reply does not contain public key for ".

Shoaeb
  • 709
  • 7
  • 18
  • From [duplicate answer](https://stackoverflow.com/a/17083692/5221149) step 4 (your step 3): *important that this has an **alias different** to step 1*. – Andreas Jun 17 '20 at 06:15
  • are you implying that the steps given in godaddy official website are not correct? https://in.godaddy.com/help/java-code-signing-generate-a-csr-4780 – Shoaeb Jun 17 '20 at 07:02
  • https://www.adfdesign.com/blog/2019/01/26/installing-an-ssl-cert-from-godaddy-on-tomcat-9-server-running-on-windows-2012r2/ – Shoaeb Jun 17 '20 at 07:13
  • https://dzone.com/articles/keytool-commandutility-to-generate-a-keystorecerti – Shoaeb Jun 17 '20 at 07:24
  • GoDaddy steps are good. Steps 1 and 2 (see [Generate a CSR](https://in.godaddy.com/help/java-code-signing-generate-a-csr-4780)) uses `-alias codesigncert`, and step 3 (see [Download certificate & sign code](https://in.godaddy.com/help/java-code-signing-download-certificate-and-sign-code-20273)) **has no `-alias`**, hence gets assigned some other alias. – Andreas Jun 17 '20 at 08:00
  • The problem seemed to be this... https://stackoverflow.com/questions/1052700/java-io-ioexception-invalid-keystore-format/62467748#62467748 – Shoaeb May 04 '22 at 07:24

0 Answers0