public static AccountStoreData Create(Login[] logins, string password) { var data = new AccountStoreData(logins); data.DecryptionProof = StringCipher.Encrypt(PROOF_PHRASE, password); return(data); }
public static AccountStoreData Restore(Login[] logins, string encryptedProof) { var data = new AccountStoreData(logins); data.DecryptionProof = encryptedProof; return(data); }
public AccountStore(string masterPassword, AccountStoreData data) { _MasterPassword = masterPassword; SaveData = data ?? throw new ArgumentNullException(); if (!data.IsPasswordCorrect(masterPassword)) { throw new ArgumentException("Master password incorrect."); } }