本文介绍了将证书添加到cacerts时出错.未知关键规格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows中使用jdk 1.6.我有一个.der文件(DER编码X509证书),该文件想添加到我的cacerts文件中...因此,我尝试了以下操作:

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-导入-keystore"C:\ Program Files \ Java \ jdk1.6.0_27 \ jre \ lib \ security \ cacerts" -trustcacerts-别名openldap-文件"C:\ cacert.der"

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

我收到以下错误: java.security.cert.CertificateParsingException:java.io.IOException:主题密钥,java.security.spec.InvalidKeySpecException:未知密钥规范

起初,我认为der证书有问题,但随后执行以下操作,我得到了完全相同的错误:

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"

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.

推荐答案

我在打开cacert列出证书时遇到了同样的问题.我的机器上存在文件许可问题.我尝试与root用户一起使用.我通过添加具有适当权限的新jdk jre解决了错误.

I faced same issue while opening cacert for listing the certificates.There was a file permission issue on my machine.I tried with root user.It was working.I resolved error by adding new jdk jre with proper permission.

这篇关于将证书添加到cacerts时出错.未知关键规格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-26 01:35