title: How can i write in the "Enterprise Trust" Store?
body: <p>I have a .p7b file with a few certificates and i want to install them in the "Enterprise Trust" Store. A program i want to use expects it there. </p>
  
  <p>I have writte code in c# which extract all the certificates from the file and installs them into a X509Store ("Storename.My") which works.</p>
  
  <p>If i try to use the same code to write in a different store it (which already exists) it creates a new empty store and writes in there.</p>
  
  <p>The StoreName.My is taken from system.Security.Cryptography.X509Certificates public enum StoreName, but there is no option for the "Enterprise Trust" store.
  So i tried to use the constructor where i can give the StoreName as a string.</p>
  
  <p>I use the certmgr from windows to check what certificats are stored in which stores.</p>
  
  <pre><code>// open file
  var certificateStore = new CmsSignedData(new 
  FileStream(_tempFileName.ToString(), FileMode.Open));
  
  // get all certificats
  IX509Store x509Certs = certificateStore.GetCertificates("Collection");
  var a = new ArrayList(x509Certs.GetMatches(null));
  
  // this works
  var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); 
  
  // this doesnt work
  // var store = new X509Store("Enterprise Trust", StoreLocation.CurrentUser);
  
  // open store
  store.Open(OpenFlags.ReadWrite);
  
  // write in store
  foreach (object o in a) {
      var cert = (Org.BouncyCastle.X509.X509Certificate)o;
      var cert509 = new X509Certificate2();
      cert509.Import(cert.GetEncoded());
      store.Add(cert509);
  }
  store.Close();
  </code></pre>
  
  <p>How do i write correctly in the a store which isnt the StoreName enum? </p>