nitrokey.nk3.updates

class nitrokey.nk3.updates.UpdateUi

Bases: ABC

abstract abort(*msgs)
Parameters:

msgs (Any)

Return type:

Exception

abstract abort_downgrade(current, image)
Parameters:
Return type:

Exception

abstract abort_pynitrokey_version(current, required)
Parameters:
Return type:

Exception

abstract confirm_download(current, new)
Parameters:
Return type:

None

abstract confirm_extra_information(extra_info)
Parameters:

extra_info (List[str])

Return type:

None

abstract confirm_pynitrokey_version(current, required)
Parameters:
Return type:

None

abstract confirm_update(current, new)
Parameters:
Return type:

None

abstract confirm_update_same_version(version)
Parameters:

version (Version)

Return type:

None

abstract download_progress_bar(desc)
Parameters:

desc (str)

Return type:

Iterator[Callable[[int, int], None]]

abstract error(*msgs)
Parameters:

msgs (Any)

Return type:

Exception

abstract finalization_progress_bar()
Return type:

Iterator[Callable[[int, int], None]]

abstract pre_bootloader_hint()
Return type:

None

abstract raise_warning(warning)
Parameters:

warning (Warning)

Return type:

Exception

abstract request_bootloader_confirmation()
Return type:

None

abstract show_warning(warning)
Parameters:

warning (Warning)

Return type:

None

abstract update_progress_bar()
Return type:

Iterator[Callable[[int, int], None]]

class nitrokey.nk3.updates.Updater

Bases: object

__init__(ui, await_bootloader, await_device, ignore_warnings=frozenset({}))
Parameters:
  • ui (UpdateUi)

  • await_bootloader (Callable[[], NK3Bootloader])

  • await_device (Callable[[int | None, Callable[[int, int], None] | None], NK3])

  • ignore_warnings (Set[Warning])

Return type:

None

update(device, image, update_version, ignore_pynitrokey_version=False)
Parameters:
  • device (TrussedBase)

  • image (str | None)

  • update_version (str | None)

  • ignore_pynitrokey_version (bool)

Return type:

Version

class nitrokey.nk3.updates.Warning

Bases: Enum

A warning that can occur during a firmware update.

By default, these warnings abort the firmware update. This enum can be used to select types of warnings that should be ignored and not cause the firmware update to fail.

classmethod from_str(s)
Parameters:

s (str)

Return type:

Warning

IFS_MIGRATION_V2 = 'ifs-migration-v2'
MISSING_STATUS = 'missing-status'
SDK_VERSION = 'sdk-version'
UPDATE_FROM_BOOTLOADER = 'update-from-bootloader'
property message: str
nitrokey.nk3.updates.get_firmware_update(release)
Parameters:

release (Release)

Return type:

Asset