AsmaaFathy-0148 avatar image
0 Votes"
AsmaaFathy-0148 asked TimonYang-MSFT edited

Clear Smart Card Pin Cache using Cryptography Next Generation API

I used to use CryptSetProvParam function from Crypto API to clear smart card pin cache, but this function and its API is now deprecated and it's recommended to use Cryptography Next Generation APIs instead.

So what's the replacement of CryptSetProvParam?

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Are you programming in c# or c++?
By the way, I have some doubts whether there will be a class with exactly the same function as CryptSetProvParam.

1 Vote 1 ·

I'm programming in C#, calling functions from c++ like this

[DllImport("Advapi32.dll", SetLastError = true)]
private static extern bool CryptSetProvParam(IntPtr hProv, uint dwParam, IntPtr pvData, uint dwFlags);

0 Votes 0 ·

I did not find a function in CNG that is very similar to CryptSetProvParam.
It is possible that CNG provides some new methods to clear the pin cache.
I suggest you can ask this question on StackOverflow, maybe you can get more expert opinions.

0 Votes 0 ·

0 Answers