[英]how to generate a private key certificate using keytool
我正在嘗試使用帶有私鑰的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.
導出的證書不包含私鑰。 私鑰保留在密鑰庫中。 您似乎正在使用一種直接的方法來復制密鑰庫。 只需將密鑰庫復制到服務器即可。 實際上,它應該已經在服務器上,否則您就有泄漏私鑰的風險。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.