public X509Store(StoreName storeName, StoreLocation storeLocation)
{
if (storeLocation != StoreLocation.CurrentUser && storeLocation != StoreLocation.LocalMachine)
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, SR.Arg_EnumIllegalVal, nameof(storeLocation)));
switch (storeName)
{
case StoreName.AddressBook:
Name = "AddressBook";
break;
case StoreName.AuthRoot:
Name = "AuthRoot";
break;
case StoreName.CertificateAuthority:
Name = "CA";
break;
case StoreName.Disallowed:
Name = "Disallowed";
break;
case StoreName.My:
Name = "My";
break;
case StoreName.Root:
Name = "Root";
break;
case StoreName.TrustedPeople:
Name = "TrustedPeople";
break;
case StoreName.TrustedPublisher:
Name = "TrustedPublisher";
break;
default:
throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, SR.Arg_EnumIllegalVal, nameof(storeName)));
}
Location = storeLocation;
}