|
|
|
|
@ -108,7 +108,13 @@ namespace Bit.KeyConnector.Services
@@ -108,7 +108,13 @@ namespace Bit.KeyConnector.Services
|
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
var newSymmetricKey = await _cryptoFunctionService.GetRandomBytesAsync(32); |
|
|
|
|
var decodedEncKey = await RsaEncryptAsync(_symmetricKey); |
|
|
|
|
var decodedEncKey = await RsaEncryptAsync(newSymmetricKey); |
|
|
|
|
|
|
|
|
|
if (decodedEncKey == null) |
|
|
|
|
{ |
|
|
|
|
throw new Exception("RSA encryption failed. Your RSA key may not be configured properly."); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
encKey = Convert.ToBase64String(decodedEncKey); |
|
|
|
|
await _applicationDataRepository.UpdateSymmetricKeyAsync(encKey); |
|
|
|
|
|
|
|
|
|
|