I have a .der format certificate. I want to import this into a keystore.
But I am getting the following exception while doing the import
keytool error: java.lang.Exception: Input not an X.509 certificate
If i try to print the certification using -printcert, it gives the following exception
sun.security.pkcs.ParsingException: Sequence tag error
Caused by: java.io.IOException: Sequence tag error
... 8 more
I also tried converting the .der to .pem using utils.der2pem.java which is available in weblogic.
After converting the file, Header and footer "----BEGIN" and "----End" have been inserted into the certificate.
But Still i am getting the same exception. Can any one of you help me? I am breaking my head for the past 3 days for this issue.
Why can't the error message be correct? It's not a DER-formatted X509 certificate would be my guess.
Nice to meet you.
Joined: Aug 07, 2008
Thanks. Can you tell one example using keytool to find out the format of the .der file
and also to convert the same to X509 format.
Joined: Aug 10, 2006
keytool can handle either the binary DER format or the base64 PEM format for certificates, so my guess is that your file is not a certificate file. If you have enough experience, you can usually examine the first few bytes of the file and determine what kind of file it is. You'd need a hex editor to look at the file if it is a binary format. Perhaps if you can provide some history of how you came to possess this file I might be able to guess what kind of file it is.