nitrokey.trussed.admin_app

class nitrokey.trussed.admin_app.AdminApp

基类:object

__init__(device)
参数:

device (TrussedDevice)

返回类型:

None

factory_reset()
返回类型:

bool

factory_reset_app(application)
参数:

application (str)

返回类型:

bool

get_config(key)
参数:

key (str)

返回类型:

str

has_config(key)
参数:

key (str)

返回类型:

bool

is_locked()
返回类型:

bool

list_available_fields()
返回类型:

list[ConfigField]

reboot(mode=BootMode.FIRMWARE)
参数:

mode (BootMode)

返回类型:

bool

rng()
返回类型:

bytes

se050_tests()
返回类型:

bytes | None

set_config(key, value)
参数:
  • key (str)

  • value (str)

返回类型:

None

status()
返回类型:

Status

uuid()
返回类型:

Uuid | None

version()
返回类型:

Version

class nitrokey.trussed.admin_app.AdminCommand

基类:Enum

is_legacy_command()
返回类型:

bool

FACTORY_RESET = 132
FACTORY_RESET_APP = 133
GET_CONFIG = 130
LIST_AVAILABLE_FIELDS = 134
LOCKED = 99
REBOOT = 83
RNG = 96
SET_CONFIG = 131
STATUS = 128
TEST_SE050 = 129
UPDATE = 81
UUID = 98
VERSION = 97
class nitrokey.trussed.admin_app.BootMode

基类:Enum

BOOTROM = 2
FIRMWARE = 1
class nitrokey.trussed.admin_app.ConfigField

基类:object

ConfigField(name: str, requires_touch_confirmation: bool, requires_reboot: bool, destructive: bool, ty: nitrokey.trussed.admin_app.ConfigFieldType)

__init__(name, requires_touch_confirmation, requires_reboot, destructive, ty)
参数:
  • name (str)

  • requires_touch_confirmation (bool)

  • requires_reboot (bool)

  • destructive (bool)

  • ty (ConfigFieldType)

返回类型:

None

destructive: bool
name: str
requires_reboot: bool
requires_touch_confirmation: bool
ty: ConfigFieldType
class nitrokey.trussed.admin_app.ConfigFieldType

基类:Enum

classmethod from_int(i)
参数:

i (int)

返回类型:

ConfigFieldType | None

is_valid(value)
参数:

value (str)

返回类型:

bool

BOOL = 0
U8 = 1
class nitrokey.trussed.admin_app.ConfigStatus

基类:Enum

classmethod check(i, msg)
参数:
  • i (int)

  • msg (str)

返回类型:

None

classmethod from_int(i)
参数:

i (int)

返回类型:

ConfigStatus | None

DATA_TOO_LONG = 7
DESERIALIZATION_FAILED = 3
INVALID_KEY = 5
INVALID_VALUE = 6
READ_FAILED = 1
SERIALIZATION_FAILED = 4
SUCCESS = 0
WRITE_FAILED = 2
class nitrokey.trussed.admin_app.FactoryResetStatus

基类:Enum

classmethod check(i, msg)
参数:
  • i (int)

  • msg (str)

返回类型:

None

classmethod from_int(i)
参数:

i (int)

返回类型:

FactoryResetStatus | None

APP_FAILED_PARSE = 3
APP_NOT_ALLOWED = 2
NOT_CONFIRMED = 1
SUCCESS = 0
class nitrokey.trussed.admin_app.InitStatus

基类:IntFlag

__new__(value)
is_error()
返回类型:

bool

CONFIG_ERROR = 32
EXTERNAL_FLASH_ERROR = 4
INTERNAL_FLASH_ERROR = 2
MIGRATION_ERROR = 8
NFC_ERROR = 1
RNG_ERROR = 64
SE050_ERROR = 16
class nitrokey.trussed.admin_app.Status

基类:object

状态(init_status:Optional[nitrokey.trussed.admin_app.InitStatus] = None, ifs_blocks:可选[int] = None, efs_blocks:可选[int] = None, variant:可选[nitrokey.trussed.admin_app.Variant] = None)

__init__(init_status=None, ifs_blocks=None, efs_blocks=None, variant=None)
参数:
  • init_status (InitStatus | None)

  • ifs_blocks (int | None)

  • efs_blocks (int | None)

  • variant (Variant | None)

返回类型:

None

efs_blocks: int | None = None
ifs_blocks: int | None = None
init_status: InitStatus | None = None
variant: Variant | None = None
class nitrokey.trussed.admin_app.Variant

基类:Enum

LPC55 = 1
NRF52 = 2
USBIP = 0