refactor(IAsymmetricKey): Die Implementierung von IUniqueSecurityContext wurde entfernt und stattdessen die Eigenschaft Id hinzugefügt.

- Aktualisierte verwandte Implementierungen.
This commit is contained in:
Developer 02
2025-01-09 22:57:04 +01:00
parent 97c4f7bf8f
commit 66e3c771dd
7 changed files with 18 additions and 17 deletions

View File

@@ -45,14 +45,12 @@ namespace DigitalData.Core.Security.RSAKey
private void Init()
{
if (string.IsNullOrEmpty(_pem))
throw PemIsNullException;
throw new InvalidOperationException ($"The content of RSA private key is null or empty. Id: {Id}.");
if (IsEncrypted)
RSA.ImportFromEncryptedPem(Content, Secrets.PBE_PASSWORD.AsSpan());
else
RSA.ImportFromPem(Content);
}
private InvalidOperationException PemIsNullException => new($"Content is null or empty. Issuer: {Issuer}, Audience: {Audience}.");
}
}