pcsc

package
v0.0.0-...-8d9fba9 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

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 smartcard devices under the PCSC implementation

projects on which it is based:

https://github.com/LudovicRousseau/PCSC
github.com/ebfe/scard

/*

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListReaders

func ListReaders(ctx *Context) ([]string, error)

List Readers in a Context

Types

type Card

type Card interface {
	smartcard.ICard
	ControlApdu(ioctl uint32, apdu []byte) ([]byte, error)
	DiconnectResetCard() error
	DisconnectUnpowerCard() error
	DisconnectEjectCard() error
	TransparentSessionStart() ([]byte, error)
	TransparentSessionStartOnly() ([]byte, error)
	TransparentSessionResetRF() ([]byte, error)
	TransparentSessionEnd() ([]byte, error)
	Switch1444_4() ([]byte, error)
	Switch1444_3() ([]byte, error)
}

Card Interface

type Context

type Context struct {
	*scard.Context
}

func NewContext

func NewContext() (*Context, error)

Establish Context to Reader in pcscd

func (*Context) Release

func (c *Context) Release() error

Release Context in pcscd

type Reader

type Reader interface {
	smartcard.IReader
	// ConnectSamCard() (smartcard.ICard, error)
	// ConnectCard() (smartcard.ICard, error)
	ConnectDirect() (Card, error)
	ConnectCardPCSC() (Card, error)
	ConnectCardPCSC_T0() (Card, error)
}

Interface to Reader device

func NewReader

func NewReader(ctx *Context, readerName string) Reader

Create New Reader interface

type State

type State int
const (
	CONNECTED State = iota
	CONNECTEDDirect
	DISCONNECTED
)

Jump to

Keyboard shortcuts

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