Learned a bit o #python #gnupg bindings to automate tasks, as gpg command line can be sometimes a bit confusing and ambiguous.
E.g. this is how to purge revoked keys after gpg --refresh-keys
:
#!/usr/bin/env python3
import gnupg
if __name__ == "__main__":
gpg = gnupg.GPG()
keys = gpg.list_keys(True)
for k in keys:
info_db = k['subkey_info']
for subk in k['subkeys']:
info = info_db[subk[0]]
if info['trust'] == 'r':
fp = subk[2]
print(f"{fp} {gpg.delete_keys(fp, expect_passphrase=False, exclamation_mode=True)}")
Definitely worth of trouble because I’m super-talented on making destructive mistakes with command-line arguments :-)
I made enc a while ago, which is gnupg but modern and friendly:
It is 100% compatible with gnupg, and the keys are just files. My goal was to make cryptography simple and approachable for everyone.
@orsinium So I did look into it a bit and if I got the right understanding it has its own backing storage thing.
So my thought are that:
I.e. if I have a fresh GNOME desktop it already has gpg-agent ongoing with zero configuration (thanks to systemd). So by all practical means the backend side is sort of almost defacto standard.