How to digitally sign PDF documents in Ruby?

Is there a built-in library for digitally signing a PDF document?

+4
source share
2 answers

The package here seems to provide an extension for signing PDF files with Ruby. It's not free, but it looks like it provides its own ruby ​​interface.

Here's how to use it if in ruby ​​(after installing it):

require 'mypdfsigner' include MyPDFSigner inputPath = "/tmp/input.pdf" outputPath = "/tmp/output.pdf" location = "Chicago" reason = "Demo" contactInfo = "+1 555-555-5555" certify = false # not supported yet visible = true title = "Signing with MyPDFSigner" author = "KryptoKoder" subject = "Ruby Extension" keywords = "PKCS#12, MyPDFSigner, PDF" confFile = "" # defaults to /usr/local/mypdfsigner/mypdfsigner.conf if empty timestamp = true puts mypdfsigner_sign(inputPath, outputPath, location, reason, contactInfo, certify, visible, title, author, subject, keywords, confFile, timestamp) 

There is also a command line interface, so you can script if necessary, as well as a desktop application.

+6
source

I would do iText since it can create PDF files and sign them too ...

+1
source

All Articles