【发布时间】:2015-02-28 04:47:25
【问题描述】:
我必须使用存储在安全令牌中的证书。我可以从 Windows 证书存储区访问它,但该设备有密码,因此会显示一个带有输入字段的弹出窗口。
这是我用来加载证书的代码:
static X509Certificate2 BuscarCertificado
(StoreLocation location, StoreName name,
X509FindType findType, string findValue)
{
X509Store store = new X509Store(name, location);
try{
store.Open(OpenFlags.ReadOnly);
X509Certificate2Collection col = store.Certificates.Find
(findType, findValue, true);
return col[0];
}
finally { store.Close(); }
}
设备是 ACS CryptoMate64 0。
是否可以在代码中发送密码以不显示此消息?
感谢您的帮助
【问题讨论】:
-
不,不可能。
-
@CryptoGuy 这是一个有趣的理论,但你能证明它吗?
-
请忽略我的评论。 Pepo 的代码应该适合你。不过,它需要将 PIN 码存储在代码中的某处(不推荐)
标签: c# asp.net-mvc-5 x509certificate2