Most of those sites use the Socket Layer (SSL) protocol to secure their Internet applications.
SSL allows the data from a client, such as a Web browser, to be encrypted prior to transmission so that someone trying to sniff the data is unable to decipher it.
Many Java application servers and Web servers support the use of keystores for SSL configuration.
If you’re building secure Java programs, learning to build a keystore is the first step.
What is Java Key Tool ?
Java Keytool is a key and certificate management utility. It allows users to manage their own public/private key pairs and certificates.
Java Keytool stores the keys and certificates in what is called a keystore. It protects private keys with a password.
Each certificate in a Java keystore is associated with a unique alias.
When creating a Java keystore you will first create the .jks file that will initially only contain the private key,
then generate a CSR. Then you will import the certificate to the keystore including any root certificates.
Steps to manually import certficicates into KeyStore
1. Create a KeyStore in machine
keytool -keystore <KeyStoreName> -genkey -alias <Key Store Alias> eg: keytool -keystore mykeystore -genkey -alias myalias
2. Get the Certificate File and keep it in a location
eg: Certificate file name is scarlet.cer
3. Import the Certificate as a Trusted Certificate to keystore
keytool -import -alias <AliasName> -keystore <KeyStoreName> -file <FilePath> eg: keytool -import -alias susan -keystore mykeystore -file scarlet.cer