feat(RSACryptographer): RsaSecurityKey.get Eigenschaft mit Lazy Loading hinzugefügt
This commit is contained in:
parent
66ed34b664
commit
ed29c9f990
@ -1,4 +1,5 @@
|
|||||||
using DigitalData.Core.Abstractions.Security;
|
using DigitalData.Core.Abstractions.Security;
|
||||||
|
using Microsoft.IdentityModel.Tokens;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
|
|
||||||
@ -24,8 +25,15 @@ namespace DigitalData.Core.Security.Cryptographer
|
|||||||
|
|
||||||
public string Audience { get; init; } = string.Empty;
|
public string Audience { get; init; } = string.Empty;
|
||||||
|
|
||||||
|
private readonly Lazy<RsaSecurityKey> _lazyRsaSecurityKey;
|
||||||
|
|
||||||
|
public RsaSecurityKey RsaSecurityKey => _lazyRsaSecurityKey.Value;
|
||||||
|
|
||||||
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||||
internal RSACryptographer() { }
|
internal RSACryptographer()
|
||||||
|
{
|
||||||
|
_lazyRsaSecurityKey = new(() => new RsaSecurityKey(RSA));
|
||||||
|
}
|
||||||
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user