feat(RSAFactory): Statische Readonly-Eigenschaft hinzugefügt, um den Standard-RSA-Schlüsselnamen-Separator zu speichern
This commit is contained in:
parent
5adc67edf2
commit
b58d4aed2f
@ -21,9 +21,13 @@ namespace DigitalData.Core.Security
|
|||||||
|
|
||||||
private static readonly Lazy<IEnumerable<string>> LazyLowerFileTags = new(() => KeyFileTags.Select(tag => tag.ToLower()));
|
private static readonly Lazy<IEnumerable<string>> LazyLowerFileTags = new(() => KeyFileTags.Select(tag => tag.ToLower()));
|
||||||
|
|
||||||
|
public static readonly string DefaultRSAKeyNameSeparator = "-_-";
|
||||||
|
|
||||||
//TODO: make the validation using regex
|
//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)
|
void ValidateForbidden(string value, string paramName)
|
||||||
{
|
{
|
||||||
if (Path.GetInvalidFileNameChars().Any(value.Contains) || LazyLowerFileTags.Value.Any(tag => value.ToLower().Contains(tag)))
|
if (Path.GetInvalidFileNameChars().Any(value.Contains) || LazyLowerFileTags.Value.Any(tag => value.ToLower().Contains(tag)))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user