From: Jo Sutton Date: Wed, 24 Apr 2024 00:42:40 +0000 (+1200) Subject: python:gkdi: Add helper methods returning previous and next GKIDs X-Git-Tag: tdb-1.4.11~921 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94e055b582e3c4498b99d3997df3db614b3e94e8;p=thirdparty%2Fsamba.git python:gkdi: Add helper methods returning previous and next GKIDs Signed-off-by: Jo Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/gkdi.py b/python/samba/gkdi.py index 22890c83ff3..6d29b5d8d2b 100644 --- a/python/samba/gkdi.py +++ b/python/samba/gkdi.py @@ -289,6 +289,12 @@ class Gkid: return start_time + def previous(self) -> "Gkid": + return Gkid.from_nt_time(NtTime(self.start_nt_time() - KEY_CYCLE_DURATION)) + + def next(self) -> "Gkid": + return Gkid.from_nt_time(NtTime(self.start_nt_time() + KEY_CYCLE_DURATION)) + @staticmethod def from_key_envelope(env: gkdi.KeyEnvelope) -> "Gkid": return Gkid(env.l0_index, env.l1_index, env.l2_index)