Adds the ability to create key files (no entropy generator for now)

This commit is contained in:
BONNEVILLE Geoffroy
2017-11-17 10:20:54 +01:00
parent 3089609c19
commit 5273a25385
5 changed files with 27 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using Windows.Storage.Pickers;
using Windows.System;
using Windows.UI.Xaml;
@@ -81,5 +82,20 @@ namespace ModernKeePass.Controls
if (file == null) return;
Model.KeyFile = file;
}
private async void CreateKeyFileButton_Click(object sender, RoutedEventArgs e)
{
var savePicker = new FileSavePicker
{
SuggestedStartLocation = PickerLocationId.DocumentsLibrary,
SuggestedFileName = "Key"
};
savePicker.FileTypeChoices.Add("Key file", new List<string> { ".key" });
var file = await savePicker.PickSaveFileAsync();
if (file == null) return;
Model.CreateKeyFile(file);
}
}
}