title: How to verify a certificate using Keytool?
body: <p>I want to a program to verify to create a SSL Sockets using Oracle's <code>SSLSocket</code> class. In my program I want the client to pass its certificate (created using <code>Keytool</code>). The Server should verify the certificate and then proceed with communication. I want the server to check the certificate of each client that connects to it. Suppose that all the key's (server's and client's) are stored in the <code>Keystore</code>. How do I implement this?</p>
  
  <p>Edit:</p>
  
  <p>Forgive me if I am not able to convey my question correctly. I am new to this. I'm reading <a href="http://www.ibm.com/developerworks/java/tutorials/j-jsse/section5.html" rel="nofollow">this link</a> to get some directions. Here, while reading the keystores the server has directly hard-coded the client's key file name (viz "client.public"). However, in my program this will be specified by the client as the server can't know beforehand what the client's public key file name would be.</p>