title: Java How do you extract "issued to" or user from a SSL cert within an HttpRequest?
body: <p>In Java How do you extract "issued to" or user from a SSL cert within an <code>HttpRequest</code>?</p>
  
  <p>what I'm working with: </p>
  
  <pre><code> Object certChain = request
      .getAttribute("javax.servlet.request.X509Certificate");
  if (certChain != null)
  {
    X509Certificate certs[] = (X509Certificate[]) certChain;
    X509Certificate cert = certs[0];
    String user = cert.getSubjectDN().getName();
  }
  </code></pre>