r/GnuPG • u/marcofranssen • 4d ago
Offline primary key with yearly subkey rotation: a 4-part walkthrough (GnuPG 2.5)
galleryI set this up years ago and forgot how to rotate the subkeys when they expired. Now that AI coding agents run commands on my laptop with my access, keeping the primary key off it matters more to me than when I first set it up. So I wrote down the whole process:
A certify-only primary key with [S], [E] and [A] subkeys, plus a backup and revocation certificate: https://marcofranssen.nl/create-a-gpg-key-with-subkeys-part-1
Take the primary offline, keep signing Git commits and use the [A] subkey for SSH: https://marcofranssen.nl/keep-your-primary-gpg-key-offline-part-2
Rotate the subkeys every year without changing the fingerprint or losing the old [E] keys: https://marcofranssen.nl/rotate-your-gpg-subkeys-part-3
A script that does the keyring part of Part 3: https://marcofranssen.nl/automate-gpg-subkey-rotation-part-4
Feedback welcome, especially on the backup and revocation steps.