问题描述
我写了使用智能卡加密的目的一个小程序,但我有问题,我的微型驱动器。当我启动该程序,我可以看到该卡(选购智能卡出现弹出的对话框中),但我不能用它becase的以下内容:
检测到智能卡中,但不要求当前操作的人。您所使用的智能卡可能缺少必要的驱动程序软件或所需的证书。
C#$,我使用C $ c是pretty的简单,它是这样的:
CspParameters CSP =新CspParameters(
1,
Microsoft基本智能卡加密提供者,
my_container
);
的RSACryptoServiceProvider RSA =新的RSACryptoServiceProvider(CSP);
只是要注意,我有另一个应用程序(金雅拓的微型驱动程序管理器),认识到这一点微型驱动程序,所以这个问题是不存在的。
在此先感谢
更新
为了对CSP识别智能卡,你需要告诉它使用默认密钥容器。刚创建的RSACryptoServiceProvider前添加下一行:
csp.Flags = CspProviderFlags.UseDefaultKeyContainer;
检查,如果该微型驱动程序安装在32位和64位模式。在64位,微型驱动器及其配置(在加莱数据库)必须在32位和64位模式下设置。
I am writing a little program for cryptographic purposes using smart card, but I am having problem with my mini-driver. When I start the program I can see the card (popup dialog for choosing smart card appears) but I cant use it becase of the following:
A smart card was detected but is not the one required for the current operation. The smart card you are using may be missing required driver software or a required certificate.
C# code that I am using is pretty straightforward, and it goes like this:
CspParameters csp = new CspParameters(
1,
"Microsoft Base Smart Card Crypto Provider",
"my_container"
);
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(csp);
Just to note, I have another application (Gemalto minidriver manager) that recognizes this minidriver, so the problem is not there.
Thanks in advance
UPDATE
In order for CSP to recognize the smart card, you need to tell it to use default key container. Just add next line before creating RSACryptoServiceProvider:
csp.Flags = CspProviderFlags.UseDefaultKeyContainer;
Check out if the minidriver is installed in both 32 and 64 bits mode.On 64 bits, the minidriver and its configuration (in the calais database) must be set in both 32 and 64 bits mode.
这篇关于CSP未检测智能卡微型驱动器C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!