How to generate self-signed certificate using keytool command of JDK?

1.Generate local digital cerficate

cd D:\_Share and Training\SSL
keytool -genkeypair -keyalg RSA -keysize
2048 -sigalg SHA1WithRSA -validity 36000 -alias www.tibco.com -keystore tibco.keystore

or 

keytool -genkeypair -keyalg RSA -keysize 2048 -sigalg SHA1WithRSA -validity 36000 -alias www.tibco.com -keystore tibco.keystore -dname "CN=www.tibco.com,OU=adapter,O=tibco,L=BJ,ST=BJ,C=CN" -storepass 123456


2.Export digital certificate 
keytool -exportcert -alias www.tibco.com -keystore C:\self-signed\tibco.keystore -file tibco.cer -rfc


-rfc: export the certicate with Base64 format


3.Print Digital Certificae


keytool -printcert -file tibco.cer


4.Export Digital certificate request


keytool -certreq -alias www.tibco.com -keystore tibco.keystore -file tibco.csr -v -storepass 123456


5.Import digital certificate


keytool -importcert -trustcacerts -alias www.tibco.com -file tibco.cer -keystore tibco.keystore


6.View imported digital cerificate


keytool -list -alias www.tibco.com -keystore tibco.keystore
复制 搜索

你可能感兴趣的:(How to generate self-signed certificate using keytool command of JDK?)