initializing/unlocking key explicitely with gpg-agent
Werner Koch
wk at gnupg.org
Sat Jun 7 18:17:10 CEST 2025
On Fri, 6 Jun 2025 09:16, Michael Richardson said:
> I clearly don't want to use the pinentry, since it will do the gtk2 thing,
> which I can't interact with remotely.
There are two or there ways ways:
--8<---------------cut here---------------start------------->8---
$ gpg-connect-agent
> /let passwd abc
> /definq PASSPHRASE passwd
> preset_passphrase --inquire example-cache -1
S INQUIRE_MAXLEN 480
INQUIRE PASSPHRASE
OK
> get_passphrase example-cache X X X
OK 31323334
> # Second version using a hexified passphrase
> preset_passphrase example-cache -1 616263
OK
> get_passphrase example-cache X X X
OK 616263
>
--8<---------------cut here---------------end--------------->8---
There is also a tool which implements the above:
--8<---------------cut here---------------start------------->8---
$ /usr/local/libexec/gpg-preset-passphrase -c -P ABC example-cache
$ gpg-connect-agent 'get_passphrase example-cache X X X' /bye
OK 414243
--8<---------------cut here---------------end--------------->8---
Shalom-Salam,
Werner
--
The pioneers of a warless world are the youth that
refuse military service. - A. Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 247 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20250607/32351e54/attachment.sig>
More information about the Gnupg-users
mailing list