Bug fixes

This commit is contained in:
TheXamlGuy
2024-07-05 21:57:01 +01:00
parent e91c03d4de
commit bc5023c8ac
28 changed files with 208 additions and 106 deletions
+2 -5
View File
@@ -5,8 +5,7 @@ using Toolkit.Foundation;
namespace Wallet;
public class WalletFactory(ISecurityKeyFactory securityKeyFactory,
IDecoratorService<SecurityKey> secureKeyStore,
IWalletStoreFactory walletStoreFactory,
IWalletDatabaseFactory walletDatabaseFactory,
IWritableConfiguration<WalletConfiguration> configuration,
IHostEnvironment environment,
IImageWriter imageWriter) :
@@ -18,9 +17,7 @@ public class WalletFactory(ISecurityKeyFactory securityKeyFactory,
{
if (securityKeyFactory.Create(Encoding.UTF8.GetBytes(password)) is SecurityKey key)
{
secureKeyStore.Set(key);
if (await walletStoreFactory.Create(name, key))
if (await walletDatabaseFactory.Create(name, Convert.ToBase64String(key.DecryptedKey)))
{
configuration.Write(args => args.Key = $"{Convert.ToBase64String(key.Salt)}:" +
$"{Convert.ToBase64String(key.EncryptedKey)}:{Convert.ToBase64String(key.DecryptedKey)}");