This commit is contained in:
TheXamlGuy
2024-05-28 17:30:40 +01:00
parent f8acc36022
commit 7765c31786
22 changed files with 80 additions and 91 deletions
+3 -2
View File
@@ -3,7 +3,7 @@ using Toolkit.Foundation;
namespace Bitvault;
public class OpenLockerHandler(LockerConfiguration configuration,
public class OpenLockerHandler(IConfigurationDescriptor<LockerConfiguration> descriptor,
ISecurityKeyFactory securityKeyFactory,
ILockerStorageFactory lockerStorageFactory) :
IHandler<ActivateEventArgs<Locker>, bool>
@@ -11,8 +11,9 @@ public class OpenLockerHandler(LockerConfiguration configuration,
public async Task<bool> Handle(ActivateEventArgs<Locker> args,
CancellationToken cancellationToken)
{
if (args.Value is Locker locker && configuration.Name is { Length: > 0 } name && locker.Password is { Length: > 0 } password)
if (args.Value is Locker locker && descriptor.Name is { Length: > 0 } name && locker.Password is { Length: > 0 } password)
{
LockerConfiguration configuration = descriptor.Value;
if (configuration.Key?.Split(':') is { Length: >= 2 } keyPart)
{
byte[]? salt = Convert.FromBase64String(keyPart[0]);