Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有证书从智能卡导入我的证书存储
我想检查(c# 代码)证书是否处于活动状态,即读卡器中的智能卡是否与我的证书相对应
我手头没有智能卡读卡器,但我记得当您尝试访问私钥时(例如,尝试签名或解密时)来自 CSP 的 UI 会弹出,要求您插入正确的卡和/或提供密码. 如果您使用不同的卡(因此证书/私钥不匹配),则操作将失败(我的猜测是将抛出 CryptographicException)。我还没有听说过查询智能卡的通用方法(这当然并不意味着没有)。