static string GetKeyFileDirectory(string keyFileName) { string folderPath = CrossPlatform.GetCommonApplicationDataFolderPath(); string text = Path.Combine(folderPath, "Microsoft", "Crypto", "RSA", "MachineKeys"); string[] array = Directory.GetFiles(text, keyFileName); string result; if (array.Length <= 0) { string folderPath2 = CrossPlatform.GetApplicationDataFolderPath(); string path = Path.Combine(folderPath2, "Microsoft", "Crypto", "RSA"); array = Directory.GetDirectories(path); if (array.Length > 0) { string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string text2 = array2[i]; array = Directory.GetFiles(text2, keyFileName); if (array.Length != 0) { result = text2; return(result); } } } throw new InvalidOperationException("Unable to locate private key file directory"); } result = text; return(result); }