To generate keystore file, a tool called keytool by Java is used to generate certificates. Make sure to use the latest java release to use the latest security library.
Check Java version:
#java -version
Generating keystore:
keytool -genkey -alias
Example:
#keytool -genkey -alias myalias -keyalg RSA -keysize 2048 -keystore mykeystore.
Note: it will ask for the password to the keystore and alias. It can be the same.
Generate CSR:
keytool -certreq -alias
Example:
#keytool -certreq -alias myalias -keystore mykeystore -file mycsr.csr.
Note: it will prompt you for the keystore password specified above procedure.
Send the CSR to Public CA like TPP Internet, Thawte, etc. . After sending the file, download the corresponding CRT file for the domain created.
Importing CRT:
#keytool -import -trustcacerts -alias
Example:
keytool -import -trustcacerts -alias myalias -file certfromca.crt -keystore mykeystore