我已经获得了一些使用OpenSSL创建.pfx文件的命令 . 在大多数情况下,我的合作伙伴收集了以下信息:Is it possible to convert an SSL certificate from a .key file to a .pfx?
我有以下文件:
-
2010certificate.cer
-
2010cert_and_key.pem
-
private_verisign10to11.key
我试图用两者生成:
openssl pkcs12 -export -out s2010-1.pfx -inkey private_verisign10to11.key -in 2010cert_and_key.pem -certfile 2010certificate.cer
and
openssl pkcs12 -export -out s2010-1.pfx -inkey private_verisign10to11.key -in 2010certificate.cer -certfile 2010cert_and_key.pem
在这种情况下不会抛出任何错误,但是当我尝试查看或导入生成的文件s2010-1.pfx时,Protecle说它无法打开它 . Keytool说:
keytool -import -file s2010-1.pfx x -keystore cacerts -alias fqdn -storepass <.pfx's pass word>
keytool error: java.lang.Exception: Input not an X.509 certificate
我假设问题是.pfx生成,但我真的不知道如何测试它直到keytool命令 . 关于从这里做什么的任何建议都会很棒 .
2 回答
尝试使用TinyCA打开你的3个文件中的每个文件,因为它们可以是其扩展名所指的其他内容,特别是.pem文件 . 然后使用TinyCA导出密钥;有一个消息窗口显示openssl命令和所述命令的输出 .
问题是因为
keytool -importcert
(Java <1.6中的-import
)仅支持导入x509证书 .To import a PKCS12 (sometimes delivered in a .pfx file) into a Java .jks file, including cacerts: