The main content of this article is the implementation of the Java certificate System.
Please read this content in the first reading of Java encryption Technology (IV), in advance understand the RSA encryption algorithm.
Before building the Java code implementation, we need to complete the production of the certificate.
1. Generate Keystroe Files
At the command line, execute the following command:
Shell Code
Keytool-genkey-alias Www.zlex.org-keyalg Rsa-keystore D:\zlex.keystore
which
-genkey indicates that the key is generated
-alias Specify alias, this is www.zlex.org
-KEYALG Specifies the algorithm, this is RSA
-keystore Specify storage location, this is D:\zlex.keystore
The password I use here is 123456.
Console output:
Console code
输入keystore密码:
再次输入新密码:
您的名字与姓氏是什么?
[Unknown]: www.zlex.org
您的组织单位名称是什么?
[Unknown]: zlex
您的组织名称是什么?
[Unknown]: zlex
您所在的城市或区域名称是什么?
[Unknown]: BJ
您所在的州或省份名称是什么?
[Unknown]: BJ
该单位的两字母国家代码是什么
[Unknown]: CN
CN=www.zlex.org, OU=zlex, O=zlex, L=BJ, ST=BJ, C=CN 正确吗?
[否]: Y
输入<tomcat>的主密码
(如果和 keystore 密码相同,按回车):
再次输入新密码:
At this point, a Zlex.keystore file is generated under D disk.