2 Replies Latest reply on Jul 11, 2014 7:20 PM by Puneeth-Oracle

    keytool error: java.lang.Exception: Public keys in reply and keystore don't match - Web Logic 10.3.6.0 Linux 64 Bit

    jkkstar inc.,

      Hi,

       

      Followed Oracle recommended note for generating .csr file  (Doc ID 1230333.1)

       

      01) $keytool -genkey -alias server.alias -keyalg RSA -keysize 1024 -dname "CN=ServerName,OU=Office,O=OTS,L=Location,S=SW,C=GB" -keypass mypass -keystore ServerName.jks -storepass mypass

       

      02) copy ServerName.jks ServerName.jks.org

       

      03) $keytool -list -v -keystore ServerName.jks -storepass mypass

       

      04) $keytool -certreq -v -alias server.alias -file ServerName.csr -keypass mypass -storepass mypass -keystore ServerName.jks

       

      05) Sent the .csr file to CA

       

      06) ived a filename.cer certificate.

       

      07) rated Root ServerNameRootCert.cer and Intermediate Certificate ServerNameRootInterCert.cer from filename.cer certificate

       

      Importing Root CA into the keystore ServerName.jks

       

      08) $keytool -import -v file ServerNameRootCert.cer -keystore ServerName.jks -trustcacerts -alias AliasOne

       

      09) $keytool -import -v file ServerNameRootInterCert.cer -keystore ServerName.jks -trustcacerts -alias AliasTwo

       

      Now importing the actual certificate using the alias server.alias in the above step 01) and 04)

       

      10) $keytool -import -v file ServerName.cer -keystore ServerName.jks -alias server.alias -keypass -storepass

       

      Getting error message

      keytool error: java.lang.Exception: Public keys in reply and keystore don't match
      java.lang.Exception: Public keys in reply and keystore don't match
      at sun.security.tools.KeyTool.establishCertChain(KeyTool.java:2618)
      at sun.security.tools.KeyTool.installReply(KeyTool.java:1870)
      at sun.security.tools.KeyTool.doCommands(KeyTool.java:807)
      at sun.security.tools.KeyTool.run(KeyTool.java:172)
      at sun.security.tools.KeyTool.main(KeyTool.java:167)


      Is that anything wrong with the Certificate what is issued by CA?
      Is the java version need to be different?

       

      Current Java Version
      java version "1.6.0_29"
      Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
      Oracle JRockit(R) (build R28.2.0-79-146777-1.6.0_29-20111005-1807-linux-x86_64, compiled mode)

       

      Any suggestions please?

       

      Thanks,

      Kam