这个问题可能是重复的,但我无法获得解决方案,我尝试使用以下命令创建 SSL 证书,
C:\Program Files\Java\jdk1.6.0_05\bin>keytool -genkey -alias tomcat -keyalg RSA
-keystore E:\key
Enter keystore password:
Re-enter new password:
What is your first and last name?
[Unknown]: Raghu
What is the name of your organizational unit?
[Unknown]: BFS
What is the name of your organization?
[Unknown]: iGate
What is the name of your City or Locality?
[Unknown]: Bang
What is the name of your State or Province?
[Unknown]: KA
What is the two-letter country code for this unit?
[Unknown]: IN
Is CN=Raghu, OU=BFS, O=iGate, L=Bang, ST=KA, C=IN correct?
[no]: y
Enter key password for <tomcat>
(RETURN if same as keystore password):
Re-enter new password:
我尝试使用以下命令获取证书请求
C:\Program Files\Java\jdk1.6.0_05\bin>keytool -certreq -v -alias tomcat -keyalg
RSA -keystore E:\key
Enter keystore password:
并在命令提示符下得到以下响应
**-----BEGIN NEW CERTIFICATE REQUEST----- MIIBlzCCAQACAQAwVzELMAkGA1UEBhMCSU4xCzAJBgNVBAgTAktBMQ0wCwYDVQQHEwRCYW5nMQ4w
DAYDVQQKEwVpR2F0ZTEMMAoGA1UECxMDQkZTMQ4wDAYDVQQDEwVSYWdodTCBnzANBgkqhkiG9w0B
AQEFAAOBjQAwgYkCgYEA0Aoxz2V/Cqs00d7d4iVysIcfMxXDA4ydD5+AY2Q2hPqIOAbfrz0HiSjZ
JwKV0/g7P/oWPU9fCFYnLXAynusbaAtw5xIolMNqj9gtxmD1BzrwxcVIX3oWY0LzO768TMY3Szjp
tS64z5q1KSTYqeZww0f11N2JssjtMch8gw50FIcCAwEAAaAAMA0GCSqGSIb3DQEBBQUAA4GBAK1v
sE0BNxGrGKNBXhYuSdgwF14ZnELtjWBzDJDzbzgJbK6RJlOEstKxdStR2fq7iv0ow+Df7TnVWidm
+0PRLuhtr3DMZVX2acNQY4c4ynKWgLyBV2lAXbYfgZdzQr3ClY+40lkbmHQaMxZcxz2q7u8Np6sH
n0iytY6U0CqJpRcB
----END NEW CERTIFICATE REQUEST-----**
我保存在 cert.txt 文件中并验证证书回复
C:\Program Files\Java\jdk1.6.0_05\bin>keytool -printcert -file E:\cert.txt
**keytool error: java.lang.Exception: Failed to parse input**
我得到了上述错误。请提出相同的建议。