vbuch / node-signpdf

Simple signing of PDFs in node.
MIT License
711 stars 178 forks source link

Appending remote PADES signatures #235

Open arvinjarvin opened 6 months ago

arvinjarvin commented 6 months ago

Hi

Hope you're well

Wondering how I can append a remote PADES signature with your library, which is a base64 returned by an external signing service.

vbuch commented 6 months ago

Hi, You would need to implement a Signer. The package only has one such implementation currently - https://github.com/vbuch/node-signpdf/blob/develop/packages/signer-p12/src/P12Signer.js but as you can see the abstract is quite simple https://github.com/vbuch/node-signpdf/blob/develop/packages/utils/src/Signer.js#L4

arvinjarvin commented 6 months ago

Thank you.

I'll get back on this issue if any more Qs.

arvinjarvin commented 6 months ago

Is the buffer being returned a buffer of the signed hash, or of the whole PDF integrating the signed hash?

vbuch commented 6 months ago

It's the signature only. It will be used here: https://github.com/vbuch/node-signpdf/blob/develop/packages/signpdf/src/signpdf.js#L79 The idea is that @signpdf/signpdf will deal with the PDF part. The Signer should only care of crypto.

vbuch commented 6 months ago

You should probably have a look at https://github.com/vbuch/node-signpdf/pull/230 You didn't say what the external signing service would be...