【发布时间】:2010-05-19 20:05:21
【问题描述】:
有人向我提供了一些使用 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 命令。任何关于从这里做什么的建议都会很棒。
【问题讨论】:
-
Java 可以将 PKCS12 视为 密钥库,但 before 8u60 (in 2015 well after this Q) 您必须指定它:
keytool -list -keystore whatever.pfx -storetype pkcs12