Documentation
¶
Index ¶
- Constants
- type CTAPError
- type CTAPPacket
- type Device
- func (d *Device) Close() error
- func (d *Device) OneShot(fn func(d *Device) error) error
- func (d *Device) Open() error
- func (d *Device) Path() string
- func (d *Device) Reboot() error
- func (d *Device) SendAndReceive(cmd uint8, data []byte) ([]byte, error)
- func (d *Device) String() string
- func (d *Device) YubiConfig() (*YubiConfig, error)
- type Version
- type YubiConfig
- func (c *YubiConfig) Clear() *YubiConfig
- func (c *YubiConfig) Get(tag int) []byte
- func (c *YubiConfig) Has(tag int) bool
- func (c *YubiConfig) Marshal() ([]byte, error)
- func (c *YubiConfig) Serial() uint32
- func (c *YubiConfig) Set(tag int, data []byte) *YubiConfig
- func (c *YubiConfig) Unmarshal(data []byte) error
- func (c *YubiConfig) Version() Version
Examples ¶
Constants ¶
View Source
const ( ConfigTagUsbSupported = 0x01 ConfigTagSerial = 0x02 ConfigTagUsbEnabled = 0x03 ConfigTagFormFactor = 0x04 ConfigTagVersion = 0x05 ConfigTagAutoEjectTimeout = 0x06 ConfigTagChalrespTimeout = 0x07 ConfigTagDeviceFlags = 0x08 ConfigTagAppVersions = 0x09 ConfigTagConfigLock = 0x0A ConfigTagUnlock = 0x0B ConfigTagReboot = 0x0C ConfigTagNfcSupported = 0x0D ConfigTagNfcEnabled = 0x0E ConfigTagIapDetection = 0x0F ConfigTagMoreData = 0x10 ConfigTagFreeForm = 0x11 ConfigTagHidInitDelay = 0x12 ConfigTagPartNumber = 0x13 ConfigTagFipsCapable = 0x14 ConfigTagFipsApproved = 0x15 ConfigTagPinComplexity = 0x16 ConfigTagNfcRestricted = 0x17 ConfigTagResetBlocked = 0x18 ConfigTagFpsVersion = 0x20 ConfigTagStmVersion = 0x21 )
View Source
const (
YubicoVID = 0x1050
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CTAPPacket ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
func Enumerate ¶
Example ¶
package main
import (
"fmt"
"log"
"github.com/buglloc/fidoctl"
)
func main() {
devices, err := fidoctl.Enumerate()
if err != nil {
panic(fmt.Errorf("Enumerate: %v", err))
}
for _, device := range devices {
fmt.Println(device.String())
cfg, err := device.YubiConfig()
if err != nil {
log.Printf("Getting YubiConfig: %v", err)
continue
}
fmt.Printf(" - serial: %d\n", cfg.Serial())
fmt.Printf(" - version: %s\n", cfg.Version())
}
}
func (*Device) SendAndReceive ¶
func (*Device) YubiConfig ¶ added in v0.9.1
func (d *Device) YubiConfig() (*YubiConfig, error)
type YubiConfig ¶ added in v0.9.1
type YubiConfig struct {
// contains filtered or unexported fields
}
func (*YubiConfig) Clear ¶ added in v0.9.1
func (c *YubiConfig) Clear() *YubiConfig
func (*YubiConfig) Get ¶ added in v0.9.1
func (c *YubiConfig) Get(tag int) []byte
func (*YubiConfig) Has ¶ added in v0.9.1
func (c *YubiConfig) Has(tag int) bool
func (*YubiConfig) Marshal ¶ added in v0.9.1
func (c *YubiConfig) Marshal() ([]byte, error)
func (*YubiConfig) Serial ¶ added in v0.9.1
func (c *YubiConfig) Serial() uint32
func (*YubiConfig) Set ¶ added in v0.9.1
func (c *YubiConfig) Set(tag int, data []byte) *YubiConfig
func (*YubiConfig) Unmarshal ¶ added in v0.9.1
func (c *YubiConfig) Unmarshal(data []byte) error
func (*YubiConfig) Version ¶ added in v0.9.1
func (c *YubiConfig) Version() Version
Click to show internal directories.
Click to hide internal directories.