Firma

Add a secure signature to a pdf file.

Check if a pdf it's signed

  require "firma"

  Firma.is_signed?("my_file.pdf")

Sign a pdf file

  require "firma"

  Firma.sign("my_file.pdf",
    key: "key.pem",
    passphrase: "passphrase",
    certificate: "key.crt"
  )

Sign a pdf file with newly generated certificates

  require "firma"

  keys = Firma.generate_keys("passphrase")

  Firma.sign("my_file.pdf",
    key: keys.fetch(:key).path,
    passphrase: "passphrase",
    certificate: keys.fetch(:certificate)
  )