Trying to reproduce T3187 I noticed that I cannot add a subkey to a key with the primary key residing on the card:
sec rsa2048/3E56B63B8CC487F8
created: 2017-07-17 expires: 2018-07-17 usage: C
card-no: 0006 04250529
trust: ultimate validity: ultimate
[ultimate] (1). cert on card <cert-on-card@example.org>
gpg> addkey
Secret parts of primary key are stored on-card.
Please select what kind of key you want:
(3) DSA (sign only)
(4) RSA (sign only)
(5) Elgamal (encrypt only)
(6) RSA (encrypt only)
Your selection? 4
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048)
Requested keysize is 2048 bits
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0) 1y
Key expires at Tue 17 Jul 2018 12:15:19 PM CEST
Is this correct? (y/N) y
Really create? (y/N) y
gpg: Key generation failed: Not implemented
gpg>The log reveals:
5 - 12:15:11 gpg-agent[2621]: DBG: chan_10 <- HAVEKEY F143C29C748EB826478472CC24115DE57D42EAA8 5 - 12:15:11 gpg-agent[2621]: DBG: chan_10 -> OK 5 - 12:15:11 gpg-agent[2621]: DBG: chan_10 <- KEYINFO F143C29C748EB826478472CC24115DE57D42EAA8 5 - 12:15:11 gpg-agent[2621]: DBG: chan_10 -> S KEYINFO F143C29C748EB826478472CC24115DE57D42EAA8 T D2760001240102010006042505290000 OPENPGP.1 - - - - - 5 - 12:15:11 gpg-agent[2621]: DBG: chan_10 -> OK 5 - 12:15:13 gpg-agent[2621]: DBG: chan_10 <- KEYINFO F143C29C748EB826478472CC24115DE57D42EAA8 5 - 12:15:13 gpg-agent[2621]: DBG: chan_10 -> S KEYINFO F143C29C748EB826478472CC24115DE57D42EAA8 T D2760001240102010006042505290000 OPENPGP.1 - - - - - 5 - 12:15:13 gpg-agent[2621]: DBG: chan_10 -> OK 5 - 12:15:20 gpg-agent[2621]: DBG: chan_10 <- SETKEYDESC Please+enter+the+passphrase+to+unlock+the+OpenPGP+secret+key:%0A%22cert+on+card+<cert-on-card@example.org>%22%0A2048-bit+RSA+key,+ID+3E56B63B8CC487F8,%0Acreated+2017-07-17.%0A 5 - 12:15:20 gpg-agent[2621]: DBG: chan_10 -> OK 5 - 12:15:20 gpg-agent[2621]: DBG: chan_10 <- PASSWD --verify F143C29C748EB826478472CC24115DE57D42EAA8 5 - 12:15:20 gpg-agent[2621]: changing a smartcard PIN is not yet supported 5 - 12:15:20 gpg-agent[2621]: command 'PASSWD' failed: Not implemented 5 - 12:15:20 gpg-agent[2621]: DBG: chan_10 -> ERR 67108933 Not implemented <GPG Agent>