Ask a Question

Solution ID : SO7108

Error: "keytool error: java.lang.Exception: Input not an X.509 certificate" when Installing a Sun Java Code Signing Certificate

Problem

The following error occurs when importing a Sun Java™ certificate into a Keystore:

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

Cause

There are a few causes for this error.

  1. The incorrect alias was specified while trying to install the certificate.
  2. The certificate being imported is improperly formatted.
  3. The certificate is being imported into an incorrect keystore.

Solution

Please review each of the possible options below and their fixes to troubleshoot this error:

Option 1 - Incorrect Alias Specified:

This error can occur if the wrong Alias was specified when attempting to install the Sun Java Code Signing certificate to the Keystore.  The correct Alias to use would be the Alias used when generating the Certificate Signing Request (CSR) that was submitted for the enrollment of the certificate.

For further information, please see solution ID:  SO4333


Option 2 - Improper Format:

If the Sun Java Code Signing certificate was saved in an improper way, this error can occur.

To troubleshoot the format of the certificate, please see solution ID:  SO1781


Option 3 - Incorrect Keystore being Used:

If a different Keystore is being used, than the Keystore that was used to generate the CSR that was submitted for the enrollment of the certificate, this error can occur.

If the correct Keystore to use is unknown or lost, a replacement of the certificate is needed.  For instructions to replace the certificate, please see solution ID:  SO1437