Tuesday, March 14, 2017

SSL Certificate with Java Keystore

Generate CSR
keytool -genkeypair -alias cftc-csid.ca -keyalg RSA -keysize 2048 -validity 365 -keypass xxxx -keystore keystore.jks -storepass xxxx
keytool -certreq -alias cftc-csid.ca -file cftc-csid.ca.csr -keystore keystore.jks -storepass xxxx

Import the Certificate from CA
keytool -import -trustcacerts -alias root -file cftc-csid_ca.ca-bundle  -keystore keystore.jks -storepass xxxx
keytool -import -trustcacerts -alias cftc-csid.ca -file cftc-csid_ca.crt  -keystore keystore.jks -storepass xxxx

List all keys
keytool -v -list -keystore keystore.jks -storepass xxxx

Delete a key
keytool -delete -keystore keystore.jks -storepass xxxx

No comments:

Post a Comment