Error adding certificate to cacerts. Unknown key spec
- by Alvaro Villanueva
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.