JDK的证书默认密码为changeit
注意:win7情况下要使用管理员账号运行cmd
1、list 证书
keytool -list -keystore "%JAVA_HOME%\jre\lib\security\cacerts" -alias sso.xxx.com
2、生成证书
keytool -genkey -alias sso.xxx.com -keyalg RSA -keystore d:/security/xxx-sso -validity 1000 -dname "CN=sso.xxx.com, OU=xxx, O=xxx, L=guangzhou, ST=guangdong, C=ZH"
3、导出证书
keytool -export -file d:/security/xxx-sso.crt -alias sso.xxx.com -keystore d:/security/xxx-sso
4、为客户端的jvm导入证书
keytool -import -keystore "%JAVA_HOME%\jre\lib\security\cacerts" -file D:/security/xxx-sso.crt -alias sso.xxx.com -storepass changeit
5、删除证书
keytool -delete -keystore "%JAVA_HOME%\jre\lib\security\cacerts" -alias sso.xxx.com