Using X509Certificate2 to get PrivateKey causes CryptographicException “Invalid provider type specified”

前端 未结 2 1246
感动是毒
感动是毒 2021-01-18 12:23

everyone,

I am developing a web application that uses X509Certificate2 to get a private key from a certification file. Code snippet looks like following:

<         


        
2条回答
  •  渐次进展
    2021-01-18 13:05

    I have been having the same problem and this is what I did to solve it. Hopefully this will help you too.

    We had to set Load User Profile to True in the app pools advanced settings

    You can also set it in the web.config I believe.

    https://blogs.msdn.microsoft.com/vijaysk/2009/03/08/iis-7-tip-3-you-can-now-load-the-user-profile-of-the-application-pool-identity/

提交回复
热议问题