title: How can I access java trust store certs
body: <p>My server program uses the trust store for client certs which works fine for the two way handshake, however I would like to be able to get the certs from the trust store for other things. I noticed <a href="http://www.java2s.com/Code/Java/Security/RetrievingaKeyPairfromaKeyStore.htm" rel="nofollow">this example</a> for Key stores. How do I do about it for trust stores? </p>
  
  <p>I setup the trust store in following way for my SSL two way handshake, but I want to use the certs for something else.</p>
  
  <pre><code>System.setProperty("javax.net.ssl.trustStore", "store.jts");
  System.setProperty("javax.net.ssl.trustStorePassword", "PASS);
  </code></pre>