----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------


Hello,

you must user the security API.
And read the documentation.

This is a simple code for a servlet for getting and display a certificate.
(i didn't test it)


import javax.security.cert.X509Certificate;

String cipherSuite = (String)
req.getAttribute("javax.net.ssl.cipher_suite");
out.println("Cipher Suite" + cipherSuite);

if(cipherSuite != null)
{
  X509Certificate certChain[] = (X509Certificate)
req.getAttribute("javax.net.ssl.peer_certificates");
  if (certChain != null)
  {
    for (int i=0; i< certChain.length; i++)
    { 
      out.println("Client Certificate ["+i+"] = " +
certChain[i].toString());
    }
  }
}



--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search Archives: 
<http://www.mail-archive.com/java-apache-users%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to