Problems with X509Store Certificates.Find FindByThumbprint

后端 未结 14 2088
醉话见心
醉话见心 2020-12-04 20:56

I\'m having a problem when I use the method X509Store.Certificates.Find

public static X509Certificate2 FromStore(StoreName storeName, 
                  


        
14条回答
  •  一整个雨季
    2020-12-04 21:09

    I had the same Problem and solved it:

    1. I copied the Fingerprint from mmc directly to VS. I compared the strings and didn't find any difference.

    2. Checking the length with hash.length, there was a difference, 41 vs. 40.

    There is an invisible Char added to the string by copying it out of mmc.


    Solving:

    1. copy the Fingerprint from mmc to Notepad.exe
    2. copy this string again
    3. paste to your code

    It's working.

提交回复
热议问题