Why is my Java keytool saying input not an X.509?

Why is my Java keytool saying input not an X.509?

keytool error: java.lang.Exception: Input not an X.509 certificate Cause There are a few causes for this error. The incorrect alias was specified while trying to install the certificate. The certificate being imported is improperly formatted. The certificate is being imported into an incorrect keystore.

Why is Java error importing not an X.509 certificate?

When you execute the second command, it finds an error message instead of a key in public.crt, so it fails, saying keytool error: java.lang.Exception: Input not an X.509 certificate.

Why is my Java certificate in the wrong keystore?

The following error occurs when importing a Sun Java™ certificate into a Keystore: There are a few causes for this error. The incorrect alias was specified while trying to install the certificate. The certificate being imported is improperly formatted. The certificate is being imported into an incorrect keystore.

What kind of certificate is supported by Java keytool?

It’s usually seen with .p7b and .p7c extensions and can include the entire certificate chain as needed. This format is supported by Java’s keytool utility. Binary (DER) certificate Contains an X.509 certificate in its raw form, using DER ASN.1 encoding.

keytool error: java.lang.Exception: Input not an X.509 certificate Cause There are a few causes for this error. The incorrect alias was specified while trying to install the certificate. The certificate being imported is improperly formatted. The certificate is being imported into an incorrect keystore.

When you execute the second command, it finds an error message instead of a key in public.crt, so it fails, saying keytool error: java.lang.Exception: Input not an X.509 certificate.

The following error occurs when importing a Sun Java™ certificate into a Keystore: There are a few causes for this error. The incorrect alias was specified while trying to install the certificate. The certificate being imported is improperly formatted. The certificate is being imported into an incorrect keystore.

Why did SSL keytool throw an error in Java 7?

The file contained only the a single certificate in both humain readable form and encapsulated within —–BEGIN CERTIFICATE—– and —–END CERTIFICATE—–. In java 7 (patch 71) the keytool failed to parse such file and threw the same error you’ve got. Once I removed the text portion of the file: