feat(CryptFactory): Startprotokoll hinzugefügt, um Informationen über Core.Secrets bereitzustellen

This commit is contained in:
Developer 02 2024-11-19 20:01:54 +01:00
parent 806bc01c17
commit 1b210714fd

View File

@ -1,4 +1,5 @@
using DigitalData.Core.Abstractions.Security;
using Microsoft.Extensions.Logging;
using System.Security.Cryptography;
namespace DigitalData.Core.Security
@ -25,9 +26,11 @@ namespace DigitalData.Core.Security
public string EncryptedPrivateKeyPemLabel { get; init; } = "ENCRYPTED PRIVATE KEY";
public CryptFactory()
public CryptFactory(ILogger<CryptFactory>? logger = null)
{
_lazyPbeParameters = new(() => new PbeParameters(PbeEncryptionAlgorithm, PbeHashAlgorithmName, PbeIterationCount));
logger?.LogInformation("CryptFactory initialized. Core.Secrets version: {Version}, Created on: {CreationDate}.", Secrets.Version, Secrets.CreationDate.ToString("dd.MM.yyyy"));
}
public string CreateRSAPrivateKeyPem(int? keySizeInBits = null)