常用命令:
#产生
keytool -genkeypair -keyalg "RSA" -keystore "keystore_name" -alias "test1"
keytool -genkeypair -keyalg "RSA" -keystore "keystore_name" -alias "test2"
#查看
keytool -list -keystore "keystore_name"
keytool -list -keystore "keystore_name" -alias "test1"
#删除
keytool -delete -keystore "keystore_name" -alias "test1"
#导出
keytool -export -keystore "keystore_name" -alias "test2" > test2.crt
keytool -export -keystroe "keystore_name" -alias "test2" -file "test2.crt"
#查看crt
keytool -printcert -file test2.crt
其他
-validity 参数指明过期时间(天),默认90天
-keysize 1024
参考:
1.http://ln-ydc.iteye.com/blog/1335213
2.http://blog.chinaunix.net/uid-17102734-id-2830223.html