c# – 无法从X509Store读取CurrentUser证书

栏目: ASP.NET · 发布时间: 6年前

内容简介:翻译自: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


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Single Page Web Applications

Single Page Web Applications

Michael Mikowski、Josh Powell / Manning Publications / 2013-9-30 / USD 44.99

Code for most web sites mostly runs on the server. When a user clicks on a link, the site reacts slowly because the browser sends information to the server and the server sends it back again before di......一起来看看 《Single Page Web Applications》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具