pcsc

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoCardFound = errors.New("no card found")

Functions

func HasAttribute

func HasAttribute(attr scard.Attrib, value []byte) filter.Filter

HasAttribute uses the PCSC API SCardGetAttrib to check if the card has given attribute

func NewCard

func NewCard(ctx *scard.Context, reader string, shared bool) (*iso.Card, error)

NewCard creates a new card by connecting via the PC/SC API.

func OpenCards

func OpenCards(ctx *scard.Context, cnt int, flt filter.Filter, shared bool) (cards []iso.PCSCCard, err error)

OpenCards opens up to cnt cards which match the provided filter flt.

func OpenFirstCard

func OpenFirstCard(ctx *scard.Context, flt filter.Filter, shared bool) (iso.PCSCCard, error)

OpenFirstCard opens the first card which matches the filter flt or returns ErrNoCardFound if none was found.

Types

type Card

type Card struct {
	*scard.Card
}

Card implements the iso7816.PCSCCard interface via github.com/ebfe/scard.

func (*Card) BeginTransaction

func (c *Card) BeginTransaction() error

BeginTransaction wraps SCardBeginTransaction.

func (*Card) Close

func (c *Card) Close() error

Close disconnects and resets the card

func (*Card) EndTransaction

func (c *Card) EndTransaction() error

EndTransaction wraps SCardEndTransaction.

func (*Card) Reset

func (c *Card) Reset() error

Reset reconnects and resets the card

func (*Card) Transmit

func (c *Card) Transmit(cmd []byte) ([]byte, error)

Transmit wraps SCardTransmit.

Jump to

Keyboard shortcuts

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