Don't swallow exceptions on validation

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1641025 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2014-11-22 01:47:48 +00:00
parent d3dee868ef
commit 9d84f426f3

View File

@ -217,7 +217,10 @@ public class SignatureInfo implements SignatureConfigurable {
/** /**
* @return true, when the xml signature is valid, false otherwise * @return true, when the xml signature is valid, false otherwise
*
* @throws EncryptedDocumentException if the signature can't be extracted or if its malformed
*/ */
@SuppressWarnings("unchecked")
public boolean validate() { public boolean validate() {
KeyInfoKeySelector keySelector = new KeyInfoKeySelector(); KeyInfoKeySelector keySelector = new KeyInfoKeySelector();
try { try {
@ -259,8 +262,9 @@ public class SignatureInfo implements SignatureConfigurable {
return valid; return valid;
} catch (Exception e) { } catch (Exception e) {
LOG.log(POILogger.ERROR, "error in marshalling and validating the signature", e); String s = "error in marshalling and validating the signature";
return false; LOG.log(POILogger.ERROR, s, e);
throw new EncryptedDocumentException(s, e);
} }
} }
} }