1. 生成PCCS12格式的keystore
keytool -v -genkey -alias tomcat -keyalg RSA -storetype PKCS12 -keystore tomcat.keystore -dname "CN=www.sap.com,OU=sap,O=SAP,L=SH,ST=SH,C=CN" -storepass Initial0 -keypass Initial0
2. 查看keystore的条目
openssl pkcs12 -info -in tomcat.keystore
keytool -list -v -storetype PKCS12 -keystore tomcat.keystore
3. 导出数字证书签发申请
keytool -certreq -alias tomcat -storetype PKCS12 -keystore tomcat.keystore -file tomcat.csr -v
或者直接拿到已经过CA签名的cer,http://www.cacert.org/certs/root.crt
4. 导入数字证书
获得签发后的数字证书后,需要将其导入信任库。
keytool -importcert -trustcacerts -alias tomcat -file tomcat.cer -keystore tomcat.keystore