wip
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user