似乎证书(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..