mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
tuf.api: add helpers to bump version and expiration
Signed-off-by: Joshua Lock <jlock@vmware.com>
This commit is contained in:
parent
2e3ceb7ff3
commit
721def4eb0
1 changed files with 6 additions and 0 deletions
|
|
@ -69,6 +69,12 @@ def signable(self) -> JsonDict:
|
|||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def bump_version(self) -> None:
|
||||
self.version = self.version + 1
|
||||
|
||||
def bump_expiration(self, delta: relativedelta = relativedelta(days=1)) -> None:
|
||||
self.expiration = self.expiration + delta
|
||||
|
||||
def signed(self) -> str:
|
||||
return encode_canonical(self.signable['signed']).encode('utf-8')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue