corymickelson / NoPoDoFo

node pdf native bindings
GNU Affero General Public License v3.0
26 stars 6 forks source link

Multiple signatures/incremental updates #101

Open MatthewMarkgraaff opened 5 years ago

MatthewMarkgraaff commented 5 years ago

Hey @corymickelson I've managed to successfully sign some test pdfs, however, I'm running into issues when signing an already signed document.

Here's an example that's been signed twice:

f7075ea0-cd94-11e9-8a44-c9f4e233cd38.pdf

Here's a screenshot of the signature panel in adobe PDF reader:

Screenshot 2019-09-02 at 20 28 36

I've implemented the logic almost exactly as it's being tested here: https://github.com/corymickelson/NoPoDoFo/blob/master/spec/unit/Signer.ts

Does NoPoDoFo currently support signing the same document multiple times/incremental updates? If so, perhaps you could point me in the right direction.

Thanks!

corymickelson commented 5 years ago

So, what we are seeing is not that it failed to sign but that adobe reader doesn't think the first signature is valid. Is this the only reader you've tested in? There is a known issue with adobe reader signature validation, for more info see here. I have tested multiple signatures in other readers, ex: master pdf editor without the issue that presents in adobe. I understand the need for this and am not trying to downplay your issue, only specify that this may be a reader specific issue, for now I believe the best course of action I can do will be to reach back out to the podofo developers and retry adobe in hopes for a response.

MatthewMarkgraaff commented 5 years ago

At this stage, I have only tested in Adobe. I assumed Adobe's client would be the most reliable but will try with other readers tomorrow.

It seems to be an issue between NPDF/Adobe but is there anything I could do to help on this?

corymickelson commented 5 years ago

@MatthewMarkgraaff You can see here, this is the same document you have referenced above but opened with okular and both signature are valid. pdf_signatures_valid

corymickelson commented 5 years ago

@MatthewMarkgraaff I appreciate the offer to help, I believe the next step to resolve this is to learn how adobe is validating signatures as it appears to be different than other readers and the pdf spec for digital signatures.

MatthewMarkgraaff commented 5 years ago

@corymickelson I see. Definitely looks to be an Adobe issue. I'll make myself useful here and do some research. Will revert here with findings. If there's anything else I can do to help, please let me know.