part #2
This commit is contained in:
@@ -5,8 +5,8 @@ namespace StellaOps.Cryptography.Kms;
|
||||
/// </summary>
|
||||
public sealed class Pkcs11Options
|
||||
{
|
||||
private TimeSpan metadataCacheDuration = TimeSpan.FromMinutes(5);
|
||||
private TimeSpan publicKeyCacheDuration = TimeSpan.FromMinutes(5);
|
||||
private TimeSpan _metadataCacheDuration = TimeSpan.FromMinutes(5);
|
||||
private TimeSpan _publicKeyCacheDuration = TimeSpan.FromMinutes(5);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the native PKCS#11 library path.
|
||||
@@ -48,8 +48,8 @@ public sealed class Pkcs11Options
|
||||
/// </summary>
|
||||
public TimeSpan MetadataCacheDuration
|
||||
{
|
||||
get => metadataCacheDuration;
|
||||
set => metadataCacheDuration = EnsurePositive(value, TimeSpan.FromMinutes(5));
|
||||
get => _metadataCacheDuration;
|
||||
set => _metadataCacheDuration = EnsurePositive(value, TimeSpan.FromMinutes(5));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -57,15 +57,10 @@ public sealed class Pkcs11Options
|
||||
/// </summary>
|
||||
public TimeSpan PublicKeyCacheDuration
|
||||
{
|
||||
get => publicKeyCacheDuration;
|
||||
set => publicKeyCacheDuration = EnsurePositive(value, TimeSpan.FromMinutes(5));
|
||||
get => _publicKeyCacheDuration;
|
||||
set => _publicKeyCacheDuration = EnsurePositive(value, TimeSpan.FromMinutes(5));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an optional factory for advanced facade injection (testing, custom providers).
|
||||
/// </summary>
|
||||
public Func<IServiceProvider, IPkcs11Facade>? FacadeFactory { get; set; }
|
||||
|
||||
private static TimeSpan EnsurePositive(TimeSpan value, TimeSpan fallback)
|
||||
=> value <= TimeSpan.Zero ? fallback : value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user