Documentation ¶
Index ¶
Constants ¶
View Source
const ( // VendorCommandFirst is the first admissible vendor command identifier. VendorCommandFirst = 0x80 | 0x40 // VendorCommandLast is the last admissible vendor command identifier. VendorCommandLast = 0x80 | 0x7f )
Variables ¶
View Source
var DefaultReport = u2fHIDReport{
0x06, 0xD0, 0xF1,
0x09, 0x01,
0xA1, 0x01,
0x09, 0x20,
0x15, 0x00,
0x26, 0xFF, 0x00,
0x75, 0x08,
0x95, 0x40,
0x81, 0x02,
0x09, 0x21,
0x15, 0x00,
0x26, 0xFF, 0x00,
0x75, 0x08,
0x95, 0x40,
0x91, 0x02,
0xC0,
}
DefaultReport is the standard report descriptor for a USB HID FIDO2 token. https://chromium.googlesource.com/chromiumos/platform2/+/master/u2fd/u2fhid.cc
Functions ¶
This section is empty.
Types ¶
type CommandHandler ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler holds methods for sending and receiving packets.
func NewHandler ¶
NewHandler returns a new Handler instance with a given u2ftoken.Token. Token cannot be nil.
func (*Handler) AddMapping ¶
func (h *Handler) AddMapping(command u2fHIDCommand, ch CommandHandler) error
AddMapping adds a new CommandHandler mapping for a given command. Returns error if there's already a mapping for command, or if it is not defined between VendorCommandFirst and VendorCommandLast. Each mapping will be handled like a cmdMsg, meaning that the input for ch will be the whole session data, while its output will be framed and sent over the wire.
Click to show internal directories.
Click to hide internal directories.