You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If what you're looking to do is reset the "I've collected the PIN" state, you can do that by
privatestaticvoidForcePinPrompt(CngKeykey){key.SetProperty(newCngProperty("SmartCardPin",Array.Empty<byte>(),CngPropertyOptions.None));}privatestaticvoidForcePinPrompt(RSAkey){if(keyisRSACngrsaCng){ForcePinPrompt(key.Key);}}
... at least for a key createdwithForceHighProtection.NormalPIN prompting seems to still be cached with that. Hm.
This is not working for me, but produces an exception with this content:
System.Security.Cryptography.CryptographicException
HResult=0x8010006B
Message=The card cannot be accessed because the wrong PIN was presented.
Source=System.Security.Cryptography
StackTrace:
at System.Security.Cryptography.CngKey.SetProperty(CngProperty property)
at Benchmark.X509Certificate2Extension.ForcePinPrompt(CngKey key) in
Do you have any idea how to fix this?
The text was updated successfully, but these errors were encountered:
From the exception message, it seems that whatever provider you're using is rejecting the empty PIN instead of clearing out the PIN-captured state... which seems like a reasonable thing for it to do.
Knowing what you can do instead would depend on what provider you're using, and there may not even be an option.
Thank you for your prompt reply, @bartonjs . Interestingly, it throws an exception, but seems to work anyhow. If I catch the exception and continue, the pin is not cached. --> I'll close this ticket.
Originally posted by @bartonjs in #79338
This is not working for me, but produces an exception with this content:
Do you have any idea how to fix this?
The text was updated successfully, but these errors were encountered: