feat(RSAFactory): Statische Readonly-Eigenschaft hinzugefügt, um den Standard-RSA-Schlüsselnamen-Separator zu speichern

This commit is contained in:
Developer 02 2024-11-20 16:43:27 +01:00
parent 5adc67edf2
commit b58d4aed2f

View File

@ -21,9 +21,13 @@ namespace DigitalData.Core.Security
private static readonly Lazy<IEnumerable<string>> LazyLowerFileTags = new(() => KeyFileTags.Select(tag => tag.ToLower()));
public static readonly string DefaultRSAKeyNameSeparator = "-_-";
//TODO: make the validation using regex
public static string DefaultRSAKeyNameFormatter(string issuer, string audience, bool isPrivate = true, Version? passwordVersion = null, string separator = "-_-")
public static string DefaultRSAKeyNameFormatter(string issuer, string audience, bool isPrivate = true, Version? passwordVersion = null, string? separator = null)
{
separator ??= DefaultRSAKeyNameSeparator;
void ValidateForbidden(string value, string paramName)
{
if (Path.GetInvalidFileNameChars().Any(value.Contains) || LazyLowerFileTags.Value.Any(tag => value.ToLower().Contains(tag)))