From 40a5103a6df53126ef012803d4a0b08bec9e0110 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Thu, 5 May 2016 12:22:44 +0000 Subject: [PATCH] Try to print out more information if the timestamp-operation fails git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1742425 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/poifs/crypt/dsig/services/TSPTimeStampService.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java index 05ebd4975e..0478048f7c 100644 --- a/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java +++ b/src/ooxml/java/org/apache/poi/poifs/crypt/dsig/services/TSPTimeStampService.java @@ -168,7 +168,9 @@ public class TSPTimeStampService implements TimeStampService { ? "application/timestamp-response" : "application/timestamp-reply" )) { - throw new RuntimeException("invalid Content-Type: " + contentType); + throw new RuntimeException("invalid Content-Type: " + contentType + + // dump the first few bytes + ": " + HexDump.dump(bos.toByteArray(), 0, 0, 200)); } if (bos.size() == 0) { @@ -248,8 +250,7 @@ public class TSPTimeStampService implements TimeStampService { LOG.log(POILogger.DEBUG, "time-stamp token time: " + timeStampToken.getTimeStampInfo().getGenTime()); - byte[] timestamp = timeStampToken.getEncoded(); - return timestamp; + return timeStampToken.getEncoded(); } public void setSignatureConfig(SignatureConfig signatureConfig) { -- 2.39.5