##导出keystore到txt文件,通过序列号来查找是否已经存在。
keytool -list -v -keystore "/usr/java/jdk1.8.0_101/jre/lib/security/cacerts" > cacerts.txt
##定位执行目录
/usr/java/jdk1.8.0_101/jre/bin##导入,密码默认: changeit
keytool -import -alias DigiCert_CA_chain -file /home/xx/crt/DigiCert/DigiCert_CA_chain.crt -keystore "/usr/java/jdk1.8.0_101/jre/lib/security/cacerts" -storepass changeit -trustcacertskeytool -import -alias DigiCert_to_unionpay -file /home/xx/crt/DigiCert/DigiCert_to_unionpay.com.crt -keystore "/usr/java/jdk1.8.0_101/jre/lib/security/cacerts" -storepass changeit -trustcacerts
keytool -import -alias DigiCert_to_unionpaysecure -file /home/xx/crt/DigiCert/DigiCert_to_unionpaysecure.com.crt -keystore "/usr/java/jdk1.8.0_101/jre/lib/security/cacerts" -storepass changeit -trustcacerts
keytool -import -alias GlobalSign_CA_chain -file /home/xx/crt/globalsign/GlobalSign_CA_chain.crt -keystore "/usr/java/jdk1.8.0_101/jre/lib/security/cacerts" -storepass changeit -trustcacerts
keytool -import -alias GlobalSign_to_unionpay -file /home/xx/crt/globalsign/GlobalSign_to_unionpay.com.crt -keystore "/usr/java/jdk1.8.0_101/jre/lib/security/cacerts" -storepass changeit -trustcacerts
keytool -import -alias GlobalSign_to_unionpaysecure -file /home/xx/crt/globalsign/GlobalSign_to_unionpaysecure.com.crt -keystore "/usr/java/jdk1.8.0_101/jre/lib/security/cacerts" -storepass changeit -trustcacerts
##查看
keytool -list -alias DigiCert_CA_chain -keystore "/usr/java/jdk1.8.0_101/jre/lib/security/cacerts" -storepass changeitkeytool -list -alias DigiCert_to_unionpay -keystore "/usr/java/jdk1.8.0_101/jre/lib/security/cacerts" -storepass changeitkeytool -list -alias DigiCert_to_unionpaysecure -keystore "/usr/java/jdk1.8.0_101/jre/lib/security/cacerts" -storepass changeitkeytool -list -alias GlobalSign_CA_chain -keystore "/usr/java/jdk1.8.0_101/jre/lib/security/cacerts" -storepass changeit
keytool -list -alias GlobalSign_to_unionpay -keystore "/usr/java/jdk1.8.0_101/jre/lib/security/cacerts" -storepass changeitkeytool -list -alias GlobalSign_to_unionpaysecure -keystore "/usr/java/jdk1.8.0_101/jre/lib/security/cacerts" -storepass changeit