gnupg-pkcs11-scd. This enables signing git commits and tags, RPM/DEB packages, and any other artifact that uses GPG signatures, all backed by keys stored securely in Infisical.
Prerequisites
- An Infisical project with a signer configured (RSA keys recommended for GPG compatibility)
- An active signing grant for the signer
- A machine identity with Universal Auth and
Signpermission on the signer - The Infisical PKCS#11 module installed and configured
- GnuPG 2.2 or later
gnupg-pkcs11-scd(the PKCS#11 smart card daemon bridge)
Step 1: Install gnupg-pkcs11-scd
- Ubuntu / Debian
- macOS (Homebrew)
- RHEL / Fedora
Step 2: Configure gnupg-pkcs11-scd
Create~/.gnupg/gnupg-pkcs11-scd.conf:
On macOS, use the
.dylib extension: provider-infisical-library /usr/local/lib/libinfisical-pkcs11.dylib~/.gnupg/gpg-agent.conf:
The path to
gnupg-pkcs11-scd varies by platform. On macOS with Homebrew, use /opt/homebrew/bin/gnupg-pkcs11-scd. Run which gnupg-pkcs11-scd to find the correct path.Step 3: Import the PKCS#11 Key into GPG
List the available keys from the PKCS#11 token:KEY-FRIEDNLY or KEYPAIRINFO. These show the available keys and their key grips (40-character hex strings). Note the key grip for the signer you want to use.
Then generate a key stub:
You can generate the key stub interactively:
Step 4: Sign Git Commits
Configure git to use your GPG key:Verify Signatures
Step 5: Sign Arbitrary Files
Use GPG to create detached signatures for any file:CI/CD Integration
For CI pipelines, configure the GPG agent in non-interactive mode. You need to create the key stub on each run sinceGNUPGHOME is ephemeral:
- The
Key-Lengthin the batch keygen must match your signer’s key size (e.g., 2048, 3072, or 4096 for RSA). - The Infisical auth environment variables must be set before the GPG agent starts, as the agent inherits the environment when
gpg-connect-agentlaunches it. - For repeated CI runs, you can hardcode the key grip value since it doesn’t change for a given signer.
Troubleshooting
For any issue, enable debug logging in your config file ("log_level": "debug", "log_file": "/tmp/infisical-pkcs11.log") to get detailed output.
Card error or signing failures
Card error or signing failures
Ensure
gnupg-pkcs11-scd is installed and the path in gpg-agent.conf is correct. If the key stub is missing, run gpg --card-status to refresh, then gpg -K to verify. Restart the agent with gpgconf --kill gpg-agent if needed.ECDSA keys not working
ECDSA keys not working
GPG has limited ECDSA curve support via PKCS#11. RSA keys (2048, 3072, 4096) are recommended for GPG signing.