feat(Secrets): Statische Klasse Secrets erstellt, um feste Werte wie pbe password zu speichern.
- Statische Eigenschaften wie Version und Erstellungsdatum hinzugefügt, um versteckte Konstanten in der Produktion nach einem Produktionsupdate zu verfolgen.
This commit is contained in:
parent
2a9c9551b8
commit
90c73237eb
@ -11,7 +11,7 @@ namespace DigitalData.Core.Security
|
|||||||
|
|
||||||
public int KeySizeInBits { get; init; } = 2048;
|
public int KeySizeInBits { get; init; } = 2048;
|
||||||
|
|
||||||
public string PbePassword { get; init; }
|
public string PbePassword { get; init; } = Secrets.PBE_PASSWORD;
|
||||||
|
|
||||||
public PbeEncryptionAlgorithm PbeEncryptionAlgorithm { get; init; } = PbeEncryptionAlgorithm.Aes256Cbc;
|
public PbeEncryptionAlgorithm PbeEncryptionAlgorithm { get; init; } = PbeEncryptionAlgorithm.Aes256Cbc;
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ namespace DigitalData.Core.Security
|
|||||||
HashAlgorithmName? hashAlgorithmName = null,
|
HashAlgorithmName? hashAlgorithmName = null,
|
||||||
int? iterationCount = null)
|
int? iterationCount = null)
|
||||||
{
|
{
|
||||||
password ??= Password;
|
password ??= PbePassword;
|
||||||
|
|
||||||
var pbeParameters = (pbeEncryptionAlgorithm is null && hashAlgorithmName is null && iterationCount is null)
|
var pbeParameters = (pbeEncryptionAlgorithm is null && hashAlgorithmName is null && iterationCount is null)
|
||||||
? new PbeParameters(
|
? new PbeParameters(
|
||||||
|
|||||||
11
DigitalData.Core.Security/Secrets.cs
Normal file
11
DigitalData.Core.Security/Secrets.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
namespace DigitalData.Core.Security
|
||||||
|
{
|
||||||
|
public static class Secrets
|
||||||
|
{
|
||||||
|
public static readonly DateTime CreationDate = new (2024, 11, 19);
|
||||||
|
|
||||||
|
public static readonly Version Version = new (1, 0);
|
||||||
|
|
||||||
|
public static readonly string PBE_PASSWORD = "9mk@i/$QY&Mw@_--dI^ahlXpNKEtv_U-,V-46b19_-Z6-U_*89_n1_-5-r-_+_$_IY_mYQl-";
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user