简体   繁体   中英

Java WSDL Web Service Getting the client certificate

I have a SOAP webservice made in Java, running on Oracle Weblogic. And I need to get the certificate which is supposed to be provided by the client connecting, and extract some information (IssuerDN). How would I go about this?

Edit: I think the 1st thing I am stuck on, is how do I get the input-stream/connection? Then how would I get the certificate?

This depends what implementation you are running. I some cases the request certificate may be put on the SOAPMessageContext. If that is the case you can implement a SOAPhandler to get hold of the certificate used in the request.

For example, in the IBM Websphere´s Axis2 based implementation of JAX-WS the following code will retrieve the certificate:

public X509Certificate getRequestCertificate(SOAPMessageContext aMessageContext) {
    return ((java.security.cert.X509Certificate) aMessageContext.get("com.ibm.xml.soapsec.RequestCert"));
}

Notice, be aware of the following. The code above may not be supported by the vendor of the web service container implementation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM