nitrokey.trussed

Submodules

Ristikkorakenteiset laite-esineet

class nitrokey.trussed.TrussedBase

Perusluokka Nitrokey-laitteille, jotka käyttävät Trussed-kehystä ja käyttävät laiteohjelmistoa tai käynnistyslatausta.

abstract close()
Return type:

None

abstract reboot()
Return type:

bool

abstract uuid()
Return type:

Uuid | None

abstract property name: str
abstract property path: str
abstract property pid: int
property vid: int
class nitrokey.trussed.TrussedDevice

Perusteet: TrussedBase

__init__(device, fido2_certs)
Parametrit:
  • device (CtapHidDevice)

  • fido2_certs (Sequence[Fido2Certs])

Return type:

None

close()
Return type:

None

abstract classmethod from_device(device)
Parametrit:

device (CtapHidDevice)

Return type:

T

classmethod list()
Return type:

list[T]

classmethod open(path)
Parametrit:

path (str)

Return type:

T | None

reboot()
Return type:

bool

uuid()
Return type:

Uuid | None

wink()
Return type:

None

property path: str
class nitrokey.trussed.TrussedBootloader

Perusteet: TrussedBase

abstract update(image, callback=None)
Parametrit:
  • image (bytes)

  • callback (Callable[[int, int], None] | None)

Return type:

None

abstract property variant: Variant

Update Container Objects

nitrokey.trussed.parse_firmware_image(variant, data, model)
Parametrit:
Return type:

FirmwareMetadata

class nitrokey.trussed.FirmwareContainer

FirmwareContainer(version: nitrokey.trussed._utils.Version, pynitrokey: Optional[nitrokey.trussed._utils.Version], images: Dict[nitrokey.trussed._bootloader.Variant, bytes])

__init__(version, pynitrokey, images)
Parametrit:
Return type:

None

classmethod parse(path, model)
Parametrit:
  • path (str | BytesIO)

  • model (Model)

Return type:

FirmwareContainer

images: Dict[Variant, bytes]
pynitrokey: Version | None
version: Version
class nitrokey.trussed.FirmwareMetadata

FirmwareMetadata(version: Nitrokey.trussed._utils.Version, signed_by: Optional[str] = None, signed_by_nitrokey: bool = False)

__init__(version, signed_by=None, signed_by_nitrokey=False)
Parametrit:
  • version (Version)

  • signed_by (str | None)

  • signed_by_nitrokey (bool)

Return type:

None

signed_by: str | None = None
signed_by_nitrokey: bool = False
version: Version
class nitrokey.trussed.Variant

Perusteet: Enum

classmethod from_str(s)
Parametrit:

s (str)

Return type:

Variant

LPC55 = 'lpc55'
NRF52 = 'nrf52'

Hyötyobjektit

class nitrokey.trussed.App

Perusteet: Enum

Valmistajakohtaiset CTAPHID-komennot Trussed-sovelluksia varten.

ADMIN = 114
PROVISIONER = 113
SECRETS = 112
class nitrokey.trussed.Fido2Certs

Fido2Certs(start: Nitrokey.trussed._utils.Version, hashes: list[str])

__init__(start, hashes)
Parametrit:
  • start (Version)

  • hashes (list[str])

Return type:

None

static get(certs, version)
Parametrit:
Return type:

Fido2Certs | None

hashes: list[str]
start: Version
class nitrokey.trussed.Model

Perusteet: Enum

classmethod from_str(s)
Parametrit:

s (str)

Return type:

Model

NK3 = 'Nitrokey 3'
NKPK = 'Nitrokey Passkey'
property firmware_pattern: Pattern[str]
property firmware_repository: Repository
class nitrokey.trussed.Uuid

UUID of a Nitrokey Trussed device.

__init__(value)
Parametrit:

value (int)

Return type:

None

value: int
class nitrokey.trussed.Version

Nitrokey Trussed -laitteen versio Semanttisen versioinnin 2.0.0 mukaisesti.

Jotkin versiotietojen lähteet, nimittäin vanhempien laitteiden palauttama versio ja laiteohjelmiston binääritiedostot, eivät sisällä julkaisua edeltävää komponenttia. Nämä tapaukset on merkitty merkinnällä complete=False. Tämä merkintä vaikuttaa vertailuun: Julkaisua edeltävä versio otetaan huomioon vain, jos molemmat versiot ovat täydellisiä.

>>> Version(1, 0, 0)
Version(major=1, minor=0, patch=0, pre=None, build=None)
>>> Version.from_str("1.0.0")
Version(major=1, minor=0, patch=0, pre=None, build=None)
>>> Version.from_v_str("v1.0.0")
Version(major=1, minor=0, patch=0, pre=None, build=None)
>>> Version(1, 0, 0, "rc.1")
Version(major=1, minor=0, patch=0, pre='rc.1', build=None)
>>> Version.from_str("1.0.0-rc.1")
Version(major=1, minor=0, patch=0, pre='rc.1', build=None)
>>> Version.from_v_str("v1.0.0-rc.1")
Version(major=1, minor=0, patch=0, pre='rc.1', build=None)
>>> Version.from_v_str("v1.0.0-rc.1+git")
Version(major=1, minor=0, patch=0, pre='rc.1', build='git')
__init__(major, minor, patch, pre=None, build=None, complete=False)
Parametrit:
  • major (int)

  • minor (int)

  • patch (int)

  • pre (str | None)

  • build (str | None)

  • complete (bool)

Return type:

None

core()

Palauttaa tämän version ydinosan eli version ilman esijulkaisu- ja rakennuskomponentteja.

>>> Version(1, 0, 0).core()
Version(major=1, minor=0, patch=0, pre=None, build=None)
>>> Version(1, 0, 0, "rc.1").core()
Version(major=1, minor=0, patch=0, pre=None, build=None)
>>> Version(1, 0, 0, "rc.1", "git").core()
Version(major=1, minor=0, patch=0, pre=None, build=None)
Return type:

Version

classmethod from_int(version)
Parametrit:

version (int)

Return type:

Version

classmethod from_str(s)
Parametrit:

s (str)

Return type:

Version

classmethod from_v_str(s)
Parametrit:

s (str)

Return type:

Version

build: str | None = None
complete: bool = False
major: int
minor: int
patch: int
pre: str | None = None

Trussed Exceptions

class nitrokey.trussed.TrussedException

Perusteet: Exception

class nitrokey.trussed.TimeoutException

Perusteet: TrussedException

__init__()
Return type:

None