Element sigElement =
(Element) xpath.evaluate(expression, doc, XPathConstants.NODE);
XMLSignature signature =
new XMLSignature(sigElement, f.toURI().toURL().toString());
signature.addResourceResolver(new OfflineResolver());
KeyInfo ki = signature.getKeyInfo();
if (ki != null) {
if (ki.containsX509Data()) {