private static string Find(string filePath) { var hash = new HashSet <string>(); byte[] keyData = File.ReadAllBytes(filePath); foreach (string password in _keyFilePasswordByPath.Values) { if (hash.Contains(password)) { continue; } if (StrongNameUtils.IsPasswordValid(keyData, password)) { return(password); } hash.Add(password); } var passwordViewModel = new PKCS12PasswordViewModel(AppService.Shell, filePath); AppService.UI.ShowPKCS12Password(passwordViewModel); return(passwordViewModel.Password); }
private bool IsPasswordValid() { if (string.IsNullOrEmpty(_password)) { return(false); } if (!File.Exists(_filePath)) { return(false); } if (!StrongNameUtils.IsPasswordValid(_filePath, _password)) { return(false); } return(true); }