How can I choose a secret key for decryption?

David Shaw dshaw at jabberwocky.com
Wed Sep 24 21:16:15 CEST 2008


On Wed, Sep 24, 2008 at 03:09:43PM +0200, Fabian Neumann wrote:
> Hi,
> 
> I have two key pairs: one personal, one business. I encrypt a file to
> both recipients (aka self): "... -r KEY1 -r KEY2 ...".
> 
> Problem:
> When decrypting the file, gpg always asks for the KEY1 passphrase. How
> can I instead choose which key to use for decryption?
> 
> Just imagine I forget the passphrase for KEY1 but still have the secret
> key around (and do not want to revoke it, because I'm confident to
> remember the passphrase later). Can it be that gpg won't let me use KEY2
> to decrypt?

No.  GPG is just trying the secret keys in order.  If you want to
force KEY2 to be used for decryption and you are prompted for KEY1,
just hit enter for the passphrase until GPG gives up and prompts for
KEY2.

David



More information about the Gnupg-users mailing list