felica_pcsc

package
v0.0.0-...-13f3c6a Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMacNotMatched = errors.New("mac_a didn't matched")
View Source
var ErrMasterKeyNil = errors.New("master key is nil")
View Source
var ErrNoResponse = errors.New("no response from card")
View Source
var ErrUnknown = errors.New("unknown error")

Functions

func GetData

func GetData(card *scard.Card, dataType felica.DataType) ([]byte, error)

Types

type FeliCaLiteS

type FeliCaLiteS struct {
	felica.FeliCaLiteS
	Card *scard.Card
}

func NewCard

func NewCard(card *scard.Card, masterKeyProvider MasterKeyProvider) (*FeliCaLiteS, error)

If masterKeyProvider is nil, MAC check skipped

func (*FeliCaLiteS) Command

func (c *FeliCaLiteS) Command(command []byte) ([]byte, error)

func (*FeliCaLiteS) Read

func (c *FeliCaLiteS) Read(address []byte) ([]felica.Block, error)

func (*FeliCaLiteS) ReadWithMac

func (c *FeliCaLiteS) ReadWithMac(address []byte) ([]felica.Block, error)

address length: 1-3

func (*FeliCaLiteS) SetService

func (c *FeliCaLiteS) SetService(service uint16) error

func (*FeliCaLiteS) Write

func (c *FeliCaLiteS) Write(data []felica.Block) error

func (*FeliCaLiteS) WriteWithMac

func (c *FeliCaLiteS) WriteWithMac(data felica.Block) error

type MasterKeyProvider

type MasterKeyProvider func([2]byte) *[24]byte

Return MasterKey from CKV returning nil results ErrMasterKeyNil

Jump to

Keyboard shortcuts

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