gettalong / hexapdf

Versatile PDF creation and manipulation for Ruby
https://hexapdf.gettalong.org
Other
1.21k stars 69 forks source link

multiple certificate #307

Closed heruwaspodov closed 2 months ago

heruwaspodov commented 2 months ago

hai mas @gettalong ~ I already implemented the multiple signatures using HexaPDF, but somehow the existing certificate is broken. I already guarded by validation the DOCMDP but it was passed (not detect the DOCMDP level). for the file may I send you via email directly? thank you

gettalong commented 2 months ago

Thanks for providing the files!

So the original document was already signed and the signature valid. It has no DocMDP transformation method. This doesn't mean, however, that you can just add something and not invalidate the original signature. This, however, depends on the PDF viewer.

All PDF readers will show that all signatures are cryptographically fine. Some will show that all are still valid while others will complain that the original signature is now invalid due to added form fields.

To satisfy all PDF readers you should finalize the document before the first signature.

WSPDV commented 2 weeks ago

Hi @gettalong, how to check whether it is possible to add the new signature? if the DocMDP not the only flagging to add a new signature? Thank you

gettalong commented 2 weeks ago

@WSPDV I'm not 100% sure, to be honest. You certainly need to check for DocMDP and if it is missing, assume that you can add another signature. As I have written, whether multiple signatures appear as valid also depends on the PDF viewer one is using. So I would try adding the signature and then viewing the result in the PDF reader of your choice to check.