Trust Store vs Key Store - creating with keytool

前端 未结 7 626
粉色の甜心
粉色の甜心 2020-11-22 05:27

I understand that the keystore would usually hold private/public keys and the trust store only public keys (and represents the list of trusted parties you intend to communic

7条回答
  •  渐次进展
    2020-11-22 05:42

    To explain in common usecase/purpose or layman way:

    TrustStore : As the name indicates, its normally used to store the certificates of trusted entities. A process can maintain a store of certificates of all its trusted parties which it trusts.

    keyStore : Used to store the server keys (both public and private) along with signed cert.

    During the SSL handshake,

    1. A client tries to access https://

    2. And thus, Server responds by providing a SSL certificate (which is stored in its keyStore)

    3. Now, the client receives the SSL certificate and verifies it via trustStore (i.e the client's trustStore already has pre-defined set of certificates which it trusts.). Its like : Can I trust this server ? Is this the same server whom I am trying to talk to ? No middle man attacks ?

    4. Once, the client verifies that it is talking to server which it trusts, then SSL communication can happen over a shared secret key.

    Note : I am not talking here anything about client authentication on server side. If a server wants to do a client authentication too, then the server also maintains a trustStore to verify client.

提交回复
热议问题