authchip

package
v0.0.0-...-231b78a Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package authchip implements a Golang module to talk to an Apple MFI authentication chip. The protocol is documented in this software released under the Apache2.0 license: https://github.com/apple/HomeKitADK/blob/master/HAP/HAPMFiHWAuth.c

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chip

type Chip struct {
	// contains filtered or unexported fields
}

func New

func New(i2cFunc I2CFuncType, powerFunc PowerSwitchType, i2cMaxTransfer int, logFunc LogFunc) (*Chip, error)

func (*Chip) CertificateRawPKCS7

func (m *Chip) CertificateRawPKCS7() []byte

func (*Chip) CertificateX509

func (m *Chip) CertificateX509() *x509.Certificate

func (*Chip) ChipInfo

func (m *Chip) ChipInfo() ChipInfo

func (*Chip) Close

func (m *Chip) Close() error

func (*Chip) SerialNumber

func (m *Chip) SerialNumber() string

func (*Chip) SignRaw

func (m *Chip) SignRaw(input []byte) ([]byte, error)

type ChipInfo

type ChipInfo struct {
	DeviceVersion        byte
	FirmwareVersion      byte
	ProtocolMajorVersion byte
	ProtocolMinorVersion byte

	SignatureLenInput  uint16
	SignatureLenOutput uint16
}

func (ChipInfo) String

func (i ChipInfo) String() string

type I2CFuncType

type I2CFuncType func(tx []byte, rx []byte) (bool, error)

type LogFunc

type LogFunc func(format string, params ...interface{})

type PowerSwitchType

type PowerSwitchType func(enable bool) error

Directories

Path Synopsis
mcp2221a
Package mcp2221a provides a high-level interface to the Microchip MCP2221A USB to GPIO/I²C/UART protocol converter.
Package mcp2221a provides a high-level interface to the Microchip MCP2221A USB to GPIO/I²C/UART protocol converter.

Jump to

Keyboard shortcuts

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