replicating GPG Keychain behavior to generate revocation certificate "manually"

gpg_dude's Avatar

gpg_dude

19 Aug, 2026 10:54 PM

Is it possible to replicate the GPG Keychain behavior that occurs under the hood when a new secret key is created? I'm specifically looking at the automatic revocation certificate that is being generated. I'm finding these have a way of disappearing over time (e.g. new laptops, lost backups, etc) and am contemplating a programatic way to address this. I'm able to create a new revocation certificate by running: printf 'y\n0\n\ny\n' | /usr/local/bin/gpg --command-fd 0 --status-fd 2 --gen-revoke "$KEY" > ~/.gnupg/openpgp-revocs.d/${KEY}.rev but comparing the resulting revocation certificate to the ones created by GPG Keychain show a few differences that I would like to incorporate into this process. I could of course manipulate the resulting certificate manually but figured I'd ask if there was some way to do this more easily without having to recreate the wheel so to speak.

Thanks in advance!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac