简体   繁体   English

清除 C# 中智能令牌的 Pin 缓存

[英]Clear Pin Cache for Smart Token in C#

I'm working on C# application (.Net Framework) that uses smart tokens for signing and decryption operations.我正在研究使用智能令牌进行签名和解密操作的 C# 应用程序(.Net Framework)。 I want the pin to be provided each time token is accessed.我希望每次访问令牌时都提供引脚。 I want to clear the pin cache.我想清除 pin 缓存。

I tried to use CryptSetProvParam function from Crypto API, but it fails with some models of tokens.我尝试使用 Crypto API 中的 CryptSetProvParam function,但它在某些型号的令牌上失败。

[DllImport("Advapi32.dll", SetLastError = true)]
private static extern bool CryptSetProvParam(IntPtr hProv, uint dwParam, IntPtr pvData, uint dwFlags);

I also tried to use functions in Cryptography Next Generation APIs, but it didn't work at all.我还尝试在 Cryptography Next Generation API 中使用函数,但它根本不起作用。 Is there a way to achieve that?有没有办法做到这一点?

On Windows, smartcard uses CSP (Crypto Service Provider).在 Windows 上,智能卡使用 CSP(加密服务提供商)。 CSP of some of the smart card has option to store password.某些智能卡的 CSP 具有存储密码的选项。 Thus user may have to remove that option if selected by the user.因此,如果用户选择了该选项,则用户可能必须删除该选项。 I have attached sample screen shot of Hypersecu ePass2003 Token Manager -> Settings.我附上了 Hypersecu ePass2003 令牌管理器 -> 设置的示例屏幕截图。

ePass2003 Token Driver 记住密码设置。

To cache in NetCore - Distributed caching, you can see this Microsoft Documentation Distributed Caching NetCore要在 NetCore 中缓存 - 分布式缓存,您可以查看此 Microsoft 文档Distributed Caching NetCore

You can use Redis to cache and remove as accordingly the token, see this short tutorial on how to get started with Redis on NET Core in no time.您可以使用 Redis 缓存并相应地删除令牌,请参阅此简短教程,了解如何立即在 NET Core 上开始使用 Redis。 how to get started with Redis on NET Core in no time. 如何立即开始在 NET Core 上使用 Redis。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM