Q:

Read username from smart card with Tomcat 7

I am working on a web-application that runs on a Tomcat 7 server.  I want to make the site accessible via a smart card, so I made the clientAuth="true" change in the Tomcat server.xml. 
I can access the web-app with a smart card now, but I want to be able to read the username/alias from the smart card in my web-app.  What is the most efficient way to do this?  
Also, do modern browsers take care of CRL checking when a site requests client auth? 
Thanks

A:

You have to implemenent an X509UsernameRetriever and pass the class name to this method of your realm.  The realm should do the rest.  I guess you are after the subjectAltName field to retrieve UPN of the user.