posted 15 years ago
Hi,
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
at sun.security.pkcs.PKCS7.parse(PKCS7.java:118)
at sun.security.pkcs.PKCS7.<init>(PKCS7.java:68)
at sun.security.provider.X509Factory.parseX509orPKCS7Cert(X509Factory.java:530)
at sun.security.provider.X509Factory.engineGenerateCertificates(X509Factory.java:407)
at java.security.cert.CertificateFactory.generateCertificates(CertificateFactory.java:511)
at sun.security.tools.KeyTool.doPrintCert(KeyTool.java:1021)
at sun.security.tools.KeyTool.doCommands(KeyTool.java:539)
at sun.security.tools.KeyTool.run(KeyTool.java:124)
at sun.security.tools.KeyTool.main(KeyTool.java:118)
Caused by: java.io.IOException: Sequence tag error
at sun.security.util.DerInputStream.getSequence(DerInputStream.java:266)
at sun.security.pkcs.ContentInfo.<init>(ContentInfo.java:112)
at sun.security.pkcs.PKCS7.parse(PKCS7.java:136)
at sun.security.pkcs.PKCS7.parse(PKCS7.java:115)
... 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.