title: Get certificate by alias in keystore with multiple entries in Java
body: <p>Ok! We are trying to implement a client server aplication (chatroom) . Of course the server is multithreaded. We wanted the communication to be secure so we used ssl sockets and certificates. I have read that you can store multiple certificates and keys in one keystore. When a client enters the chat he needs to fill in his username.</p>
  
  <ol>
  <li><p>Do we have to connect the username to the alias of the certificate/key?</p></li>
  <li><p>If yes, how can we use the specific certificate/key from the keystore from the alias? Or is there another way? I mean how can we "pick" the specific certificate depending on the name</p></li>
  <li><p>Is there a way for the clients to create their certificates at the time of they enter? (We want the certificates to be signed by a CA we have already implemented)</p></li>
  </ol>
  
  <p>Thank you!</p>