Summary of the use of java tomcat Keytool

The operation summary of keytool, the things on the Internet are too pitiful, it is estimated that they are reproduced by others, and I have not experimented by myself. Now I will record my summary:

 

1. Generation of keystore

keytool -genkey -alias lean -keypass xfg456654 -keyalg RSA -keysize 1024 -validity 365 -keystore e:/lean.keystore -storepass xfg456654 -dname "CN=(first and last name), OU=(organizational unit name), O= (organization name), L=(city or region name), ST=(state or province name), C=(unit's two-letter country code)"

 

2. View keystore information

keytool -list  -v -keystore e:/lean.keystore -storepass xfg456654

 

3. Certificate export

keytool -export -alias lean -keystore e:/lean.keystore -file e:/lean.crt -storepass xfg456654

 

4. View the exported certificate information

keytool -printcert -file e:/lean.crt

 

5. Import the certificate

keytool -import -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -file e:/lean.crt -alias lean
输入密码:changeit

 

6. Delete the certificate

keytool -delete -alias lean -keystore "%JAVA_HOME%/jre/lib/security/cacerts" -storepass changeit

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326531131&siteId=291194637