Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/knadh/pfxsigner
A CLI utility and web server for digitally signing PDFs with docsign loaded from PFX (PKCS#12) files
https://github.com/knadh/pfxsigner
digital-signature pdf pdf-sign pdf-signature
Last synced: about 1 month ago
JSON representation
A CLI utility and web server for digitally signing PDFs with docsign loaded from PFX (PKCS#12) files
- Host: GitHub
- URL: https://github.com/knadh/pfxsigner
- Owner: knadh
- License: agpl-3.0
- Created: 2020-01-08T07:54:05.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-12-24T12:59:50.000Z (almost 3 years ago)
- Last Synced: 2024-08-13T07:03:06.821Z (4 months ago)
- Topics: digital-signature, pdf, pdf-sign, pdf-signature
- Language: Go
- Homepage:
- Size: 32.2 KB
- Stars: 71
- Watchers: 6
- Forks: 19
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - knadh/pfxsigner - A CLI utility and web server for digitally signing PDFs with docsign loaded from PFX (PKCS#12) files (Go)
README
# pfxsigner
pfxsigner is a utility (CLI) and an HTTP server for digitally signing PDFs with signatures loaded from PFX (PKCS #12) certificates. It can load multiple named certificates from PFX files and sign PDFs with them.## Configuration
The signature properties are recorded in a JSON file. See `props.json.sample`.Multiple PFX files can be loaded by specifying the `-pfx certname|/cert/path.pfx|certpassword` param multiple times.
## CLI
The CLI mode supports multi-threaded bulk-signing of PDFs.```shell
# Pipe list of documents to convert to stdin. Each line should be in the format src-doc.pdf|signed-doc.pdf
# eg:
# mycert|a.pdf|a-signed.pdf
# mycert|b.pdf|b-signed.pdf
echo "in.pdf|out.pdf" | ./pfxsigner -pfx "mycert|/path/cert.pfx|certpass" -props-file "props.json.sample" cli -workers 4
```## Server
In the server mode, pfxsigner exposes an HTTP API to which a PDF file and signature properties (optional) can be posted to received a signed PDF.```shell
# Start the server
./pfxsigner -pfx "mycert|/path/cert.pfx|certpass" -props-file "props.json" server
``````shell
# Sign a pdfREQ=$(cat props.json.sample)
curl -F "props=$REQ" -F 'file=@./test.pdf' -o './test-signed.pdf' localhost:8000/document
```## Docker
You can use the [official]() Docker image to run `pfxsigner`.
**NOTE**: You'll need to mount `cert.pfx` and `props.json` from a directory available on host machine to a directory inside container. You can do that by passing `-v :` while launching the container.
```shell
# For example `./data` contains `cert.pfx` and `props.json`.
export PFX_PASSWORD=mysecurepass
docker run -it -p 8000:8000 -v "$PWD"/data:/data kailashnadh/pfxsigner:latest -pfx-file /data/cert.pfx -pfx-password $PFX_PASSWORD -props-file /data/props.json server
```### API
The API endpoint is `:8000/document`. It accepts a POST request (multipart/form-data) with the following fields.| Field | |
|---------|---------------------------------------------------------------|
| `props` | Signature properties as a JSON string (see props.json.sample). If not set, the default properties loaded during runtime are used |
| `file` | The PDF file to sign |## License
pfxsigner is licensed under the AGPL v3 license.