From bf672d8b8cc6d306680ace9fc114dd5718d69664 Mon Sep 17 00:00:00 2001 From: Developer 02 Date: Thu, 19 Dec 2024 01:53:20 +0100 Subject: [PATCH] =?UTF-8?q?feat(RSADecryptor):=20Methode=20CreateSigningCr?= =?UTF-8?q?edentials=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DigitalData.Core.Security/Cryptographer/RSADecryptor.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/DigitalData.Core.Security/Cryptographer/RSADecryptor.cs b/DigitalData.Core.Security/Cryptographer/RSADecryptor.cs index c7c9a43..d1556f4 100644 --- a/DigitalData.Core.Security/Cryptographer/RSADecryptor.cs +++ b/DigitalData.Core.Security/Cryptographer/RSADecryptor.cs @@ -1,5 +1,6 @@ using DigitalData.Core.Abstractions.Security; using DigitalData.Core.Security.Config; +using Microsoft.IdentityModel.Tokens; using System.Security.Cryptography; namespace DigitalData.Core.Security.Cryptographer @@ -59,5 +60,8 @@ namespace DigitalData.Core.Security.Cryptographer } private InvalidOperationException PemIsNullException => new($"Pem is null or empty. Issuer: {Issuer}, Audience: {Audience}."); + + public SigningCredentials CreateSigningCredentials(string algorithm = SecurityAlgorithms.RsaSha256, string? digest = null) + => digest is null ? new(RsaSecurityKey, algorithm) : new(RsaSecurityKey, algorithm, digest); } } \ No newline at end of file