feat(RSADecryptor): Methode CreateSigningCredentials hinzugefügt

This commit is contained in:
Developer 02 2024-12-19 01:53:20 +01:00
parent ed29c9f990
commit bf672d8b8c

View File

@ -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);
}
}