Forum Stats

  • 3,837,920 Users
  • 2,262,309 Discussions
  • 7,900,433 Comments

Discussions

Unable to import certificate, getting keytool error : keytool error: java.lang.Exception: Input not

I am trying to import a SHA256 certificate in cacerts using keytools. I am getting below error, unable to proceed further, its an big impediment for us. Can some one advise me how to fix the issue.

[[email protected] tmp]# /opt/beasys/bea1212/jdk1.7.0_51/jre/bin/keytool -import -trustcacerts -alias dbtmstr256 -file /tmp/DBTMSTR.CER -keystore /opt/beasys/bea1212/jdk1.7.0_51/jre/lib/security/cacerts -v

Enter keystore password:

keytool error: java.lang.Exception: Input not an X.509 certificate

java.lang.Exception: Input not an X.509 certificate

        at sun.security.tools.KeyTool.addTrustedCert(KeyTool.java:2626)

        at sun.security.tools.KeyTool.doCommands(KeyTool.java:1009)

        at sun.security.tools.KeyTool.run(KeyTool.java:340)

        at sun.security.tools.KeyTool.main(KeyTool.java:333)

[[email protected] tmp]#

JDK version : jdk1.7.0_51

Begin and end certificate looks good and i verified the certificate with this command : Verify Certificate : openssl x509 -in /tmp/certname.cer -text and i am getting proper output with all the certificate content.

Thank you.

Regards,

Uday

Answers