This section describes how to include the client’s certificate information into Java servlets that are hosted by EAServer.
You can obtain SSL certificate information about the client as follows:
java.security.cert.X509Certificate peerX509;
ServletRequest request;
peerX509 = (java.security.cert.X509Certificate)
request.getAttribute
("javax.servlet.request.X509Certificate");
Where request is the ServletRequest parameter
passed in the doXXX()method.The ServletRequest technique
is portable to other J2EE based application servers. See section
5.7 of the Java Servlet Specification version 2.2 for more information
on these APIs.
You can also obtain the client’s SSL certificate information using the EAServer CtsSecurity APIs, as follows:
import CtsSecurity.*; CtsSecurity.X509Certificate peerX509; peerX509 = (CtsSecurity.X509Certificate)request.getAttribute( "com.sybase.jaguar.servlet.request.X509Certificate");
Methods in CtsSecurity.X509Certificate and java.security.cert.X509Certificate are
very similar. java.security.cert.X509Certificate documentation
is available as part of the JDK documentation. CtsSecurity.X509Certificate documentation is
available in the EAServer repository documentation.
| Copyright © 2005. Sybase Inc. All rights reserved. |
|
|