vbuch / node-signpdf

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

Deprecated extractSignature as it was never public-ready. #208

Closed vbuch closed 7 months ago

vbuch commented 7 months ago

Copied it in internal-utils to be used in tests. Will remove from utils in a next major release (#206)

dhensby commented 7 months ago

Is it worth making use of util.deprecate() to properly mark the function as deprecated?

coveralls commented 7 months ago

Coverage Status

coverage: 99.585% (+0.001%) from 99.584% when pulling a2efb6f8bf4570e56beac788be46ae7071119706 on feature/deprecate-extractSignature into 5855e24682953db8f8ff071c5797a601aed75256 on develop.

vbuch commented 7 months ago

Is it worth making use of util.deprecate() to properly mark the function as deprecated?

@dhensby , ✅

dhensby commented 7 months ago

I'm going through the upgrade process/refactor of my project that uses pdfsign and I've just noticed that I'm using extractSignature as a helper in our tests - essentially just to assert that there is indeed a signature in the PDF we've created. This is especially helpful when writing a custom signer and you want to assert that a signature was indeed added.

Is there a better way to do that?

vbuch commented 7 months ago

The best I can think of would be to use an external library that deals with signature verification and exports such a utility. This one used to be part of node-signpdf some 5 years ago and is the only one I know. Finding such a library would actualy render our own extractSignature useless.

vbuch commented 7 months ago

With the above in mind I'm closing this. I understand that the util may come handy to some. What I will do instead is create an adequate wording around it that clearly states this is not public-ready code.