Extend debug logging beyond TSA: signing certificate, chain, and CRL/OCSP requests - #464
Merged
Conversation
…ests Signing failures caused by certificates were reported only through identifiers the user cannot act on (DSS's C-<SHA-256 hex> token id), and the AIA / CRL / OCSP traffic was invisible because DSS logs through SLF4J, which JSignPdf does not wire to its java.util.logging console. Add FINE-level tracing matching what CapturingTspSource already does for the TSA leg: - CertificateInfo (engines/api) describes an X.509 certificate: subject, issuer, serial, validity (flagging EXPIRED / NOT YET VALID), the DSS token id, key usage, QC statements, and the AIA / CRL DP URLs. Hooked into KeyStoreUtils.getPkInfo, so both engines dump the signer chain. - LoggingDataLoader / LoggingRevocationSource / LoggingAIASource are pass-through decorators wired into DssTrustConfigurer.buildVerifier. Each logs one line per call (URL, certificate, size, outcome, elapsed; thisUpdate / nextUpdate for CRLs) and is skipped entirely when FINE is off. LoggingRevocationSource keeps DSS's alternate-URL support. - DssTrustConfigurer reports the anchors each trust source contributed plus the total, separating "nothing is trusted" from "this CA is not covered". - CapturingTspSource dumps the timestamp chain once the TSA answers. - DssUntrustedChainReporter reuses CertificateInfo instead of its own duplicate token-id / DN helpers. Fixes #452 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
kwart
force-pushed
the
issue-452-signing-diagnostics
branch
from
July 25, 2026 13:06
de48f12 to
99a4337
Compare
kwart
force-pushed
the
issue-452-signing-diagnostics
branch
from
July 25, 2026 13:08
99a4337 to
fedac88
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #452.
CapturingTspSourcealready traced the TSA leg atFINE, but the rest of the pipeline had nothing comparable: certificate problems surfaced only as DSS'sC-<SHA-256 hex>token ids, and the AIA / CRL / OCSP traffic was invisible because DSS logs through SLF4J, which JSignPdf does not wire to itsjava.util.loggingconsole. A failed signature showed that revocation data was missing, never why.Changes
CertificateInfo(engines/api) — describes an X.509 certificate: subject, issuer, serial, validity (flagging(EXPIRED)/(NOT YET VALID)), the DSS token id, key usage, QC statements (ETSI OIDs resolved to EN 319 412-5 names), and the AIAcaIssuers/ OCSP and CRL distribution-point URLs. Best-effort throughout — an unparseable extension is omitted, never fatal. Hooked intoKeyStoreUtils.getPkInfo, so both engines dump the signer chain.LoggingDataLoader/LoggingRevocationSource/LoggingAIASource— pass-through decorators wired intoDssTrustConfigurer.buildVerifier(). One line per call: role, URL, response size, elapsed time, or the failure reason; the revocation layer adds the certificate it was for, the status, andthisUpdate/nextUpdate. Everywrap(...)returns the delegate unchanged whenFINEis off, so a non-debug run pays nothing.LoggingRevocationSourceimplementsRevocationSourceAlternateUrlsSupportand forwards, preserving DSS's trusted-list alternate-URL path.DssTrustConfigurer— logs the anchors each configured trust source contributed plus the total, which separates "nothing is trusted at all" from "the anchors loaded but this CA is not among them".CapturingTspSource— dumps the timestamp chain once the TSA answers.DssUntrustedChainReporter— reusesCertificateInfoinstead of its own duplicate token-id / DN helpers.Sample output
Real trace from the new end-to-end test (embedded CA + TSA, PAdES LT):
Notes
FINE, matching the existing TSA tracing. Sincelogging.propertiessetsnet.sf.jsignpdf.level=FINE, this output appears in normal runs;-qsilences it along with the rest of the progress output.engines/apiand is triggered fromKeyStoreUtils, so the OpenPDF engine gets it too (verified with a real CLI signing run). The revocation / AIA tracing is DSS-only.Tests
CertificateInfoTest(8) andDssDebugTracingTest(6, covering pass-through and rethrow guarantees), plusDssSigningEngineTest.ltSigningTracesCertificatesAndRevocationFetchesAtFine— an end-to-end LT signing against the embedded CA/TSA asserting the whole trace. Full build green: 298 tests, 0 failures.Docs
New Troubleshooting → Reading the signing diagnostics section in
JSignPdf.adocwith annotated samples, cross-referenced from the LT/LTA trust section. Also addsdistribution/doc/release-notes/3.2.0.md(validated throughupdate-metainfo-release.py+appstreamcli validate), which additionally covers the already-merged aspect-ratio and Recent-files changes.🤖 Generated with Claude Code