refactor(RSADecryptor): umbenennen in RSAPrivateKey

This commit is contained in:
Developer 02
2025-01-07 11:20:24 +01:00
parent 5e1bf16b6d
commit 4ce738957d
3 changed files with 5 additions and 5 deletions

View File

@@ -40,9 +40,9 @@ namespace DigitalData.Core.Security.Config
/// </summary> /// </summary>
public string DateTagFormat { get; init; } = "MM//2"; public string DateTagFormat { get; init; } = "MM//2";
public IEnumerable<RSADecryptor> PrivateKeys { get; init; } = new List<RSADecryptor>(); public IEnumerable<RSAPrivateKey> PrivateKeys { get; init; } = new List<RSAPrivateKey>();
public RSADecryptor? Vault { get; init; } public RSAPrivateKey? VaultPrivateKey { get; init; }
public AsymCryptParams() public AsymCryptParams()
{ {

View File

@@ -56,7 +56,7 @@ namespace DigitalData.Core.Security.Cryptographer
return new string(pemChars); return new string(pemChars);
} }
public IAsymmetricPrivateKey CreatePrivateKey(string pem, string? issuer = null, string? audience = null, bool encrypt = false, RSAEncryptionPadding? padding = null) => new RSADecryptor() public IAsymmetricPrivateKey CreatePrivateKey(string pem, string? issuer = null, string? audience = null, bool encrypt = false, RSAEncryptionPadding? padding = null) => new RSAPrivateKey()
{ {
Pem = pem, Pem = pem,
Issuer = issuer ?? string.Empty, Issuer = issuer ?? string.Empty,

View File

@@ -4,7 +4,7 @@ using System.Security.Cryptography;
namespace DigitalData.Core.Security.Cryptographer namespace DigitalData.Core.Security.Cryptographer
{ {
public class RSADecryptor : RSAKeyBase, IAsymmetricPrivateKey, IAsymmetricKey public class RSAPrivateKey : RSAKeyBase, IAsymmetricPrivateKey, IAsymmetricKey
{ {
private string? _pem; private string? _pem;
@@ -28,7 +28,7 @@ namespace DigitalData.Core.Security.Cryptographer
public IRSAEncryptor Encryptor => _lazyEncryptor.Value; public IRSAEncryptor Encryptor => _lazyEncryptor.Value;
public RSADecryptor() public RSAPrivateKey()
{ {
_lazyEncryptor = new(() => new RSAEncryptor() _lazyEncryptor = new(() => new RSAEncryptor()
{ {