Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8054019

Keytool Error publicKey's is not X.509, but X509

XMLWordPrintable

    • b03
    • x86
    • windows_2008

        FULL PRODUCT VERSION :
        java version "1.7.0_65"
        Java(TM) SE Runtime Environment (build 1.7.0_65-b19)
        Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Microsoft Windows [Version 6.1.7601]

        A DESCRIPTION OF THE PROBLEM :
        keytool error: java.lang.IllegalArgumentException: publicKey's is not X.509, but X509

        java.lang.IllegalArgumentException: publicKey's is not X.509, but X509
                at sun.security.x509.CertAndKeyGen.generate(Unknown Source)
                at sun.security.tools.KeyTool.doGenKeyPair(Unknown Source)
                at sun.security.tools.KeyTool.doCommands(Unknown Source)
                at sun.security.tools.KeyTool.run(Unknown Source)
                at sun.security.tools.KeyTool.main(Unknown Source)


        REGRESSION. Last worked in version 7u21

        ADDITIONAL REGRESSION INFORMATION:
        java version "1.7.0_21"
        Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
        Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        keytool -genkeypair -validity 3650 -v -alias tomcat -keyalg RSA -keysize 2048 -sigalg SHA256withRSA -providername JsafeJCE -keystore keystore.p12 -storetype pkcs12

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        It should create the Keystore.p12
        ACTUAL -
        keytool error: java.lang.IllegalArgumentException: publicKey's is not X.509, but X509

        java.lang.IllegalArgumentException: publicKey's is not X.509, but X509
                at sun.security.x509.CertAndKeyGen.generate(Unknown Source)
                at sun.security.tools.KeyTool.doGenKeyPair(Unknown Source)
                at sun.security.tools.KeyTool.doCommands(Unknown Source)
                at sun.security.tools.KeyTool.run(Unknown Source)
                at sun.security.tools.KeyTool.main(Unknown Source)

        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        keytool error: java.lang.IllegalArgumentException: publicKey's is not X.509, but X509

        java.lang.IllegalArgumentException: publicKey's is not X.509, but X509
                at sun.security.x509.CertAndKeyGen.generate(Unknown Source)
                at sun.security.tools.KeyTool.doGenKeyPair(Unknown Source)
                at sun.security.tools.KeyTool.doCommands(Unknown Source)
                at sun.security.tools.KeyTool.run(Unknown Source)
                at sun.security.tools.KeyTool.main(Unknown Source)

        REPRODUCIBILITY :
        This bug can be reproduced always.

        CUSTOMER SUBMITTED WORKAROUND :
        Used earlier version for JDK 1.7.21 for now, but we cannot progress because we cannot use the latest JRE which has lot security issue fixed and most of the companies mandate that software should be compatible with the latest JRE

              coffeys Sean Coffey
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: