Add code for opening vault

This commit is contained in:
TheXamlGuy
2024-05-02 23:07:47 +01:00
parent c324cf9542
commit c1613d765c
11 changed files with 54 additions and 112 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ public class VaultStorage(IContainer<VaultStorageConnection> connection,
VaultKey key)
{
connection.Set(new VaultStorageConnection($"Data Source={Path.Combine(environment.ContentRootPath, name)}" +
$".vault;Mode=ReadWriteCreate;Pooling=false;Password={Convert.ToBase64String(key.Private)}"));
$".vault;Mode=ReadWriteCreate;Pooling=false;Password={Convert.ToBase64String(key.DecryptedKey)}"));
IDbContextFactory<VaultDbContext> dbContextFactory = provider.GetRequiredService<IDbContextFactory<VaultDbContext>>();
using VaultDbContext context = await dbContextFactory.CreateDbContextAsync();