summaryrefslogtreecommitdiffstats
path: root/server/src/Program.cs
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-07-10 22:22:41 +0200
committerivarlovlie <git@ivarlovlie.no>2022-07-10 22:22:41 +0200
commit1bc2e0578356a3482c827d85eb44bf86c2895a4b (patch)
tree840d791c50b1cd867a44e7b0ca1423dd0931210e /server/src/Program.cs
parent79a0c629b7d7d187ac04ad4069adfe8aa927cac3 (diff)
downloadgreatoffice-1bc2e0578356a3482c827d85eb44bf86c2895a4b.tar.xz
greatoffice-1bc2e0578356a3482c827d85eb44bf86c2895a4b.zip
feat: Encrypt data protection data with a cert
Diffstat (limited to 'server/src/Program.cs')
-rw-r--r--server/src/Program.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/src/Program.cs b/server/src/Program.cs
index 0d6b3d3..b74f348 100644
--- a/server/src/Program.cs
+++ b/server/src/Program.cs
@@ -39,6 +39,7 @@ global using IOL.GreatOffice.Api.Services;
global using IOL.GreatOffice.Api.Utilities;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
+using System.Text;
using IOL.GreatOffice.Api.Endpoints.V1;
using IOL.GreatOffice.Api.Jobs;
using Microsoft.AspNetCore.HttpOverrides;
@@ -89,11 +90,12 @@ public static class Program
options.ForwardedHeaders = ForwardedHeaders.XForwardedProto;
});
}
-
+
builder.Services
- .AddDataProtection()
- .PersistKeysToDbContext<AppDbContext>()
- .ProtectKeysWithCertificate(vaultService.Get<X509Certificate2>(""));
+ .AddDataProtection()
+ .ProtectKeysWithCertificate(configuration.CERT1())
+ .PersistKeysToDbContext<AppDbContext>();
+
builder.Services.Configure(JsonSettings.Default);
builder.Services.AddQuartz(options => {
options.UsePersistentStore(o => {