refactor(IRSACryptographer): Init-Methode, Verzeichnis- und Dateinamen-Getter-Setter hinzugefügt
This commit is contained in:
parent
38bd23d012
commit
fa5d0f1b26
@ -8,8 +8,14 @@ namespace DigitalData.Core.Abstractions.Security
|
|||||||
|
|
||||||
public RSAEncryptionPadding Padding { get; init; }
|
public RSAEncryptionPadding Padding { get; init; }
|
||||||
|
|
||||||
|
public string? Directory { get; set; }
|
||||||
|
|
||||||
|
public string? FileName { get; set; }
|
||||||
|
|
||||||
public string Issuer { get; init; }
|
public string Issuer { get; init; }
|
||||||
|
|
||||||
public string Audience { get; init; }
|
public string Audience { get; init; }
|
||||||
|
|
||||||
|
public void Init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -8,5 +8,19 @@ namespace DigitalData.Core.Security.Config
|
|||||||
public IEnumerable<IRSADecryptor> Decryptors { get; init; } = new List<IRSADecryptor>();
|
public IEnumerable<IRSADecryptor> Decryptors { get; init; } = new List<IRSADecryptor>();
|
||||||
|
|
||||||
public IEnumerable<IRSAEncryptor> Encryptors { get; init; } = new List<IRSAEncryptor>();
|
public IEnumerable<IRSAEncryptor> Encryptors { get; init; } = new List<IRSAEncryptor>();
|
||||||
|
|
||||||
|
public override void OnDeserialized()
|
||||||
|
{
|
||||||
|
base.OnDeserialized();
|
||||||
|
|
||||||
|
foreach (var decryptor in Decryptors)
|
||||||
|
{
|
||||||
|
// set default path
|
||||||
|
if(decryptor.Pem is null && decryptor.FileName is null)
|
||||||
|
dec
|
||||||
|
|
||||||
|
decryptor.Init();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -14,9 +14,9 @@ namespace DigitalData.Core.Security.Cryptographer
|
|||||||
init => _pem = value;
|
init => _pem = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string? PemPath => FileName is null ? null : Path.Combine(Directory, FileName);
|
public string? PemPath => FileName is null ? null : Path.Combine(Directory ?? string.Empty, FileName);
|
||||||
|
|
||||||
public string Directory { get; set; } = string.Empty;
|
public string? Directory { get; set; }
|
||||||
|
|
||||||
public string? FileName { get; set; }
|
public string? FileName { get; set; }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user