Windows TPM 虚拟智能卡 RSA 密钥存储

Windows TPM Virtual Smart Card RSA Key Storage

本文关键字:密钥 存储 RSA 智能卡 TPM 虚拟 Windows      更新时间:2023-10-16

1( 嗨,我想知道是否可以使用虚拟智能卡来存储我正在设计的应用程序的 RSA 密钥对。到目前为止,我只能找到登录方面的文档,但没有标准智能卡加密存储的文档。我尝试将旧的CSPParameter用于智能卡,但无济于事。下面的代码将执行,但操作系统将声明虚拟智能卡对此操作无效。

SecureString pwd;
char[] scPwd = { '1', '2', '3', '4', '5','6','7','8' };
fixed(char* pChars = scPwd)       
{   
    pwd = new SecureString(pChars, scPwd.Length);       
} 
CspParameters csp = 
    new CspParameters(1, 
        "Microsoft Base Smart Card Crypto Provider",
        "Codeproject_1",
        new System.Security.AccessControl.CryptoKeySecurity(),
        pwd);

RSACryptoServiceProvider rsaCsp = (new RSACryptoServiceProvider(4096,csp( { PersistKeyInCsp = true });

测试

卡的命令行测试:

tpmvscmgr.exe create /name test /pin default /adminkey random /generate

2( 如果可以,是否可以公开用户 PIN 码,并且不可导出的密钥仍然不可导出?

在执行创建虚拟智能卡的命令之前,您是否尝试以管理员身份打开终端?