1) Hi I was wondering if it is possible to use a virtual smart card to store RSA key pairs for an application I'm designing. So far i can only find documentation for the Logon aspect but none for just standard smart card crypto storage. I tried using the legacy CSPParameters for smart cards to no avail. The Code below will execute but the OS will state that the Virtual Smart card is not valid for this operation.
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 });
Command Line Test for TestCard:
tpmvscmgr.exe create /name test /pin default /adminkey random /generate
2) If this is possible can the user pin be publicly known and the non exportable keys still be not be exportable?