【问题标题】:how to generate a private key certificate using keytool如何使用 keytool 生成私钥证书
【发布时间】:2013-03-22 13:40:35
【问题描述】:

我正在尝试使用带有私钥的 java 6 keytool 生成证书有什么帮助吗?

1.   Generate private key, public key and keystore to store the keys.



       /usr/local/packages/jdk16/bin/keytool -genkeypair -keyalg RSA -validity 300 -alias sslcert -keystore weblogic.jks

2. Create self signed certificate

    /usr/local/packages/jdk16/bin/keytool -selfcert -keyalg RSA -alias sslcert -keystore weblogic.jks

3.  Export the self signed certificate to a file

$ `/usr/local/packages/jdk16/bin/keytool -export -alias sslcert -rfc -file ohs.crt -keystore weblogic.jks`
      Enter keystore password: 
      Certificate stored in file <ohs.crt>

当我尝试导入该证书时,它说

Error in installing the server certificate.
 No private key found.

【问题讨论】:

  • 导入时未显示路径问题证书详细信息,但最终失败
  • crt 文件不能包含私钥。
  • crt 是 x509 格式的证书,没有私钥。如需私钥,请以pkcs#8或pkcs#12格式存储。
  • 您要在哪里导入该证书?
  • 我正在尝试从 weblogic 服务器导入名为 oracle traffic director 的负载均衡器

标签: java ssl ssl-certificate keytool


【解决方案1】:

导出的证书不包含私钥。私钥保留在密钥库中。您似乎正在使用一种长期的方式来复制密钥库。只需将密钥库复制到服务器即可。事实上,它应该已经在服务器上,否则你就有泄露私钥的风险。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-09
    • 1970-01-01
    • 2010-10-29
    • 2012-08-19
    相关资源
    最近更新 更多