key selection in batch decryptions

Werner Koch wk at
Tue Oct 11 09:35:30 CEST 2011

On Mon, 10 Oct 2011 23:18, jw72253 at said:

> keys in turn.  Is there a way to tell gpg to use just one of the keys if
> any?  I have tried specifying this as one of the options "-u userID", but it

No there is no way to do this.

The best suggestion for all automated systems is not to use a
passphrase.  If you really want a passphrase and you require full
control over it you have three choices:

 - Write your own pinentry and send CANCEL back until the desired
   passphrase is requested.  Then send the right passphrase.

 - Write a simple pinentry to always send a CANCEL back (GnuPG 2.1 will
   have an option to emulate this).  The use gpg-preset-passphrase to
   seed gpg-agent with the desired passphrase.

 - Use --status-fd/--command-fd.  These options allow you to
   pass a passphrase to gpg entirely under script control.  They work
   even with GnuPG 1.4.



Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.

More information about the Gnupg-users mailing list