Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Get Client Certificate by Servlet

843811Feb 25 2003 — edited Mar 16 2003
hi 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!!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 13 2003
Added on Feb 25 2003
5 comments
213 views