Usage
Signing messages
echo "Hello, world" | gpg -u you@example.com --clearsign
For batch/non-interactive signing:
echo "Hello, world" | gpg -u you@example.com --clearsign --pinentry-mode loopback --passphrase ""
Every signature still requires a Touch ID / passcode approval — the --passphrase/loopback flags only bypass GPG’s own passphrase prompt, not the Secure Enclave’s presence gate. See Security Model.
Verifying signatures
gpg --verify message.sig
# or inline:
echo "Hello, world" | gpg -u you@example.com --clearsign | gpg --verify
Encrypting (to self)
The decryption key cannot be backed up, so anything encrypted to it is permanently lost if the device is. It’s disabled by default for this reason — read Use Cases before enabling it, and make sure anything durable is also recoverable via a separately backed-up key.
gpg -e -r you@example.com file.txt
This requires the decryption subkey (OPENPGP.2) in your keyring, which is not created automatically — set SCDAEMON_SE_ALLOW_ENCRYPTION=1 in the daemon’s environment first. Output is written to file.txt.gpg.
Decrypting
gpg -d file.txt.gpg
gpg sends the ephemeral public key to scdaemon-se, which performs ECDH key agreement inside the Secure Enclave and returns the shared secret; gpg then derives the symmetric key and decrypts locally.
Signing git commits
gpg --list-keys --keyid-format long you@example.com # find your fingerprint/key ID
git config --global user.signingkey <fingerprint>
git config --global commit.gpgsign true
git config --global gpg.program gpg
git commit -m "My signed commit"
git invokes gpg, which invokes scdaemon-se through gpg-agent — you’ll see a Touch ID or passcode prompt for each commit.
For CI/scripted signing with no pinentry UI available, add allow-loopback-pinentry to gpg-agent.conf and pass the loopback mode when signing — but note that the Touch ID / passcode prompt itself still can’t be automated away (see Use Cases § Unattended / headless automation); this only removes GPG’s own passphrase prompt, not the Secure Enclave’s presence gate.
SSH authentication
The authentication subkey (OPENPGP.3) can be used for SSH auth via gpg-agent’s built-in ssh-agent emulation:
- Add
enable-ssh-supporttogpg-agent.conf. export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"- Find the auth subkey’s keygrip (
gpg --list-keys --with-keygrip you@example.com, the[A]subkey) and add it to~/.gnupg/sshcontrol.
See the GnuPG Agent Configuration documentation for the full set of ssh-agent options.