keytool

阅读更多

keytool -genkey {-alias alias} {-keyalg keyalg} {-keysize keysize} {-sigalg sigalg} [-dname dname] [-keypass keypass] {-validity valDays} {-storetype storetype} {-keystore keystore} [-storepass storepass]

 

如:

 

1.生成私钥:keytool -genkey -alias server -keyalg rsa -sigalg md5withrsa  -keystore server.jks -storetype JKS

 

2.导出证书:keytool -export -alias mykey -keystore keystore -file exported-der.crt

3.检验:openssl x509 -noout -text -in exported-der.crt -inform der

 

4.生成公钥:openssl x509 -out exported-pem.crt -outform pem -in exported-der.crt -inform der

 

http://conshell.net/wiki/index.php/Keytool_to_OpenSSL_Conversion_tips

你可能感兴趣的:(PHP,.net)