Skip to content

KeyStore trustStore

A Java KeyStore (JKS) is a repository of security certificates – either authorization certificates or public key certificates – plus corresponding private keys, used for instance in SSL encryption. We will need to generate a key pair (a public key and associated private key). Wraps the public key into an X.509 self-signed certificate, which is stored as a single-element certificate chain. This certificate chain and the private key are stored in a new keystore entry identified by selfsigned.

Main difference between trustStore vs keyStore is that trustStore (as name suggest) is used to store certificates from trusted Certificate authorities(CA) which is used to verify certificate presented by Server in SSL Connection while keyStore is used to store private key and own identity certificate which program should present to other party (Server or client) to verify its identity.

Posted from: https://blogs.oracle.com/datawarehousing/post/secure-kafka-cluster

Java Keytool Essentials: Working with Java Keystores

Java Keytool is a key and certificate management tool that is used to manipulate Java Keystores, and is included with Java. A Java Keystore is a container for authorization certificates or public key certificates, and is often used by Java-based applications for encryption, authentication, and serving over HTTPS. Its entries are protected by a keystore password. A keystore entry is identified by an alias, and it consists of keys and certificates that form a trust chain.

This cheat sheet-style guide provides a quick reference to keytool commands that are commonly useful when working with Java Keystores. This includes creating and modifying Java Keystores so they can be used with your Java applications.

Posted from: https://www.digitalocean.com/community/tutorials/java-keytool-essentials-working-with-java-keystores

Payara EE & Configure SSL Certificates

The Payara Server Community uses a dedicated key and certificate store when using SSL/TLS connections. The files are located in the configuration directory of the domain <payara-home>/glassfish/domains/<domain-name>/config and referenced through JVM options so that they are used for the entire JVM.

cacerts.jks: Java Keystore formatted file used as Trust Store file holding the X.509 certificates. keystore.jks: Java Keystore formatted file containing the Cryptographic keys, like the private keys associated with the certificates.

These keystores are protected with the Master Password of your domain.

Payara Platform Enterprise provides the Integrated Certificate Management feature. This allows creating, installing and managing SSL/TLS certificates without external tools like keytool or OpenSSL, just using asadmin commands or Admin Console. This simplifies the processes documented below and makes it much less risky to perform tasks like renewing certificates, deleting expired certificates, etc.

Posted from:https://docs.payara.fish/community/docs/documentation/payara-server/server-configuration/ssl-certificates.html

trustStore vs keyStore in Java SSL

Posted from: https://www.artima.com/forums/flat.jsp?forum=121&thread=347900


Re: trustStore vs keyStore in Java SSL
Posted: Dec 22, 2016 2:02 AMReply
Keystore is used by a server to store private keys, and truststore is used by third party client to store public keys provided by server to access. I have did that in my production application. Below are the steps for generating java certificates for SSL communication:

1. Generate a certificate using keygen command in windows:

keytool -genkey -keystore server.keystore -alias mycert-20161109 -keyalg RSA -keysize 2048 -validity 3950

2. Self certify the certificate:

keytool -selfcert -alias mycert-20161109 -keystore server.keystore -validity 3950

3. Export certificate to folder:

keytool -export -alias mycert-20161109 -keystore server.keystore -rfc -file mycert-20161109.cer

4. Import Certificate into client Truststore:

keytool -importcert -alias mycert-20161218 -file C:\certs\mycert-20161218.cer -keystore .truststore

Posted from: https://www.artima.com/forums/flat.jsp?forum=121&thread=347900

Leave a Reply

Your email address will not be published. Required fields are marked *