ykoath

package module
v0.0.0-...-ddaed02 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

README

ykoath

This library includes a (partial) implementation of the YKOATH protocol in Go.

Documentation

Index

Constants

View Source
const (
	PUT            yubiKeyInstruction = 0x01
	DELETE         yubiKeyInstruction = 0x02
	SET_CODE       yubiKeyInstruction = 0x03
	RESET          yubiKeyInstruction = 0x04
	LIST           yubiKeyInstruction = 0xa1
	CALCULATE      yubiKeyInstruction = 0xa2
	VALIDATE       yubiKeyInstruction = 0xa3
	CALCULATE_ALL  yubiKeyInstruction = 0xa4
	SELECT         yubiKeyInstruction = 0xa4 // Synthetic, does not realy exists
	SEND_REMAINING yubiKeyInstruction = 0xa5
)
View Source
const (
	HMAC_SHA1   yubiKeyAlgo = 0x01
	HMAC_SHA256 yubiKeyAlgo = 0x02
	HMAC_SHA512 yubiKeyAlgo = 0x03
)
View Source
const (
	HOTP yubiKeyType = 0x10
	TOTP yubiKeyType = 0x20
)
View Source
const (
	ONLY_INCREASING yubiKeyProperty = 0x01
	REQUIRE_TOUCH   yubiKeyProperty = 0x02
)
View Source
const (
	RES_SUCCESS                 yubiKeyResponse = 0x9000
	RES_NO_SPACE                yubiKeyResponse = 0x6a84
	RES_AUTH_REQUIRED           yubiKeyResponse = 0x6982
	RES_WRONG_SYNTAX            yubiKeyResponse = 0x6a80
	RES_NO_SUCH_OBJECT          yubiKeyResponse = 0x6984
	RES_RESPONSE_DOES_NOT_MATCH yubiKeyResponse = 0x6984
	RES_MORE_DATA_AVAILABLE     yubiKeyResponse = 0x61
	RES_GENERIC_ERROR           yubiKeyResponse = 0x6581
	RES_AUTH_NOT_ENABLED        yubiKeyResponse = 0x6984
)
View Source
const (
	VERSION   yubiKeyTag = 0x79
	NAME      yubiKeyTag = 0x71
	NAME_LIST yubiKeyTag = 0x72
	CHALLENGE yubiKeyTag = 0x74
	ALGORITHM yubiKeyTag = 0x7b
	KEY       yubiKeyTag = 0x73
	PROPERTY  yubiKeyTag = 0x78
	IMF       yubiKeyTag = 0x7a
	RESPONSE  yubiKeyTag = 0x75
)
View Source
const (
	CHALLANG_LEN = 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card interface {
	Transmit(command []byte) ([]byte, error)
}

type ListData

type ListData struct {
	Name string
	Algo yubiKeyAlgo
	Type yubiKeyType
}

type YKO

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

func New

func New(c Card) *YKO

func (*YKO) AuthRequired

func (y *YKO) AuthRequired() bool

func (*YKO) Calculate

func (y *YKO) Calculate(name string) (string, error)

func (*YKO) List

func (y *YKO) List() ([]ListData, error)

func (*YKO) Select

func (y *YKO) Select() error

func (*YKO) Validate

func (y *YKO) Validate(password []byte) error

Jump to

Keyboard shortcuts

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