private static string GetDirectoryName(string storeName)
{
Debug.Assert(storeName != null);
try
{
string fileName = Path.GetFileName(storeName);
if (!StringComparer.Ordinal.Equals(storeName, fileName))
{
throw new CryptographicException(SR.Format(SR.Security_InvalidValue, nameof(storeName)));
}
}
catch (IOException e)
{
throw new CryptographicException(e.Message, e);
}
return storeName.ToLowerInvariant();
}