Wednesday, March 26, 2014

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

I was trying to import Gmail's smtp certificate in my keystore and i got this error.

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



This issue comes when you have something written before or after these tag in your certificate

-----BEGIN CERTIFICATE-----

-----END CERTIFICATE-----

I checked my cert file and found that i do have some extra characters in the file as i have downloaded it from internet.



Removed the extra characters from the certificate and retested and i was able to import it successfully in the keystore.

No comments: