RichardBray / pdf_sign

🖋 Using node-signpdf and pdf-lib.js to sign a pdf
https://www.youtube.com/playlist?list=PLiKs97d-BatHWLh9MYrKwA9g6CD8RvAO3
37 stars 18 forks source link

Sign PDF with multiple signatures #3

Open jiokeokwuosa opened 1 year ago

jiokeokwuosa commented 1 year ago

The current implementation allows you to sign the PDF with one signature, i am working on a POC that involves multiple signings on the same PDF, please can you advise on how that can be implemented? The current implementation normally overrides the previous signing

RichardBray commented 1 year ago

Hey, @jiokeokwuosa that is an interesting problem you have. In my experience I don't think it's possible to have multiple signings on the same PDF. Simply because if one person signs it, and then someone else signs soon after, it negates the first signature.

One thing you can do is get each person o sign the document, but don't digitally sign it, just add an image of the signature to the PDF. When the final person signs it, get all the names or email addresses of the people who have previously signed it and add it to the final signature.

I have seen a document that has been digitally signed 4 times before, the only way I can assume that was done is that all the signing was done at the same time to prevent negating signatures. That's not something I've tried before so I'm not confident that it could work, but in theory if you're able to hold the digital signatures until the last person signs, and then use them all at once on one document that might work but I'm not sure.

I think the first solution I gave I can guarantee that will 100% work. The second solution I'm not so sure.

Simolation commented 1 year ago

It is possible to sign pdfs with incremental changes.

https://www.adobe.com/devnet-docs/etk_deprecated/tools/DigSig/Acrobat_DigitalSignatures_in_PDF.pdf You can read about it on page 8, sections 6.3.6 and 6.3.7

RichardBray commented 1 year ago

@Simolation If I'm being honest. it's not something I've looked into. In my experience if a PDF has been signed, editing it would make the signature void and it would need to be signed again.

As I mentioned above, you could pretend to sign it by just adding an image signature, then when all the incremental changes are done a proper electronic signature can be added onto the pdf making it final.