示例#1
0
        public static AccountStoreData Create(Login[] logins, string password)
        {
            var data = new AccountStoreData(logins);

            data.DecryptionProof = StringCipher.Encrypt(PROOF_PHRASE, password);
            return(data);
        }
示例#2
0
        public static AccountStoreData Restore(Login[] logins, string encryptedProof)
        {
            var data = new AccountStoreData(logins);

            data.DecryptionProof = encryptedProof;
            return(data);
        }
示例#3
0
        public AccountStore(string masterPassword, AccountStoreData data)
        {
            _MasterPassword = masterPassword;
            SaveData        = data ?? throw new ArgumentNullException();

            if (!data.IsPasswordCorrect(masterPassword))
            {
                throw new ArgumentException("Master password incorrect.");
            }
        }