Well, it may have been fixed, but I can't test it as it actually stopped working for me.
I haven't tried remoting in a few weeks now and I was setting up a new machine. Today I went to test it and I can't get Windows to behave with my Yubikey.
So, nothing has changed with the Yubikey - it still has the same self-signed cert in the authentication slot. At first, I thought it's the new machine, but I've just checked with the old machine where this used to work and I get the same result.
In short, on the machine where it used to work, I performed these steps:
1. Delete the cert from Cert:\CurrentUser\My\ (it was there previously).
2. Plug in Yubikey - the certificate appears in the store.
3. Run the code from my original post - get the message along the lines "The smart card cannot perform this action.. ". I didn't get the entire message, because I can't repeat it (read on
4. Unplug Yubikey and delete the certificate again.
5. Plugin Yubikey - the certificate does not reappear in the certificate store. Rebooting doesn't help, cussing at it doesn't help.
I can't get it to work on the new machine, either (both machines run Win10 Pro with latest updates).
If I import the certificate from the PFX file and not use Yubikey, everything works as expected.
Is there something I need to do with Yubikey?