mirror of
https://github.com/samba-team/samba.git
synced 2025-03-11 16:58:40 +03:00
python:gkdi: Add helper methods returning previous and next GKIDs
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
282e5784a0
commit
94e055b582
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user