fix(AsymCryptParams): Dateinamenerweiterung hinzugefügt.
This commit is contained in:
parent
f38bad8531
commit
b3629661a1
@ -20,6 +20,8 @@ namespace DigitalData.Core.Security.Config
|
|||||||
/// </example>
|
/// </example>
|
||||||
public string FileNameSeparator { get; init; } = "_-_";
|
public string FileNameSeparator { get; init; } = "_-_";
|
||||||
|
|
||||||
|
public string FileExtension { get; init; } = "pem";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the separator used to concatenate the components of a key-related token string.
|
/// Represents the separator used to concatenate the components of a key-related token string.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -55,7 +57,9 @@ namespace DigitalData.Core.Security.Config
|
|||||||
if (decryptor.IsEncrypted)
|
if (decryptor.IsEncrypted)
|
||||||
file_name_params.Add(Secrets.Version);
|
file_name_params.Add(Secrets.Version);
|
||||||
|
|
||||||
var path = Path.Combine(PemDirectory, string.Join(FileNameSeparator, file_name_params));
|
var file_name = $"{string.Join(FileNameSeparator, file_name_params)}.{FileExtension}";
|
||||||
|
|
||||||
|
var path = Path.Combine(PemDirectory, file_name);
|
||||||
|
|
||||||
if (File.Exists(path))
|
if (File.Exists(path))
|
||||||
decryptor.SetPem(File.ReadAllText(path));
|
decryptor.SetPem(File.ReadAllText(path));
|
||||||
@ -65,7 +69,7 @@ namespace DigitalData.Core.Security.Config
|
|||||||
? Instance.RSAFactory.CreateEncryptedPrivateKeyPem(pbeParameters: PbeParameters, keySizeInBits: KeySizeInBits, password: Secrets.PBE_PASSWORD)
|
? Instance.RSAFactory.CreateEncryptedPrivateKeyPem(pbeParameters: PbeParameters, keySizeInBits: KeySizeInBits, password: Secrets.PBE_PASSWORD)
|
||||||
: Instance.RSAFactory.CreatePrivateKeyPem(keySizeInBits: KeySizeInBits);
|
: Instance.RSAFactory.CreatePrivateKeyPem(keySizeInBits: KeySizeInBits);
|
||||||
|
|
||||||
decryptor.SetPem(File.ReadAllText(pem));
|
decryptor.SetPem(pem);
|
||||||
|
|
||||||
// Save file in background
|
// Save file in background
|
||||||
Task.Run(async () => await File.WriteAllTextAsync(path: path, pem));
|
Task.Run(async () => await File.WriteAllTextAsync(path: path, pem));
|
||||||
|
|||||||
@ -27,6 +27,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigitalData.Core.Terminal",
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.Core.Extensions", "DigitalData.Core.Extensions\DigitalData.Core.Extensions.csproj", "{FC6AD1C4-5D7C-4B50-9330-B7A0E52B24B8}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.Core.Extensions", "DigitalData.Core.Extensions\DigitalData.Core.Extensions.csproj", "{FC6AD1C4-5D7C-4B50-9330-B7A0E52B24B8}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.Core.Tests.API", "DigitalData.Core.Tests.API\DigitalData.Core.Tests.API.csproj", "{9BC2DEC5-E89D-48CC-9A51-4D94496EE4A6}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
@ -80,6 +82,10 @@ Global
|
|||||||
{FC6AD1C4-5D7C-4B50-9330-B7A0E52B24B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{FC6AD1C4-5D7C-4B50-9330-B7A0E52B24B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{FC6AD1C4-5D7C-4B50-9330-B7A0E52B24B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{FC6AD1C4-5D7C-4B50-9330-B7A0E52B24B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{FC6AD1C4-5D7C-4B50-9330-B7A0E52B24B8}.Release|Any CPU.Build.0 = Release|Any CPU
|
{FC6AD1C4-5D7C-4B50-9330-B7A0E52B24B8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{9BC2DEC5-E89D-48CC-9A51-4D94496EE4A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{9BC2DEC5-E89D-48CC-9A51-4D94496EE4A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{9BC2DEC5-E89D-48CC-9A51-4D94496EE4A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{9BC2DEC5-E89D-48CC-9A51-4D94496EE4A6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user