This particular problem makes it very hard to have a master key and subkeys in
two different smartcards.
The problem has been very well explained here:
And I was able to use the work-around with gpgsplit.
But just to sum up the problem: when you have a card A with the master key and a
card B with subkeys, and when you want to use it on a computer where you did not
create the key, gpg will create the proper stubs for the keys available on the
first card that you use but once you want to use the key on the other card, it
will just fail with something like this:
gpg: secret key parts are not available
gpg: skipped "KEYID": Unusable secret key
gpg: [stdin]: clearsign failed: Unusable secret key
And with gpg -K you will see something like this:
sec> 4096R/F2AC729A créé : 2009-05-07 expire : jamais
nº de carte : 0005 00001F2D
ssb# 2048R/71F23DEE créé : 2009-05-07 expire : jamais
ssb# 2048R/EBC29AB9 créé : 2009-05-07 expire : 2015-11-20
ssb# 2048R/169CA386 créé : 2013-11-20 expire : 2015-11-20
Here I inserted the card of the master key first.
So in the end, what I want to say is that "gpg2 --card-status" (or "gpg2
--card-edit" followed by "fetch") should always upgrade available private keys
from "unusable private key" into a proper key usable with the current smartcard...