I have a key with several expired subkeys and two valid ones - one for signing
and one for encryption. When I try to encrypt to that user, it works *unless* I
use batch mode. There is only one valid encryption subkey, so gnupg should have
no problem selecting the subkey to use:
pub 2048R/553C5D65 created: 2006-03-17 expires: never usage: SC trust: unknown validity: unknown sub 1600R/DDA71F97 created: 2006-03-17 expired: 2008-03-16 usage: S sub 2048g/BB63B574 created: 2006-03-17 expired: 2007-03-17 usage: E sub 2048g/A01686AC created: 2007-03-09 expired: 2008-03-08 usage: E sub 2048g/65DCC6A8 created: 2008-03-08 expires: 2010-03-08 usage: E sub 1600R/24938ED4 created: 2008-03-08 expires: 2010-03-08 usage: S
This works:
gpg -e -r 553C5D65 /tmp/test
But this doesn't:
gpg --batch --yes -e -r 553C5D65 /tmp/test
and fails with:
gpg: /tmp/test: encryption failed: unusable public key
Clearly the encryption key is not unusable, so this appears to be a bug.
The users' pubkey is attached.