-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better support for signature verifications. #305
Comments
Disclaimer: I am no expert in signatures, nor incremental updates. I am also not saying that the situation in lopdf can't be improved upon. The most relevant parts of the PDF1.7 spec on this are probably "12.8 Digital signatures", "7.5.6 Incremental Updates", and "H.7 Updating Example". The way I understand what needs to be done to verify the signatures:
Your third point can probably be addressed together with implementing the possibility to access the different xref tables. Your second point should be pretty easy to do without support from lopdf: there should always be exactly two byte ranges, one from the start of the file to the start of the signature, and on from the end of the signature to the end of the file (or rather, to the correct EOF marker, but that's already addressed in your third point). The thing in between must be equal to the signature that is extracted by lopdf. As I said, I'm not an expert in this topic, so please correct me if I missed something/made a mistake. |
I wrote a library using I think the only issue that would be better if handled by lopdf itself is if I could access all the previous xref tables in a document. Currently I have to re-parse the file up to the previous incremental update I am analyzing. |
This is what I am trying to do:
Alice creates a PDF via some mechanism (e.g. export to PDF from LibreOffice), then send it to Bob. Bob signs it and send it back. Alice verifies Bob's signature and now knows Bob has agreed to the terms of the document.
I am trying writing the verification program, but there are a number of problems that are hard to solve with
lopdf
. They are:/ByteRange
into the file bytes, but there is no easy way to tell if only the/Contents
of that signature itself was excluded, as required by conforming validators.%EOF
following the signature itself.It would be great if
lopdf
had support for these cases.The text was updated successfully, but these errors were encountered: