XmlSecOutInterceptor sigOutInterceptor = new XmlSecOutInterceptor();
sigOutInterceptor.setSignRequest(true);
sigOutInterceptor.setKeyInfoMustBeAvailable(useKeyInfo);
bean.getOutInterceptors().add(sigOutInterceptor);
XmlSecInInterceptor sigInInterceptor = new XmlSecInInterceptor();
sigInInterceptor.setRequireSignature(true);
if (!useKeyInfo) {
sigInInterceptor.setSignatureVerificationAlias("alice");
}
bean.getInInterceptors().add(sigInInterceptor);
} else {
XmlSigOutInterceptor sigOutInterceptor = new XmlSigOutInterceptor();
if (enveloping) {
sigOutInterceptor.setStyle(XmlSigOutInterceptor.ENVELOPING_SIG);
}
sigOutInterceptor.setKeyInfoMustBeAvailable(useKeyInfo);
bean.getOutInterceptors().add(sigOutInterceptor);
XmlSigInInterceptor sigInInterceptor = new XmlSigInInterceptor();
sigInInterceptor.setKeyInfoMustBeAvailable(useKeyInfo);
bean.getInInterceptors().add(sigInInterceptor);
}
WebClient wc = bean.createWebClient();
WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000L);