Documentation ¶
Overview ¶
* package to handle the communication of smartCard devices under the PCSC implementation
projects on which it is based:
https://github.com/LudovicRousseau/PCSC github.com/ebfe/sCard
/*
* package to handle the communication of "omnikey/multi-iso" reader
projects on which it is based:
https://github.com/dumacp/smartcard
/*
Index ¶
- Constants
- Variables
- func MifareClassic(c *Card) (mifare.Classic, error)
- type BadChecsum
- type BadResponse
- type Card
- func (c *Card) ATR() ([]byte, error)
- func (c *Card) ATS() ([]byte, error)
- func (c *Card) Apdu(apdu []byte) ([]byte, error)
- func (c *Card) DisconnectCard() error
- func (c *Card) DisconnectResetCard() error
- func (c *Card) EndTransactionResetCard() error
- func (c *Card) GetData(data byte) ([]byte, error)
- func (c *Card) SAK() byte
- func (c *Card) Switch1444_3() ([]byte, error)
- func (c *Card) Switch1444_4() ([]byte, error)
- func (c *Card) UID() ([]byte, error)
- type Device
- type ErrorCode
- type ICard
- type NilResponse
- type Reader
- func (r *Reader) ConnectCard() (smartcard.ICard, error)
- func (r *Reader) ConnectLegacyCard() (*Card, error)
- func (r *Reader) ConnectMifareClassic() (mifare.Classic, error)
- func (r *Reader) ConnectSamCard() (smartcard.ICard, error)
- func (r *Reader) ConnectSamCard_T0() (smartcard.ICard, error)
- func (r *Reader) ConnectSamCard_Tany() (smartcard.ICard, error)
- func (r *Reader) GetRegister(register byte) ([]byte, error)
- func (r *Reader) SendAPDU1443_4(data []byte) ([]byte, error)
- func (r *Reader) SendDataFrameTransfer(data []byte) ([]byte, error)
- func (r *Reader) SendSAMDataFrameTransfer(data []byte) ([]byte, error)
- func (r *Reader) SetChainning(chainning bool)
- func (r *Reader) SetModeProtocol(mode int)
- func (r *Reader) SetRegister(register byte, data []byte) error
- func (r *Reader) T1TransactionV2(data []byte) ([]byte, error)
- func (r *Reader) Transmit(cmd, data []byte) ([]byte, error)
- func (r *Reader) TransmitAscii(cmd, data []byte) ([]byte, error)
- func (r *Reader) TransmitBinary(cmd, data []byte) ([]byte, error)
- type SendMode
- type State
- type TransmitProto
Constants ¶
const ( Loginsucess byte = 'L' Authenticationfailed byte = 'X' Generalfailure byte = 'F' Notaginfield byte = 'N' Operationmodefailure byte = 'O' Outofrange byte = 'R' )
response
const ( //BinaryMode protocol binary mode BinaryMode int = iota //AsciiMode protocol acsii mode AsciiMode )
Variables ¶
var ErrDisconnectCard = errors.New("don't Connect to Card")
Functions ¶
Types ¶
type BadChecsum ¶
type BadChecsum []byte
func (BadChecsum) Error ¶
func (e BadChecsum) Error() string
type BadResponse ¶
type BadResponse []byte
func (BadResponse) Error ¶
func (e BadResponse) Error() string
type Card ¶
func (*Card) DisconnectCard ¶
func (*Card) DisconnectResetCard ¶
func (*Card) EndTransactionResetCard ¶
func (*Card) Switch1444_3 ¶
func (*Card) Switch1444_4 ¶
type Device ¶
type Device struct { Ok bool // contains filtered or unexported fields }
Device struct
type ICard ¶
type ICard interface { smartcard.ICard Switch1444_4() ([]byte, error) Switch1444_3() ([]byte, error) }
Card Interface
type NilResponse ¶
type NilResponse int
func (NilResponse) Error ¶
func (e NilResponse) Error() string
type Reader ¶
type Reader struct { ModeProtocol int // contains filtered or unexported fields }
func NewMifareClassicReader ¶
NewMifareClassicReader Create mifare classic reader
func (*Reader) ConnectCard ¶
Create New Card interface
func (*Reader) ConnectLegacyCard ¶
Create New Card interface
func (*Reader) ConnectMifareClassic ¶
NewMClassic Create Mifare Plus Interface
func (*Reader) ConnectSamCard ¶
Create New Card interface
func (*Reader) ConnectSamCard_T0 ¶
Create New Card interface
func (*Reader) ConnectSamCard_Tany ¶
Create New Card interface
func (*Reader) GetRegister ¶
GetRegister send in format Data Frame Transfer
func (*Reader) SendAPDU1443_4 ¶
SendAPDU1443_4 send in format Data Frame Transfer
func (*Reader) SendDataFrameTransfer ¶
SendDataFrameTransfer send in format Data Frame Transfer
func (*Reader) SendSAMDataFrameTransfer ¶
SendSAMDataFrameTransfer send APDU to SAM device in special socket ("e" command)
func (*Reader) SetChainning ¶
func (*Reader) SetModeProtocol ¶
SetModeProtocol set mode protocol to communication (0: binary, 1: ascii)
func (*Reader) SetRegister ¶
SetRegister send in format Data Frame Transfer
func (*Reader) T1TransactionV2 ¶
T1TransactionV2 function to send wrapped frames T1 to SAM device through "e" command
func (*Reader) TransmitAscii ¶
TransmitAscii send in ascii protocol mode