DnssecPrivateKey: added validation check in RolloverDays.

This commit is contained in:
Shreyas Zare
2022-04-23 17:47:03 +05:30
parent c282a5d56f
commit 4bd1488d27

View File

@@ -340,6 +340,18 @@ namespace DnsServerCore.Dns.Dnssec
{
if (value > 365)
throw new ArgumentOutOfRangeException(nameof(RolloverDays), "Zone Signing Key (ZSK) automatic rollover days valid range is 0-365.");
switch (_state)
{
case DnssecPrivateKeyState.Generated:
case DnssecPrivateKeyState.Published:
case DnssecPrivateKeyState.Ready:
case DnssecPrivateKeyState.Active:
break;
default:
throw new ArgumentOutOfRangeException(nameof(RolloverDays), "Zone Signing Key (ZSK) automatic rollover cannot be set due to invalid key state.");
}
}
else
{