I am writing a small library intended to be a high level (as in simple to use) library for digitally signing pdf's generated with the WeasyPrint library (https://github.com/Kozea/WeasyPrint).
I have already got it working for self-signed certificates and now I'm working on an adapter for digital signatures from the Globalsign DSS API (https://www.globalsign.com/en/resources/apis/api-documentation/digital-signing-service-api-documentation.html)
I've got everything working apart from LTV (Long Term Validation) which requires a DSS dictionary listing OCSP info and any certificates in the chain (To deal with revocation).
When I add the DSS, which has to come after the signature data has been written, I get an error in Adobe Acrobat stating that the signature byterange is invalid.
How do I go about enabling the DSS feature without invalidating the byterange?
I've studied the iText library somewhat intensively but it's so abstracted that it's hard to make out the actual data being written. I've still taken the liberty of tagging iText because it is somewhat of an industry standard in dealing with Digital Signatures in PDF's.