TLS/SSL are cryptographic protocols used to encrypt computer network communication.
- Server is authenticated by the client only +
- Client is authenticated by server additionally to a) (Mutual Authentication)
Keystore (JKS, PKCS12)
Contains private key(s) and certificate(s) used by TLS/SSL servers/clients to authenticate themselves to the other party.
Truststore (JKS)
Contains certificates of trusted servers/clients or trusted CAs, no key(s) contained.
See this tutorial for more details: https://docs.oracle.com/cd/E19509-01/820-3503/6nf1il6er/
-
Create PrivateKey: keytool -keystore clientkeystore -genkey -alias client Create Certificate signing request: keytool -keystore clientkeystore -certreq -alias client -keyalg rsa -file client.csr
-
Sign the CSR: openssl x509 -req -CA ca-certificate.pem.txt -CAkey ca-key.pem.txt -in client.csr -out client.cer -days 365 -CAcreateserial
-
keytool -import -keystore clientkeystore -file ca-certificate.pem.txt
-
keytool –import –keystore clientkeystore –file client.cer –alias client -alias theCARoot
Simply add your CAs to a keystore...
- keytool -import -file ca.cert -alias firstCA -keystore myTrustStore