Encrypt realm data with dek which is encrypted with kek. The signing keys are also encrypted with the kek.
This commit is contained in:
parent
644b005f2a
commit
650fe99990
36 changed files with 399 additions and 129 deletions
26
IdentityShroud.Core/Services/RealmContext.cs
Normal file
26
IdentityShroud.Core/Services/RealmContext.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
using IdentityShroud.Core.Contracts;
|
||||
using IdentityShroud.Core.Model;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace IdentityShroud.Core.Services;
|
||||
|
||||
public class RealmContext(
|
||||
IHttpContextAccessor accessor,
|
||||
IRealmService realmService) : IRealmContext
|
||||
{
|
||||
public Realm GetRealm()
|
||||
{
|
||||
return (Realm)accessor.HttpContext.Items["RealmEntity"];
|
||||
}
|
||||
|
||||
public async Task<IList<RealmDek>> GetDeks(CancellationToken ct = default)
|
||||
{
|
||||
Realm realm = GetRealm();
|
||||
if (realm.Deks.Count == 0)
|
||||
{
|
||||
await realmService.LoadDeks(realm);
|
||||
}
|
||||
|
||||
return realm.Deks;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue