On Thu 2016-09-01 15:28:10 -0400, Daniel Kahn Gillmor wrote: > On Thu 2016-09-01 13:26:28 -0400, Antoine Beaupré wrote: >> I'm curious to hear what people think of this - should we parse >> gpg.conf for such configuration to figure out which key to extract? > > I recently learned about "gpg --with-colons --list-config", but it > doesn't include default-key. > > It shouldn't be hard to add that to GnuPG upstream, though, and it'd be > lots better than trying to parse the config files ourselves. > > I've just opened: > > https://bugs.gnupg.org/gnupg/issue2666
And as i noted there there's also: gpgconf --list-options gpg | \ awk -F: '/^default-key:/{ print $10 }' the python equiv should be pretty easy to do. Maybe it's worth just doing an initial "gpgconf --list-options gpg" and gpg --with-colons --list-config" and storing the results in two dicts for future consultation? --dkg