feat(RSACryptographer): Virtuelle UnableToInitPemEvent-Methode für den Fall hinzugefügt, dass sowohl pem als auch pem-Pfad null sein können
This commit is contained in:
parent
5c09d7775b
commit
50e2581727
@ -30,6 +30,9 @@ namespace DigitalData.Core.Security.Cryptographer
|
||||
|
||||
internal RSACryptographer() { }
|
||||
|
||||
public virtual void UnableToInitPemEvent() => throw new InvalidOperationException(
|
||||
$"Pem is not initialized and pem file is null. Issuer is {Issuer} and audience {Audience}.");
|
||||
|
||||
public virtual void FileNotFoundEvent() => throw new FileNotFoundException(
|
||||
$"Pem is not initialized and pem file is not found in {PemPath}. Issuer is {Issuer} and audience {Audience}.");
|
||||
|
||||
@ -39,7 +42,7 @@ namespace DigitalData.Core.Security.Cryptographer
|
||||
if(_pem is null)
|
||||
{
|
||||
if(PemPath is null)
|
||||
throw new InvalidOperationException($"Pem is not initialized and pem file is null. Issuer is {Issuer} and audience {Audience}.");
|
||||
UnableToInitPemEvent();
|
||||
if (File.Exists(PemPath))
|
||||
_pem = File.ReadAllText(PemPath);
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user