vbuch / node-signpdf

Simple signing of PDFs in node.
MIT License
679 stars 176 forks source link

Signature is not PAdES compliant and "The signature is not intact!" #183

Closed ElTimuro closed 1 year ago

ElTimuro commented 1 year ago

Hi Valery,

first of all great project. I hope I can contribute soon, since I am currently building an open-source signing service called Documenso.com. While checking out your library I found this issue:

Describe the bug and the expected behaviour

Is it a bug in signing or in the helpers? I used plainAddPlaceholder, not sure if the helper is the problem.

To Reproduce Simple sign any PDF and Validate using the EU tool. (just upload "signed file"): https://ec.europa.eu/digital-building-blocks/DSS/webapp-demo/validation

const pdfBufferToSign = plainAddPlaceholder({
    pdfBuffer,
    subFilter: SUBFILTER_ETSI_CADES_DETACHED,
  });

to sign.

Give us a failing test.

Cheers from Hamburg Timur

vbuch commented 1 year ago

149 #71

I think people complained about the same before. I could trace it up to https://github.com/vbuch/node-signpdf/issues/70#issuecomment-861435746 Nobody ever suggested a PR hence it is not fixed in the library. Try it out and everyone would love it if you can come up with a PR.

ElTimuro commented 1 year ago

I will do my best, but I'm currently new in the matter so it will thank some time to get into it. I was hoping you had more insight as to why, since the implementation is working well otherwise as far as I can tell and you seem to know PAdES. I'm considering completely writing a node/ TS library port of the https://github.com/esig/dss library, tho probably only PAdES for now.

I will let you know if I find something. Meanwhile, if you have any idea where to start that would be helpful.

ElTimuro commented 1 year ago

PR: https://github.com/vbuch/node-signpdf/pull/187

ElTimuro commented 1 year ago

Fixed and merged 🎉

vbuch commented 1 year ago

Released in 1.5.1

hmpvillegas commented 1 year ago

good day to you all, was wondering PAdES mode for signing is multiple signature supported ? thanks