Error adding certificate to cacerts. Unknown key spec

Posted by Alvaro Villanueva on Stack Overflow See other posts from Stack Overflow or by Alvaro Villanueva
Published on 2011-10-28T15:09:28Z Indexed on 2011/11/18 17:51 UTC
Read the original article Hit count: 1231

Filed under:
|

I am using jdk 1.6 in Windows. I have a .der file (DER Encoded X509 Certificate) that will like to add to my cacerts file... so I tried the following:

keytool -import -keystore "C:\Program Files\Java\jdk1.6.0_27\jre\lib\security\cacerts" -trustcacerts -alias openldap -file "C:\cacert.der"

I got the following error: java.security.cert.CertificateParsingException: java.io.IOException: subject key, java.security.spec.InvalidKeySpecException: Unknown key spec

At first, I thoght it was a problemen with the der certificate, but then doing the following I got exactly the same error:

keytool -list -keystore "C:\Program Files\Java\jdk1.6.0_27\jre\lib\security\cacerts"

Any ideas why is this problem appearing? I have not found anything in the Web. Thanks in advance.

© Stack Overflow or respective owner

Related posts about ssl-certificate

Related posts about keytool