public void AddPassword(UserPassPair userpass) { _bank.Add(userpass); }
public bool LoadPasswordsFromBulkList(byte[] list) { _bank.Clear(); UserPassPair userpass = new UserPassPair(); string temp = string.Empty; bool confirmed = false; bool username = true; //True = Username, False = Password foreach (byte b in list) { if (b == 0) { if (confirmed) { if (username) { userpass.Username = temp; temp = ""; username = false; } else { userpass.Password = temp; temp = ""; _bank.Add(userpass); username = true; } } else { //If decryption confimartion fails, return false if (temp != Properties.Resources.DECRYPTION_CONFIRMED) { return false; } //If decryption confirmation succeeds, continue loading passwords confirmed = true; temp = ""; } } else { temp += (char)b; } } return true; }