【问题标题】:CSP not detecting smart card minidriver C#CSP 未检测到智能卡微型驱动程序 C#
【发布时间】:2012-12-06 12:07:40
【问题描述】:

我正在使用智能卡编写一个用于加密目的的小程序,但我的迷你驱动程序有问题。当我启动程序时,我可以看到卡(出现选择智能卡的弹出对话框)但由于以下原因我无法使用它:

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# 代码非常简单,如下所示:

CspParameters csp = new CspParameters(
        1,
        "Microsoft Base Smart Card Crypto Provider",
        "my_container"
);
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(csp);

请注意,我有另一个应用程序(金雅拓微型驱动程序管理器)可以识别此微型驱动程序,因此问题不存在。

提前致谢

更新

为了让 CSP 识别智能卡,您需要告诉它使用默认密钥容器。只需在创建 RSACryptoServiceProvider 之前添加下一行:

csp.Flags = CspProviderFlags.UseDefaultKeyContainer;

【问题讨论】:

  • 如果没有关于金雅拓软件的复杂知识,我认为无法以当前格式回答这个问题。您可能需要联系金雅拓。
  • 我怀疑他们会分享有关他们软件的详细信息,但我会尝试

标签: c# .net cryptography smartcard


【解决方案1】:

检查微型驱动程序是否以 32 位和 64 位模式安装。 在 64 位上,微型驱动程序及其配置(在 calais 数据库中)必须同时设置为 32 位和 64 位模式。

【讨论】:

  • 我解决了这个问题,我更新了我的帖子以供将来参考。还是谢谢
猜你喜欢
  • 2023-04-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-02-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多