using DigitalData.Core.Security.Cryptographer;
namespace DigitalData.Core.Security.Config
{
public class AsymCryptParams : RSAFactoryParams
{
public string PemDirectory { get; init; } = string.Empty;
///
/// Represents the separator used to concatenate the components of a file-related token string.
///
///
/// The resulting file-related token string is constructed as follows:
/// string.Join(FileNameSeparator, Issuer, Audience, Secret_version).
/// If Secret_version is not null, it will be included in the concatenation.
///
///
/// For example, if FileNameSeparator = "_-_", the output might look like:
/// "Issuer_-_Audience_-_Secret_version".
///
public string FileNameSeparator { get; init; } = "_-_";
///
/// Represents the separator used to concatenate the components of a key-related token string.
///
///
/// The resulting key-related token string is constructed as follows:
/// string.Join(KeyNameSeparator, Issuer, Audience, Secret_version).
/// If Secret_version is not null, it will be included in the concatenation.
///
///
/// For example, if KeyNameSeparator = ":", the output might look like:
/// "Issuer:Audience:Secret_version".
///
public string KeyNameSeparator { get; init; } = ":";
public IEnumerable Decryptors { get; init; } = new List();
public override void OnDeserialized()
{
base.OnDeserialized();
// Create root folder if it does not exist
if (!Directory.Exists(PemDirectory))
Directory.CreateDirectory(PemDirectory);
foreach (var decryptor in Decryptors)
{
// set default path
if (decryptor.IsPemNull)
{
var file_name_params = new List