To exchange data securely, you’ll need to keep track of your
own private and public keys as well as the public keys of all the
people with whom you wish to converse securely. What you need is
something like an address book that correlates individuals to their
keys and certificates. The JCA contains support for exactly this,
based around the
KeyStore classes. For more information about this,
take a look at Chapter 5.