似乎证书(X509)验证执行的唯一方法是: 如果对服务器的请求包含已在服务器密钥库中的证书,则处理该请求(与服务器的响应相同)。
请您建议一种通过CRL和根证书验证证书的方法吗?
使用spring security和cxf <jaxws:inInterceptors>
怎么样?找不到教程
进步 试着写我自己的拦截器:
public class MyInInterceptor extends AbstractPhaseInterceptor<Message> {
Logger logger = Logger.getLogger(MyInInterceptor.class);
public MyInInterceptor() {
super(Phase.PRE_PROTOCOL);
addAfter(WSS4JInInterceptor.class.getName());
}
private SOAPMessage getSOAPMessage(SoapMessage msg) {
SAAJInInterceptor.INSTANCE.handleMessage(msg);
return msg.getContent(SOAPMessage.class);
}
@Override
public void handleMessage(Message message) throws Fault {
logger.info("custom handleMessage method");
logger.info("getting a certificate");
HashMap engine = (HashMap) message.get("wss4j.signature.result");
X509Certificate certificate = (X509Certificate) engine.get("x509-certificate");
logger.info("parsing certificate");
}
目前问题是以任何可能的方式验证证书,比如纯java ..