]> source.dussan.org Git - poi.git/commitdiff
Try to print out more information if the timestamp-operation fails
authorDominik Stadler <centic@apache.org>
Thu, 5 May 2016 12:22:44 +0000 (12:22 +0000)
committerDominik Stadler <centic@apache.org>
Thu, 5 May 2016 12:22:44 +0000 (12:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1742425 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java

index 05ebd4975e364ef4ad772fe8f7c3e1888ed0bd56..0478048f7c7f8d37f107fe488612291fc0265256 100644 (file)
@@ -168,7 +168,9 @@ public class TSPTimeStampService implements TimeStampService {
             ? "application/timestamp-response"\r
             : "application/timestamp-reply"\r
         )) {\r
-            throw new RuntimeException("invalid Content-Type: " + contentType);\r
+            throw new RuntimeException("invalid Content-Type: " + contentType +\r
+                    // dump the first few bytes\r
+                    ": " + HexDump.dump(bos.toByteArray(), 0, 0, 200));\r
         }\r
         \r
         if (bos.size() == 0) {\r
@@ -248,8 +250,7 @@ public class TSPTimeStampService implements TimeStampService {
         LOG.log(POILogger.DEBUG, "time-stamp token time: "\r
                 + timeStampToken.getTimeStampInfo().getGenTime());\r
 \r
-        byte[] timestamp = timeStampToken.getEncoded();\r
-        return timestamp;\r
+        return timeStampToken.getEncoded();\r
     }\r
 \r
     public void setSignatureConfig(SignatureConfig signatureConfig) {\r