vbuch / node-signpdf

Simple signing of PDFs in node.
MIT License
688 stars 175 forks source link

Add support for overriding signature SubFilter value #140

Closed dhensby closed 3 years ago

dhensby commented 3 years ago

To confirm to the PAdES standard PDF signatures need to have the SubFilter value of ETSI.CAdES.detached not adbe.pkcs7.detached

l) The Signature Dictionary shall contain a value of ETSI.CAdES.detached for the key SubFilter. [1]

This PR allows consumers of this library to define the SubFilter as required


[1] https://www.etsi.org/deliver/etsi_en/319100_319199/31914201/01.01.01_60/en_31914201v010101p.pdf

dhensby commented 3 years ago
  1. I've added the constants for the different signature SubFilter values as per the PDF docs (https://www.adobe.com/devnet-docs/etk_deprecated/tools/DigSig/Acrobat_DigitalSignatures_in_PDF.pdf) and the ETSI PAdES value.
  2. I've had to export the constants as they aren't actually available to consumers (that I could see) to allow the constants to be used.
  3. I've added some basic readme docs; I think PAdES support stuff is worth mentioning in the docs.
vbuch commented 3 years ago

@dhensby could you please resolve the conflicts here so I can hit the merge button. Will try to find the time to also fix the CI at some point, but have too much on my head and willing to reduce the easy ones: Like this one that was good to be merged at some point.

dhensby commented 3 years ago

done