예제 #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.");
            }
        }