KeyInfo ki = kifac.newKeyInfo(Collections.singletonList
(kifac.newKeyValue((PublicKey)TestUtils.getPublicKey("DSA", 2048))));
XMLSignature sig = fac.newXMLSignature(si, ki, objs, id, sigValueId);
Document doc = TestUtils.newDocument();
XMLSignContext signContext =
new DOMSignContext(TestUtils.getPrivateKey("DSA", 2048), doc);
signContext.setURIDereferencer(ud);
sig.sign(signContext);
XMLValidateContext validateContext = new DOMValidateContext
(TestUtils.getPublicKey("DSA", 2048), doc.getDocumentElement());
validateContext.setURIDereferencer(ud);
assertTrue(sig.validate(validateContext));