内容简介:翻译自:https://stackoverflow.com/questions/9808667/cant-read-currentuser-certificates-from-x509store
我正在开发ASP.NET 4.0 Web应用程序,我想从X509Store读取当前用户证书.读取LocalMachine证书工作正常,但如果我将StoreLocation设置为CurrentUser,它会给我一个空集合.
以下代码工作正常:
X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine); // StoreLocation.CurrentUser store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
我已经检查了我的个人商店(通过certmgr.mmc),我确信我有证书.
我错过了什么? (store.Certificates为空)
无论您使用何种应用程序池标识,似乎无法通过Web应用程序访问个人证书存储.
这是有道理的,Web应用程序无法访问该位置.
我的解决方案
我开发了一个ActiveX控件,我认为它是访问Store的唯一方法.
(另外,Java Applet提供相同的功能).
我通过JavaScript使用ActiveX控件来访问Store,并将该信息发送到服务器.
翻译自:https://stackoverflow.com/questions/9808667/cant-read-currentuser-certificates-from-x509store
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Domain-Driven Design Distilled
Vaughn Vernon / Addison-Wesley Professional / 2016-6-2 / USD 36.99
Domain-Driven Design (DDD) software modeling delivers powerful results in practice, not just in theory, which is why developers worldwide are rapidly moving to adopt it. Now, for the first time, there......一起来看看 《Domain-Driven Design Distilled》 这本书的介绍吧!