1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-17 16:53:26 +00:00

[PM-2713] add make user key method to crypto service

This commit is contained in:
Jacob Fink
2023-07-18 10:17:47 -04:00
parent 1e30524985
commit 5ba3fac0c0
2 changed files with 6 additions and 0 deletions

View File

@@ -51,6 +51,11 @@ namespace Bit.Core.Services
return await GetUserKeyAsync(userId) != null;
}
public async Task<UserKey> MakeUserKeyAsync()
{
return new UserKey(await _cryptoFunctionService.RandomBytesAsync(64));
}
public async Task ClearUserKeyAsync(string userId = null)
{
await _stateService.SetUserKeyAsync(null, userId);