doc.getElementsByTagNameNS(Constants.SignatureSpecNS, "Signature");
if (nl.getLength() == 0) {
throw new Exception("Couldn't find signature Element");
}
Element sigElement = (Element) nl.item(0);
XMLSignature signature = new XMLSignature
(sigElement, file.toURI().toString());
SecretKey sk = signature.createSecretKey("secret".getBytes("ASCII"));
try {
System.out.println
("Validation status: " + signature.checkSignatureValue(sk));
System.out.println("FAILED");
atLeastOneFailed = true;
} catch (XMLSignatureException xse) {
System.out.println(xse.getMessage());
System.out.println("PASSED");