encyption wip

This commit is contained in:
TheXamlGuy
2024-04-29 21:42:04 +01:00
parent bfdffb2901
commit 2a4194ee22
27 changed files with 437 additions and 137 deletions
+14 -6
View File
@@ -1,7 +1,6 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
@@ -55,14 +54,25 @@ public partial class App : Application
{
args.AddServices(services =>
{
services.AddTransient<IEncryptor, AesEncryptor>();
services.AddTransient<IDecryptor, AesDecryptor>();
services.AddTransient<IPasswordHasher, PasswordHasher>();
services.AddTransient<IKeyDeriver, KeyDeriver>();
services.AddDbContextFactory<VaultDbContext>(args =>
{
args.UseSqlite();
});
services.AddDbContextFactory<VaultDbContext>();
services.AddHandler<VaultStorageHandler>();
services.AddHandler<OpenVaultHandler>();
services.AddHandler<CreateVaultStorageHandler>();
services.AddHandler<OpenVaultStorageHandler>();
services.AddTemplate<VaultNavigationViewModel, VaultNavigationView>();
services.AddTemplate<AllNavigationViewModel, AllNavigationView>();
services.AddTemplate<StarredNavigationViewModel, StarredNavigationView>();
services.AddTemplate<CategoriesNavigationViewModel, CategoriesNavigationView>();
@@ -74,15 +84,13 @@ public partial class App : Application
})!);
services.AddSingleton<IVaultHostCollection, VaultHostCollection>();
services.AddHandler<VaultHandler>();
services.AddHandler<CreateVaultHandler>();
//services.AddInitializer<VaultsInitializer>();
services.AddInitializer<VaultCollectionInitializer>();
services.AddTemplate<MainViewModel, MainView>("Main");
services.AddTemplate<VaultNavigationViewModel, VaultNavigationView>();
services.AddHandler<VaultNavigationViewModelHandler>();
services.AddTransient<FooterViewModel>();
services.AddTemplate<ManageNavigationViewModel, ManageNavigationView>();
+10 -2
View File
@@ -12,7 +12,15 @@
Margin="0,0,0,18"
Text="{Binding Name}"
Watermark="Enter vault name" />
<TextBox Margin="0,0,0,18" Watermark="Enter password" />
<TextBox Watermark="Confirm password" />
<TextBox
Margin="0,0,0,18"
Classes="revealPasswordButton"
PasswordChar="&#x25CF;"
Text="{Binding Password}"
Watermark="Enter password" />
<TextBox
Classes="revealPasswordButton"
PasswordChar="&#x25CF;"
Watermark="Confirm password" />
</StackPanel>
</ContentDialog>
+8 -5
View File
@@ -1,16 +1,19 @@
<UserControl
x:Class="Bitvault.Avalonia.LockView"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Bitvault"
x:DataType="vm:LockViewModel">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBox
Width="300"
Classes="revealPasswordButton"
PasswordChar="&#x25CF;">
PasswordChar="&#x25CF;"
Text="{Binding Password}">
<Interaction.Behaviors>
<KeyBindingTriggerBehavior Gesture="Enter">
<NavigateAction Context="Main" Route="Vault" />
</KeyBindingTriggerBehavior>
<KeyBindingTriggerBehavior Gesture="Enter">
<InvokeCommandAction Command="{Binding UnlockCommand}" />
</KeyBindingTriggerBehavior>
</Interaction.Behaviors>
</TextBox>
</StackPanel>