0

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 this example for Key stores. How do I do about it for trust stores?

I setup the trust store in following way for my SSL two way handshake, but I want to use the certs for something else.

System.setProperty("javax.net.ssl.trustStore", "store.jts");
System.setProperty("javax.net.ssl.trustStorePassword", "PASS);
Andrew
  • 1,764
  • 3
  • 24
  • 38

1 Answers1

2

Both trust stores and key store are KeyStore objects. Just the usage is different. So, the example that you found should work for either a key store or a trust store, since they are objects of the same type.

Andrew
  • 1,764
  • 3
  • 24
  • 38
GreyBeardedGeek
  • 29,460
  • 2
  • 47
  • 67
  • I am talking about server code here, are you sure that's right? – Andrew Jan 24 '13 at 15:11
  • My question didn't explicitly say this so sorry about that. – Andrew Jan 24 '13 at 15:58
  • No, I was talking about client-side usage - I'm guessing that concepts of 'keystore' and 'truststore' are reversed on the server. But even on the server, both the keystore and the truststore will be instances of KeyStore. – GreyBeardedGeek Jan 25 '13 at 03:31