mirror of
https://github.com/bitwarden/mobile
synced 2025-12-18 09:13:15 +00:00
[PM-2713] more conversions to new crypto service api
This commit is contained in:
@@ -1193,23 +1193,6 @@ namespace Bit.Core.Services
|
||||
}
|
||||
|
||||
|
||||
public async Task<SymmetricCryptoKey> MakeKeyFromPinAsync(string pin, string salt,
|
||||
KdfConfig config, EncString protectedKeyCs = null)
|
||||
{
|
||||
if (protectedKeyCs == null)
|
||||
{
|
||||
var pinProtectedKey = await _stateService.GetPinProtectedAsync();
|
||||
if (pinProtectedKey == null)
|
||||
{
|
||||
throw new Exception("No PIN protected key found.");
|
||||
}
|
||||
protectedKeyCs = new EncString(pinProtectedKey);
|
||||
}
|
||||
var pinKey = await MakePinKeyAsync(pin, salt, config);
|
||||
var decKey = await DecryptToBytesAsync(protectedKeyCs, pinKey);
|
||||
return new SymmetricCryptoKey(decKey);
|
||||
}
|
||||
|
||||
// TODO(Jake): This isn't used, delete
|
||||
public async Task<Tuple<EncString, SymmetricCryptoKey>> MakeShareKeyAsync()
|
||||
{
|
||||
@@ -1230,16 +1213,5 @@ namespace Bit.Core.Services
|
||||
return await BuildProtectedSymmetricKey<SymmetricCryptoKey>(theKey, encKey);
|
||||
}
|
||||
|
||||
public async Task<Tuple<SymmetricCryptoKey, EncString>> RemakeEncKeyAsync(SymmetricCryptoKey key)
|
||||
{
|
||||
var encKey = await GetEncKeyAsync();
|
||||
return await BuildProtectedSymmetricKey<SymmetricCryptoKey>(key, encKey.Key);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user