7 changed files with 41 additions and 17 deletions
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
using System.Threading.Tasks; |
||||
using Bit.Core.Abstractions; |
||||
|
||||
namespace Bit.App.Services |
||||
{ |
||||
public abstract class BaseBiometricService : IBiometricService |
||||
{ |
||||
protected readonly IStateService _stateService; |
||||
protected readonly ICryptoService _cryptoService; |
||||
|
||||
protected BaseBiometricService(IStateService stateService, ICryptoService cryptoService) |
||||
{ |
||||
_stateService = stateService; |
||||
_cryptoService = cryptoService; |
||||
} |
||||
|
||||
public async Task<bool> CanUseBiometricsUnlockAsync() |
||||
{ |
||||
return await _cryptoService.HasEncryptedUserKeyAsync() || await _stateService.GetKeyEncryptedAsync() != null; |
||||
} |
||||
|
||||
public abstract Task<bool> IsSystemBiometricIntegrityValidAsync(string bioIntegritySrcKey = null); |
||||
public abstract Task<bool> SetupBiometricAsync(string bioIntegritySrcKey = null); |
||||
} |
||||
} |
||||
Loading…
Reference in new issue