I got a new smartcard (yubikey neo) and generated a new signing key on it. so now my public key mentions both the old one and the new one:
pub rsa3072/B50A93EA 2015-08-13 [expires: 2018-08-12]
uid [ unknown] Arthur Ulfeldt <[email protected]>
sub rsa2048/6EE4E07A 2015-08-13 [expires: 2018-08-12]
sub rsa2048/BC4C4B6C 2015-08-13 [expires: 2018-08-12] # <-- new key
sub rsa2048/67E40B89 2015-08-13 [expires: 2018-08-12]
sub rsa2048/91FF2F99 2015-08-16 [expires: 2018-08-15] # <-- old key
sub rsa2048/3157DA5D 2015-08-16 [expires: 2018-08-15]
and gpg -K shows which ones I have the private keys for:
sec# rsa3072/B50A93EA 2015-08-13 [expires: 2018-08-12]
uid [ unknown] Arthur Ulfeldt <[email protected]>
ssb> rsa2048/6EE4E07A 2015-08-13 [expires: 2018-08-12]
ssb> rsa2048/BC4C4B6C 2015-08-13 [expires: 2018-08-12] # <-- new key
ssb> rsa2048/67E40B89 2015-08-13 [expires: 2018-08-12]
ssb# rsa2048/91FF2F99 2015-08-16 [expires: 2018-08-15] # <-- old key
ssb# rsa2048/3157DA5D 2015-08-16 [expires: 2018-08-15]
running gpg --clearsign -u B50A93EA --status-fd 1 --debug-all
prints this:
....
gpg: DBG: chan_5 -> KEYINFO F5B5D673F6FFFA999162D7F2F4F91750FF756F2F
gpg: DBG: chan_5 <- ERR 67108891 Not found <GPG Agent>
gpg: DBG: md debug: can't open dbgmd-00001.clearsign
...
gpg: DBG: chan_5 -> SETKEYDESC Please+enter+the+passphrase+to+unlock+the+OpenPGP+secret+key:%0A%22Arthur+Ulfeldt+<[email protected]>%22%0A2048-bit+RSA+key,+ID+91FF2F99,%0Acreated+2015-08-16+(main+key+ID+B50A93EA).%0A
gpg: DBG: chan_5 <- OK
gpg: DBG: chan_5 -> SETHASH 8 5B6489E68D...A9780A91BB6526C
gpg: DBG: chan_5 <- OK
gpg: DBG: chan_5 -> PKSIGN
gpg: DBG: chan_5 <- ERR 67108881 No secret key <GPG Agent>
gpg: signing failed: No secret key
which looks like it is using subkey 91FF2F99 to try and sign with.
gpg --card-info shows the correct keys on the card.
How can I verify that it is indeed trying to sign with the old key?
is there a way to cause it to use whatever key is actualy avalable on the smartcard that's plugged in at the moment?
PS: I'm using gpg (GnuPG) 2.1.7