2017-04-06 520 views
1

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

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 =(新的RSACryptoServiceProvider(4096,CSP) { PersistKeyInCsp =真 });

命令行试验TestCard:

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

2)如果这是可能可以在用户销是公知的和非导出密钥仍然不能导出?

回答

0

你尝试执行命令来创建虚拟智能卡打开终端作为管理员,过吗?