return false;
}
//create a SignatureAlgorithms from the SignatureMethod inside
//SignedInfo. This is used to validate the signature.
SignatureAlgorithm sa =si.getSignatureAlgorithm();
if (log.isDebugEnabled()) {
log.debug("SignatureMethodURI = " + sa.getAlgorithmURI());
log.debug("jceSigAlgorithm = " + sa.getJCEAlgorithmString());
log.debug("jceSigProvider = " + sa.getJCEProviderName());
log.debug("PublicKey = " + pk);
}
sa.initVerify(pk);
// Get the canonicalized (normalized) SignedInfo
SignerOutputStream so=new SignerOutputStream(sa);
OutputStream bos=new UnsyncBufferedOutputStream(so);
si.signInOctectStream(bos);
try {
bos.close();
} catch (IOException e) {
//Imposible
}
//retrieve the byte[] from the stored signature
byte sigBytes[] = this.getSignatureValue();
//Have SignatureAlgorithm sign the input bytes and compare them to the
//bytes that were stored in the signature.
boolean verify = sa.verify(sigBytes);
return verify;
} catch (XMLSecurityException ex) {
throw new XMLSignatureException("empty", ex);
}