Skip to content

Commit

Permalink
PDFBOX-5820: add more logging
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1917617 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed May 9, 2024
1 parent 749cda1 commit 665c291
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.pdfbox.util.Hex;
import org.bouncycastle.asn1.ASN1ObjectIdentifier;
import org.bouncycastle.operator.DefaultDigestAlgorithmIdentifierFinder;
import org.bouncycastle.operator.DigestAlgorithmIdentifierFinder;
Expand Down Expand Up @@ -104,14 +105,22 @@ public TimeStampToken getTimeStampToken(InputStream content) throws IOException
// get TSA response
byte[] tsaResponse = getTSAResponse(request.getEncoded());

TimeStampResponse response;
TimeStampResponse response = null;
try
{
response = new TimeStampResponse(tsaResponse);
response.validate(request);
}
catch (TSPException e)
{
LOG.error(String.format("nonce: %08X", nonce));
LOG.error("request: " + Hex.getString(request.getEncoded()));
if (response != null)
{
LOG.error("response status: " + response.getStatus() + " " + response.getStatusString());
LOG.error("response tst: " + response.getTimeStampToken());
}
LOG.error("response: " + Hex.getString(tsaResponse));
throw new IOException(e);
}

Expand Down

0 comments on commit 665c291

Please sign in to comment.