Element kiElement = (Element) XPathAPI.selectSingleNode(doc,
"//ds:KeyInfo[1]", nscontext);
KeyInfo ki = new KeyInfo(kiElement,
(new File(filename)).toURL().toString());
StorageResolver storageResolver = new StorageResolver(
new CertsInFilesystemDirectoryResolver(merlinsDir + "certs"));
ki.addStorageResolver(storageResolver);
PublicKey pk = ki.getPublicKey();