NodeList nodeList = document.getElementsByTagNameNS(XMLSignature.XMLNS,"Signature");
if (nodeList.getLength() > 0)
{
XMLSignatureFactory signFactory = XMLSignatureFactory.getInstance();
DOMValidateContext validateContext = new DOMValidateContext(new XMLDSigKeySelector(),nodeList.item(0));
URIDereferencer dereferencer = new EbMSDataSourceURIDereferencer(dataSources);
validateContext.setURIDereferencer(dereferencer);
XMLSignature signature = signFactory.unmarshalXMLSignature(validateContext);
return signature.validate(validateContext);
}
return true;