gdelugre / origami

Origami is a pure Ruby library to parse, modify and generate PDF documents.
GNU Lesser General Public License v3.0
325 stars 110 forks source link

Document Certification #49

Open miguelsantoss opened 5 years ago

miguelsantoss commented 5 years ago

Hey,

I was trying to certificate pdf documents using this library, but the sign method does not allow (at least for now) to add permissions to the document, and I wasn't able to understand how the enable_usage_rights worked.

I guess my problem is pretty similar to the one described in https://github.com/gdelugre/origami/issues/14.

I tried to figure out a solution for this, and I hacked a quick solution that seems to work right now: https://github.com/miguelsantoss1/origami/commit/f86fd70e2f1117c51a4d8364a2ffb9b8f6a01a2b.

I found some references to the DocMDP header in the signature.rb, is this something you plan to add in the future? Adding that to the signature seems to be what I needed.

Another question is if it's possible to encrypt a document, and then sign/certify it. Is this something that could be done?

If I try to sign after the encryption, even without setting a password, it gives me an error.

Nerian commented 5 years ago

@miguelsantoss1 Hi

I am trying to do the exact thing: I want to add a Digital Signature and now allow any sort of change of a document. ¿How did you manage to do it?