Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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

User_ANJ9JJul 1 2019

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.

[root@ip-12-345-678-911 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)

[root@ip-12-345-678-911 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

Comments

Post Details

Added on Jul 1 2019
1 comment
590 views