>   The thing I want to know is: how can you read properties from the client
>   certificate (such as public key, common name, organisation ....etc) inside a
>   servlet or JSP page?

To retrieve the certificate from the request, use the following call:

X509Certificate[] certArray = (X509Certificate[] ) =
      req.getAttribute("javax.servlet.request.X509Certificate");

The certArray is an array of certificates in the certificate chain.
[In most cases there is just one certificate in the chain.  If there
is more than one certificate, then the certificate at index 0 is the
certificate of the client, the certificate at index 1 is the
certificate used to sign the certificate at index 0, etc.

 From each certificate, you can call methods such as the following:

getSerialNumber()
GetSubjectDN()

For more details on what you can retrieve from individual
certificates, see the JavaDoc file at:

http://java.sun.com/j2se/1.3/docs/api/java/security/cert/X509Certificate.html

John

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to