title: CryptGetProvParam PP_ENUMCONTAINERS shows me only default certificate on smart card
body: <p>I have Gemalto.NET Smart Card.<br>
  I imported 2 certificates into it using Gemalto tools, which use <a href="http://www.sconnect.com/" rel="nofollow noreferrer">sconnect</a> (which as I suspect use Crypto API to do it when used in IE).</p>
  
  <p>When I run </p>
  
  <pre><code>certutil -key -csp "Microsoft Base Smart Card Crypto Provider"
  </code></pre>
  
  <p>I have following result</p>
  
  <blockquote>
    <p>Microsoft Base Smart Card Crypto
    Provider:<br>
    7c168bc3-dc1d-a627-c218-cd45729b42cb
    [Default Container]
        AT_KEYEXCHANGE</p>
    
    <p>badd537a-a377-431b-cbc9-8699dbe15e0e
        AT_KEYEXCHANGE</p>
    
    <p>LoadKeys returned Key does not exist.
    0x8009000d (-2146893811) CertUtil:
    -key command completed successfully.</p>
  </blockquote>
  
  <p>Now I want to find those keys in my C# program. To do it I wrote following method that should return all keys on specific smart card.</p>
  
  <pre><code>static List&lt;string&gt; EnumerateContainers(string card)
  {
      var list = new List&lt;string&gt;();
      var provider = IntPtr.Zero;
      if (!CryptAcquireContext(ref provider, @"\\.\" + card + @"\", "Microsoft Base Smart Card Crypto Provider", 1, CspProviderFlags.UseMachineKeyStore))
          Debug.WriteLine("no context for " + card);
  
      uint bufferSize = 4096;
      var container = new StringBuilder((int)bufferSize);
      uint flags = CRYPT_FIRST;
      while(CryptGetProvParam(provider, PP_ENUMCONTAINERS, container, ref bufferSize, flags))
      {
          list.Add(container.ToString());
          flags = 0;
      }
      return list;
  }
  </code></pre>
  
  <p>But my method find only the key 7c168bc3-dc1d-a627-c218-cd45729b42cb which is the default one.
  <strong>What should I do to find all keys/containers stored on the smart card ??</strong></p>
  
  <p>And Later</p>
  
  <p><strong>How can I delete those keys and import new one using C#?</strong></p>