A lot of works different areas... no plan
This commit is contained in:
parent
087f8ce0e9
commit
1aea1e894a
16 changed files with 1433 additions and 131 deletions
27
Core/MultiKeyEncryption/MasterKey.cs
Normal file
27
Core/MultiKeyEncryption/MasterKey.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
namespace Core.CryptoService
|
||||
{
|
||||
internal class MasterKey
|
||||
{
|
||||
public async Task RotateMasterKey(int tenantId, string oldMasterKey, string newMasterKey)
|
||||
{
|
||||
// Hent alle bruger-keys for tenant
|
||||
//var users = await GetTenantUsers(tenantId);
|
||||
|
||||
//// Dekrypter connection string med gammel master key
|
||||
//var connString = DecryptWithKey(encryptedConnString, oldMasterKey);
|
||||
|
||||
//// Krypter med ny master key
|
||||
//var newEncryptedConnString = EncryptWithKey(connString, newMasterKey);
|
||||
|
||||
//// Re-krypter master key for alle brugere
|
||||
//foreach (var user in users)
|
||||
//{
|
||||
// var userKey = DeriveKeyFromPassword(user.Password);
|
||||
// var newEncryptedMasterKey = EncryptWithKey(newMasterKey, userKey);
|
||||
// await UpdateUserMasterKey(user.UserId, newEncryptedMasterKey);
|
||||
//}
|
||||
|
||||
//await UpdateTenantConnectionString(tenantId, newEncryptedConnString);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue