I tested Gpg4win v3.1.10 on Windows 10.
When generating a new key on a smartcard, Kleopatra presents a drop-down box of available RSA key sizes. The "4096" option is gated behind an incorrect version check, checking that the OpenPGP smartcard's version is exactly "2.1":
mIs21 = version == QLatin1String("2.1");
sizes.push_back(1024); sizes.push_back(2048); sizes.push_back(3072); // There is probably a better way to check for capabilities if (mIs21) { sizes.push_back(4096); }
This means the option doesn't show up on smartcards implementing later versions of the OpenPGP on ISO Smart Card spec, which is up to version 3.4. This affects the latest YubiKey 5, which reports version 3.4.
STEPS TO REPRODUCE
- Open Kleopatra
- Insert YubiKey 5
- Select 'Manage Smartcards' from menu
- Click "Generate new Keys" button
- Observe "4096" is missing from drop-down
I cross-posted this to the KDE bug tracker, but it was reported to us in regards to Gpg4win: https://bugs.kde.org/show_bug.cgi?id=411849