nitrokey

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package nitrokey implements basic support for getting status and details about Nitrokey 3 tokens.

Index

Constants

View Source
const (
	// https://github.com/Nitrokey/admin-app/blob/main/src/admin.rs
	InsGetFirmwareVersion iso.Instruction = 0x61
	InsGetUUID            iso.Instruction = 0x62
	InsAdmin

	InsAdminGetStatus byte = 0x80
	InsAdminTestSE050 byte = 0x81
	InsAdminGetConfig byte = 0x82
	InsAdminSetConfig byte = 0x83
)

Variables

View Source
var ErrInvalidLength = errors.New("invalid length")

Functions

func GetFirmwareVersion

func GetFirmwareVersion(card *iso.Card) (*iso.Version, error)

GetFirmwareVersion returns the firmware version of the Nitrokey 3 token.

func GetUUID

func GetUUID(card *iso.Card) ([]byte, error)

GetUUID returns the UUID of the Nitrokey 3 token.

func Metadata added in v0.5.0

func Metadata(card *iso.Card) (meta map[string]any)

Types

type DeviceStatus

type DeviceStatus struct {
	InitStatus InitStatus
	IfsBlocks  byte
	EfsBlocks  uint16
	Variant    Variant
}

https://github.com/Nitrokey/pynitrokey/blob/781d4b9e3e9fc3cfc297611d31e7e43643547ac8/pynitrokey/nk3/admin_app.py#L77

func GetDeviceStatus

func GetDeviceStatus(card *iso.Card) (*DeviceStatus, error)

GetDeviceStatus returns the device status of the Nitrokey 3 token.

func (*DeviceStatus) Unmarshal

func (ds *DeviceStatus) Unmarshal(b []byte) error

type InitStatus

type InitStatus byte

https://github.com/Nitrokey/pynitrokey/blob/781d4b9e3e9fc3cfc297611d31e7e43643547ac8/pynitrokey/nk3/admin_app.py#L20

const (
	InitStatusNFCError           InitStatus = 0b0001
	InitStatusInternalFlashError InitStatus = 0b0010
	InitStatusExternalFlashError InitStatus = 0b0100
	InitStatusMigrationError     InitStatus = 0b1000
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL