firma
Command-line electronic signatures (PAdES for PDFs, CAdES, XAdES and FacturaE invoices), an alternative to Spain's AutoFirma.
A single self-contained binary written in pure Rust: no Java, no OpenSSL, no external libraries
(it only links against the operating system's own libraries).
- Several users, each with their own certificate and handwritten signature (image or vector). The certificate can
be a
.p12/.pfx file or one already in the macOS Keychain or the Windows certificate store: then no
password is typed, the key never leaves the system, and each signature is approved with Touch ID / Windows Hello.
- Visible signature in one or more places, on any page, including rotated pages.
- AutoFirma-style text stamp ("Digitally signed by …") so anyone can see the document is signed.
- Other files too: CAdES (
.csig) for any file, enveloped XAdES for XML documents, and FacturaE electronic
invoices (XAdES-EPES with the FacturaE policy), at levels B-B and B-T.
- PAdES B-B, B-T (RFC 3161 time-stamp), B-LT (embedded OCSP/CRL revocation data) and B-LTA
(document time-stamp for long-term archival).
- Signs encrypted PDFs (RC4, AES-128, AES-256), respecting their permissions.
- Imports the signature you saved in macOS Preview, as vector graphics.
Agent skill (Claude, Codex, …)
The repo also ships sign-pdf, an Agent Skill that lets an AI agent sign documents
with firma on your behalf. It finds or installs the binary, checks the request with firma sign --dry-run,
shows you a summary and asks for confirmation before signing. It never handles your passwords: you run the
final command yourself, or point it to a password file only you can read. With a certificate in the Keychain /
Windows certificate store the agent can run the command after you confirm, and you approve the signature with
Touch ID / Windows Hello in a dialog that names the document.
| Agent | Install |
|---|
| Claude Code | /plugin install firma --marketplace e98cuenc/firma-cli |
| Claude.ai / Claude Desktop | Download sign-pdf-skill.zip from the releases and upload it in Customize > Skills (it bundles the binaries, so it also works in sandboxes without network access) |
| Codex and other Agent Skills readers | Unzip sign-pdf-skill.zip into ~/.agents/skills/ |
| Any of the above, from a checkout | scripts/install-skill.sh (copies it to ~/.claude/skills and ~/.agents/skills) |
The skill's source is in plugins/firma/skills/sign-pdf. CI builds sign-pdf-skill.zip with the binaries for every
platform, smoke-tests the bundled Linux binary, and attaches the zip to each release.
scripts/build-skill.sh builds the zip locally.
Install
Download the archive for your platform from the releases page and put firma
(firma.exe on Windows) somewhere on your PATH.
Or build it from source (Rust ≥ 1.87):
cargo install --locked --path . # installs into ~/.cargo/bin
| Platform | Release artifact | Notes |
|---|
| macOS | firma-macos-universal.tar.gz | Universal binary (Apple Silicon + Intel) |
| Linux | firma-x86_64-linux.tar.gz, firma-aarch64-linux.tar.gz | Fully static (musl): runs anywhere, but cannot use smart cards |
| Linux | firma-x86_64-linux-gnu.tar.gz, firma-aarch64-linux-gnu.tar.gz | Linked against glibc 2.35+ (Ubuntu 22.04, Debian 12, Fedora 36 or newer): can use smart cards (PKCS#11) |
| Windows | firma-x86_64-windows.zip | Static CRT, no Visual C++ runtime needed |
Or use the installers, which check the release's SHA-256 sums:
plugins/firma/skills/sign-pdf/scripts/install.sh (macOS/Linux, into ~/.local/bin) or install.ps1 (Windows).
On Linux, install.sh picks the glibc build when the system has glibc 2.35 or newer, and the static one otherwise
(FIRMA_LINUX_BUILD=gnu or static chooses).
Release builds are produced by GitHub Actions (.github/workflows/build.yml) when a v* tag is pushed:
git tag v0.1.0 && git push origin v0.1.0
scripts/smoke-test.sh [path/to/firma] creates a throw-away certificate and signs a PDF. CI runs it on every platform,
and scripts/system-cert-test.sh on macOS and Windows (a throw-away keychain / the runner's certificate store).
Users
Each user has a certificate and, optionally, a handwritten signature. Everything is stored as plain files in
~/.config/firma/users/<name>/ (%APPDATA%\firma\users\<name>\ on Windows, or $FIRMA_HOME).
Files are mode 0600:
user.toml holder, issuer, expiry date (and the fingerprint of a system certificate)
certificate.p12 as-is, encrypted with its own password (the password is never stored); not
present when the certificate is in the Keychain / Windows certificate store
signature.png handwritten signature as an image, or
signature.pdf vector handwritten signature imported from Preview