You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2014/11/22 02:47:49 UTC

svn commit: r1641025 - /poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java

Author: kiwiwings
Date: Sat Nov 22 01:47:48 2014
New Revision: 1641025

URL: http://svn.apache.org/r1641025
Log:
Don't swallow exceptions on validation

Modified:
    poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java

Modified: poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java?rev=1641025&r1=1641024&r2=1641025&view=diff
==============================================================================
--- poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java (original)
+++ poi/trunk/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/SignatureInfo.java Sat Nov 22 01:47:48 2014
@@ -217,7 +217,10 @@ public class SignatureInfo implements Si
         
         /**
          * @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() {
             KeyInfoKeySelector keySelector = new KeyInfoKeySelector();
             try {
@@ -259,8 +262,9 @@ public class SignatureInfo implements Si
                 
                 return valid;
             } catch (Exception e) {
-                LOG.log(POILogger.ERROR, "error in marshalling and validating the signature", e);
-                return false;
+                String s = "error in marshalling and validating the signature";
+                LOG.log(POILogger.ERROR, s, e);
+                throw new EncryptedDocumentException(s, e);
             }
         }
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org