Problems with X509Store Certificates.Find FindByThumbprint

后端 未结 14 2149
醉话见心
醉话见心 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:12

    I fell victim to this. Not only was there a Unicode "left-to-right" character in the Windows console snap-in display of the thumbprint, but it also had lowercase hex characters, with spaces between every two characters. The output of CertUtil also had lowercase characters, and spaces. To get a match, I had to specify the findValue as a string which has been transformed to

    1. Remove the leading special character,
    2. Remove the whitespace between character clusters,
    3. Change all the characters to uppercase.

提交回复
热议问题