The Key containers of "Microsoft Base Smart Card Crypto Provider" are enumerated by setting PP_ENUMCONTAINERS flag for the function CryptGetProvParam().
The enumerated key containers are set to the CspParametrs as
private const string _providerName = "Microsoft Base Smart Card Crypto Provider"
CspParameters cspParameters = new CspParameters();
cspParameters.ProviderName = _providerName;
cspParameters.ProviderType = 1;
cspParameters.KeyContainerName = container;
cspParameters.Flags = CspProviderFlags.UseExistingKey;
using (RSACryptoServiceProvider rsaProvider = new RSACryptoServiceProvider(cspParameters))
{
pubKeyXml = rsaProvider.ToXmlString(false);
} // using
The CSP is not acquired for the exisiting key container . What is the reason that CSP is not acquired?