keytool -genkeypair -alias certificatekey -keyalg RSA -validity 7 - keystore keystore.jks
keytool -export -alias certificatekey -keystore keystore.jks -rfc -file selfcert.cer
使用keytool生成ssl密钥文件keystore和truststore
原文:http://www.cnblogs.com/getherBlog/p/3930317.html