Simple PDF signer (C++, Go)
Go to file
Přemysl Eric Janouch 46fa50749f
Add a --version option
And fix that --reservation was missing from the optstring.
2020-09-05 20:08:41 +02:00
cmd/pdf-simple-sign Make it possible to change the signature reservation 2020-09-04 18:33:12 +02:00
pdf Make it possible to change the signature reservation 2020-09-04 18:33:12 +02:00
LICENSE Return errors rather than mangle documents 2020-09-04 16:05:14 +02:00
NEWS Add NEWS 2018-08-03 20:04:33 +02:00
README.adoc Make it possible to change the signature reservation 2020-09-04 18:33:12 +02:00
go.mod Go: update dependencies 2020-08-12 06:15:41 +02:00
go.sum Go: update dependencies 2020-08-12 06:15:41 +02:00
meson.build Add a --version option 2020-09-05 20:08:41 +02:00
pdf-simple-sign.cpp Add a --version option 2020-09-05 20:08:41 +02:00

README.adoc

pdf-simple-sign

pdf-simple-sign is a simple PDF signer intended for documents produced by the Cairo library. As such, it currently comes with some restrictions:

  • the document may not have any forms or signatures already, as they would be overwritten

  • the document may not employ cross-reference streams, or must constitute a hybrid-reference file at least

The signature is attached to the first page and has no appearance.

I dont aim to extend the functionality any further. The project is fairly self-contained and it should be easy to grasp and change to suit to your needs.

Building

Build dependencies: Meson, a C++11 compiler, pkg-config
Runtime dependencies: libcrypto (OpenSSL 1.1 API)

$ git clone https://git.janouch.name/p/pdf-simple-sign.git
$ cd pdf-simple-sign
$ meson builddir
$ cd builddir
$ ninja

In addition to the C++ version, also included is a native Go port:

$ go get janouch.name/pdf-simple-sign/cmd/pdf-simple-sign

Usage

$ ./pdf-simple-sign document.pdf document.signed.pdf KeyAndCerts.p12 password

If the signature doesnt fit within the default reservation of 4 kibibytes, you might need to adjust it using the -r option, or throw out any unnecessary intermediate certificates.

Contributing and Support

Use https://git.janouch.name/p/pdf-simple-sign to report bugs, request features, or submit pull requests. git send-email is tolerated. If you want to discuss the project, feel free to join me at ircs://irc.janouch.name, channel #dev.

Bitcoin donations are accepted at: 12r5uEWEgcHC46xd64tt3hHt9EUvYYDHe9

License

This software is released under the terms of the 0BSD license, the text of which is included within the package along with the list of authors.