Get Client Certificate by Servlet
843811Feb 25 2003 — edited Mar 16 2003hi everyone,
i am using servlet to get the details of the client certificate though the Browser IE, however i got the Exception.
java.lang.ClassCastException: [Ljava.security.cert.X509Certificate
I found that it is failed to get the correct object in the following code:
(X509Certificate)request.getAttribute( "javax.servlet.request.X509Certificate" )
i have printed out the object by using the following code:
Object obj=null;
PrintWriter out = response.getWriter();
out.println("Client Certificate Attribute " + attributeName + ", type \"" + obj.getClass().getName() );
the result:
Client Certificate Attribute javax.servlet.request.X509Certificate, type "[Ljava.security.cert.X509Certificate;
As i have seen some post claims that this is the bug of Tomcat 3.X version
but i have already used Tomcat4.1.18
Also i have try to use Netscapte6.2, but it also failed.
What can i do about it???
Thanks in advance!!!