From 58ee1ed90c456b7c0cae9c663b20c20400c5daec Mon Sep 17 00:00:00 2001 From: Christopher Homberger Date: Sun, 8 Sep 2024 11:16:07 +0200 Subject: [PATCH] Custom rsa key for signing --- src/Runner.Server/Startup.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Runner.Server/Startup.cs b/src/Runner.Server/Startup.cs index 29ff79e4a7c..662beabc347 100644 --- a/src/Runner.Server/Startup.cs +++ b/src/Runner.Server/Startup.cs @@ -176,6 +176,11 @@ public void ConfigureServices(IServiceCollection services) services.AddSingleton(); var rsa = RSA.Create(); + var rsaSignatureKeyPath = Configuration.GetSection("Runner.Server")?.GetValue("RSASignatureKeyPath"); + if(!string.IsNullOrEmpty(rsaSignatureKeyPath)) { + var rawKey = File.ReadAllText(rsaSignatureKeyPath); + rsa.ImportFromPem(rawKey); + } AccessTokenParameter = rsa.ExportParameters(true); KeyId = Guid.NewGuid().ToString(); var auth = services.AddAuthentication(options =>