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@1917626 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed May 9, 2024
1 parent a5da0f8 commit dc088f7
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.bouncycastle.tsp.TimeStampRequestGenerator;
import org.bouncycastle.tsp.TimeStampResponse;
import org.bouncycastle.tsp.TimeStampToken;
import org.bouncycastle.tsp.TimeStampTokenInfo;

/**
* Time Stamping Authority (TSA) Client [RFC 3161].
Expand Down Expand Up @@ -113,12 +114,25 @@ public TimeStampToken getTimeStampToken(InputStream content) throws IOException
}
catch (TSPException e)
{
LOG.error(String.format("nonce: %08X", nonce));
LOG.error("request: " + Hex.getString(request.getEncoded()));
LOG.error(String.format("request nonce: %08X / %s", nonce, request.getNonce().toString(16)));
if (response != null)
{
LOG.error("response status: " + response.getStatus() + " " + response.getStatusString());
LOG.error("response tst: " + response.getTimeStampToken());
if (response.getTimeStampToken() != null)
{
TimeStampTokenInfo tsi = response.getTimeStampToken().getTimeStampInfo();
LOG.error("response tsi: " + tsi);
if (tsi != null && tsi.getNonce() != null)
{
LOG.error("response tsi nonce: " + tsi.getNonce().toString(16));
}
else if (tsi != null)
{
LOG.error("response tsi nonce is null");
}
}
}
LOG.error("response: " + Hex.getString(tsaResponse));
throw new IOException(e);
Expand Down

0 comments on commit dc088f7

Please sign in to comment.