diff --git a/DigitalData.Core.Security/RSACryptographer.cs b/DigitalData.Core.Security/RSACryptographer.cs index 55161cc..ed6c72d 100644 --- a/DigitalData.Core.Security/RSACryptographer.cs +++ b/DigitalData.Core.Security/RSACryptographer.cs @@ -11,6 +11,21 @@ namespace DigitalData.Core.Security protected virtual RSA RSA { get; } = RSA.Create(); + private DateOnly? _expiration; + + public DateOnly? Expiration + { + get => _expiration; + init + { + + if (value <= DateOnly.FromDateTime(DateTime.Now)) + throw new InvalidOperationException("The expiration date has already passed."); + + _expiration = value; + } + } + internal RSACryptographer() { } } } \ No newline at end of file