What is difference between cacerts and keystore? What is difference between cacerts and keystore? java java

What is difference between cacerts and keystore?


'cacerts' is a truststore. A trust store is used to authenticate peers. A keystore is used to authenticate yourself.


cacerts is where Java stores public certificates of root CAs. Java uses cacerts to authenticate the servers.

Keystore is where Java stores the private keys of the clients so that it can share it to the server when the server requests client authentication.


Cacerts are details of trusted signing authorities who can issue certs. This what most of the browsers have due to which certs determined to be authentic.

Keystore has your service related certs to authenticate clients.