vbuch / node-signpdf

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

[HELP] Sign pdf with x509 #130

Closed hrodrigues1984 closed 3 years ago

hrodrigues1984 commented 3 years ago

Hello,

Thanks in advance for your work, the library is very very nice.

I tried to use an x509 certificate to sign a pdf without the private key. Can you help with this challenge? After a lot of digging and using the library as a starting point, I was able to overcome some issues by changing the default p12 approach to be compatible with x509. Also related to node-forge, for instance, since I don't have access to the private key the pkcs7 object needs to use 'encrypt' instead of 'sign', during the signature creation.

I was also able to sign the pdf, however, none of my oids are working on the document's signature, resulting in a failure. Expected result: Screenshot 2021-03-24 at 19 31 10

Outcome: Screenshot 2021-03-24 at 19 31 27

Can someone help, please?

dhensby commented 3 years ago

I tried to use an x509 certificate to sign a pdf without the private key. Can you help with this challenge?

It is not possible to sign a document without a private key. What you're asking for is not possible.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had activity in the past 90 days. It will be closed if no further activity occurs. Thank you for your contributions.