0

我正在尝试使用带有私钥的 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.
4

1 回答 1

1

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

于 2013-10-02T06:01:32.363 回答