Documentation ¶
Overview ¶
Package transport defines smart card transports
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTransport ¶
func RegisterTransport(name string, factory TransportFactory)
RegisterTransport registers a transport factory
Types ¶
type Card ¶
type Card interface { // Lock locks the card for exclusive use. // You should minimize the amount of time you lock // cards for (as this prevents other applications // from using the card) but it is necessary around multiple // command operations Lock() error // Unlock unlocks the card Unlock() error // Transact sends a request to the card and gets a response Transact(ReqAPDU) (RespAPDU, error) // Close connection to the card Close() error }
type OnReaderStateChange ¶
type OnReaderStateChange func(ctx context.Context, states []ReaderState)
type ReaderState ¶
type RespAPDU ¶
func ParseRespAPDU ¶
type Transport ¶
type Transport interface { Info() TransportInfo Readers() []ReaderState OnReaderStateChange(ctx context.Context, cb OnReaderStateChange) ConnectCard(ID string) (Card, error) Close() }
func New ¶
New creates a transport from a description. If the description contains a colon, then the part preceding the colon is interpreted as a driver name and the portion following as parameters. If no colon is present, then the entire description is interpreted as a driver name
func NewSCardTransport ¶
type TransportFactory ¶
type TransportInfo ¶
Click to show internal directories.
Click to hide internal directories.