[iyunv@test conf]# keytool -genkey -v -alias tomcat -keyalg RSA -keystore mykeystore
Enter keystore password: #设置密码
Re-enter new password: #重复一次
What is your first and last name?
[Unknown]: Alex Lu #随便填
What is the name of your organizational unit?
[Unknown]: visionet #随便填
What is the name of your organization?
[Unknown]: visionet #随便填
What is the name of your City or Locality?
[Unknown]: SH #随便填
What is the name of your State or Province?
[Unknown]: SH #随便填
What is the two-letter country code for this unit?
[Unknown]: ZH #随便填
Is CN=Alex Lu, OU=visionet, O=visionet, L=SH, ST=SH, C=ZH correct?
[no]: Y #这里要Y,确认前面信息。
Generating 2,048 bit RSA key pair and self-signed certificate (SHA256withRSA) with a validity of 90 days
for: CN=Alex Lu, OU=visionet, O=visionet, L=SH, ST=SH, C=ZH
Enter key password for <tomcat>
(RETURN if same as keystore password): #默认回车即可,不需要设置太多密码
[Storing mykeystore]
[iyunv@test conf]# ls
Catalina catalina.policy catalina.properties context.xml logging.properties mykeystore server.xml tomcat-users.xml web.xml