private async void Test_Click(object sender, RoutedEventArgs e) { String Passwords = await CryptoInterface.GetPasswords(Key); Debug.WriteLine("<passwords>"); Debug.WriteLine(Passwords); Debug.WriteLine("</passwords>"); Passwords += "LINE1" + INTRASPLIT + "LINE2" + INTRASPLIT + "LINE3" + INTERSPLIT; Debug.WriteLine("ALTERED PASSWORDS"); Debug.WriteLine("<passwords>"); Debug.WriteLine(Passwords); Debug.WriteLine("</passwords>"); await CryptoInterface.StorePasswords(Passwords, Key); Debug.WriteLine("WROTE NEW PASSWORDS"); Passwords = ""; Debug.WriteLine("<clearedPasswords>"); Debug.WriteLine(Passwords); Debug.WriteLine("</clearedPasswords>"); Passwords = await CryptoInterface.GetPasswords(Key); Debug.WriteLine("READ NEW PASSWORDS"); Debug.WriteLine("<passwords>"); Debug.WriteLine(Passwords); Debug.WriteLine("</passwords>"); }
private async void InitialSetupButton_Click(object sender, RoutedEventArgs e) { String PWD = SetupAPasswordBox.Password; Debug.WriteLine(PWD); Key = CryptoInterface.GestAesKey(PWD); IBuffer X = CryptoInterface.CreateTestfile(); await StorageInterface.WriteBufferToRoamingFolder("PWM/A", X); await StorageInterface.WriteBufferToRoamingFolder("PWM/B", CryptoInterface.EncryptAes(Key, X)); await CryptoInterface.InitialSetup(Key); await CryptoInterface.StorePasswords("Dieser Passwortmanager" + INTRASPLIT + "Kein Benutzername" + INTRASPLIT + PWD + INTERSPLIT, Key); Debug.WriteLine("HAVE DONE SETUP WITH PASSWORD"); MODE_REGULAR.Visibility = MODE_REGULAR_BAR.Visibility = Visibility.Visible; MODE_LOGIN.Visibility = MODE_SETUP.Visibility = Visibility.Collapsed; await Refresh(); }
private async void StoreNewEntry(object sender, RoutedEventArgs e) { newEditOk.Click -= StoreNewEntry; newDelete.Click -= CancelNewEntry; String cumulatedData = await CryptoInterface.GetPasswords(Key); if (newUsername.Text.Equals("")) { newUsername.Text = "Kein Benutzername"; } if (newPassword.Text.Equals("")) { newPassword.Text = "Kein Passwort"; } if (newOverview.Text.Equals("")) { newOverview.Text = "Kein Name"; } cumulatedData = newOverview.Text + INTRASPLIT + newUsername.Text + INTRASPLIT + newPassword.Text + INTERSPLIT + cumulatedData; await CryptoInterface.StorePasswords(cumulatedData, Key); await Refresh(); }
private async Task SaveCurrentContents() { String contentsToSTore = ""; for (int i = 0; i < index; i++) { try { if (overview[i].Text.Equals("") && username[i].Text.Equals("") && password[i].Text.Equals("")) { continue;//alle felder leer => wurde gelöscht } if (overview[i].Text.Equals("")) { overview[i].Text = "Kein Name"; } if (username[i].Text.Equals("")) { username[i].Text = "Kein Benutzername"; } if (password[i].Text.Equals("")) { password[i].Text = "Kein Passwort"; } contentsToSTore += overview[i].Text + INTRASPLIT + username[i].Text + INTRASPLIT + password[i].Text + INTERSPLIT; } catch { //DO NOTHING THE EXCEPTION PROBABLY HAS BEEN CAUSED BECAUSE THERE WAS NO DATA SO THE REFRESH METHOD JUST SKIPPED THIS DATASET } } if (!contentsToSTore.Equals("")) { await CryptoInterface.StorePasswords(contentsToSTore, Key); } await Refresh(); }