u2fhid

package
v0.0.0-...-6f590a2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: BSD-3-Clause Imports: 8 Imported by: 2

Documentation

Overview

Package u2fhid implements the low-level FIDO U2F HID protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Devices

func Devices() ([]*hid.DeviceInfo, error)

Devices lists available HID devices that advertise the U2F HID protocol.

Types

type Device

type Device struct {
	ProtocolVersion    uint8
	MajorDeviceVersion uint8
	MinorDeviceVersion uint8
	BuildDeviceVersion uint8

	// RawCapabilities is the raw capabilities byte provided by the device
	// during initialization.
	RawCapabilities uint8

	// CapabilityWink is true if the device advertised support for the wink
	// command during initilization. Even if this flag is true, the device may
	// not actually do anything if the command is called.
	CapabilityWink bool
	// contains filtered or unexported fields
}

A Device is used to communicate with a U2F HID device.

func Open

func Open(info *hid.DeviceInfo) (*Device, error)

Open initializes a communication channel with a U2F HID device.

func (*Device) Close

func (d *Device) Close()

Close closes the device and frees associated resources.

func (*Device) Command

func (d *Device) Command(cmd byte, data []byte) ([]byte, error)

Command sends a command and associated data to the device and returns the response.

func (*Device) Message

func (d *Device) Message(data []byte) ([]byte, error)

Message sends an encapsulated U2F protocol message to the device and returns the response.

func (*Device) Ping

func (d *Device) Ping(data []byte) ([]byte, error)

Ping sends data to the device that should be echoed back verbatim.

func (*Device) Wink

func (d *Device) Wink() error

Wink performs a vendor-defined action to identify the device, like blinking an LED. It is not implemented correctly or at all on all devices.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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