Signiant Support

Keytool error: java.security.cert.CertificateException Print


Problem:   

I receive the following message when trying to import a certificate using the Signiant Keytool:

keytool error: java.security.cert.CertificateException

Resolution:

This error indicates that the keytool was not able parse the certificate file correctly, which is most likely due to some extra characters (even whitespace) in the file.

To resolve the error follow the steps below:
  1. Open the .crt file in an ASCII text editor (Use Notepad or another plain text editor such as Vi).
  2. Ensure that the first line reads -----BEGIN CERTIFICATE-----
  3. Carefully go through the text to ensure that there are no extra spaces or carriage returns (^M).
  4. Ensure that every line of text is on a line of its own, and not combined with another line.
  5. Ensure that the first line reads -----END CERTIFICATE-----
  6. After fixing the certificate file, try to re-import your SSL Certificate.

If the error message specifies EOFException, then this is most likely due to a carriage return, blank line or any other characters at the end of the certificate file. As per step 5 above, -----END CERTIFICATE----- should be the last line in the certificate file.