Unable to get gpg-preset-passphrase working with gpg2 + gpg-agent in Ubuntu Xenial

Peter Lebbing peter at digitalbrains.com
Thu Aug 16 18:31:19 CEST 2018


gpg-preset-passphrase wants a keygrip, not a key fingerprint. To get the 
keygrip for a specific key, use f.e.:

--8<---------------cut here---------------start------------->8---
$ gpg --with-keygrip -k 211601B877A3395Apub   rsa1024 2012-03-17 [SC] [expires: 2018-08-23]
      825472F37172B95ADC7349BE98B67DE4DCDFDFA4
      Keygrip = 2F677680CA15F6F7B963AF35822E8EC01FBF840A
uid           [  full  ] Test Teststra <test at work.invalid>
uid           [  full  ] Test Teststra (Koning van Wezel) <test at example.invalid>
sub   rsa1024 2012-03-17 [E]
      Keygrip = 15CB764B81D542CF921978CA89910C69D53F4E2D
sub   rsa2048 2016-01-12 [A]
      Keygrip = 3D88DC9D60F791821AF8D537EEAC3C8DF7720D63
--8<---------------cut here---------------end--------------->8---

Or for machine-parseable output, f.e.:

--8<---------------cut here---------------start------------->8---
$ gpg --batch --with-colons --with-keygrip -k 211601B877A3395Atru::7:1534436270:1537177125
pub:f:1024:1:98B67DE4DCDFDFA4:1331982780:1535041047::n:::scESCA:::::::
fpr:::::::::825472F37172B95ADC7349BE98B67DE4DCDFDFA4:
grp:::::::::2F677680CA15F6F7B963AF35822E8EC01FBF840A:
uid:f::::1534436249::A57955B7E1CD67534EBEB1E2F56C1FA882CDDE44::Test Teststra <test at work.invalid>:
uid:f::::1534436247::B56114536967B4C81D29D6942712F43E831224A5::Test Teststra (Koning van Wezel) <test at example.invalid>:
sub:f:1024:1:211601B877A3395A:1331982780::::::e::::::
fpr:::::::::9A40F128868A76CF92320458211601B877A3395A:
grp:::::::::15CB764B81D542CF921978CA89910C69D53F4E2D:
sub:f:2048:1:0BF68DE438EF7410:1452622346::::::a::::::
fpr:::::::::029CE2AB6B2E28D10BF9E7140BF68DE438EF7410:
grp:::::::::3D88DC9D60F791821AF8D537EEAC3C8DF7720D63:
sub:e:1024:1:24FE6FCFC9685297:1490208195:1490812995:::::s::::::
fpr:::::::::39F1AE29CE8B6C313CEE723E24FE6FCFC9685297:
grp:::::::::B93CA4F1A44FAD92D45DC836DEC653769421E703:
--8<---------------cut here---------------end--------------->8---

Scan lines up to the signing subkey, and take the grp-record that 
follows the signing subkey. See doc/DETAILS for details about the 
format.

preset-passphrase works on individual keys, if you need to preset both 
encryption and signature keys, use it once for each keygrip.

By the way, the GnuPG 2.1 in Ubuntu 16.04 hasn't been updated in almost 
two years. I don't feel comfortable with it, and I would consider 
alternatives.

HTH,

Peter.

-- 
I use the GNU Privacy Guard (GnuPG) in combination with Enigmail.
You can send me encrypted mail if you want some privacy.
My key is available at <http://digitalbrains.com/2012/openpgp-key-peter>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20180816/2288727e/attachment-0001.sig>


More information about the Gnupg-users mailing list