Documentation
¶
Overview ¶
Package pcsc provides access to Token2 devices over PC/SC.
Index ¶
- Variables
- type Device
- func (d *Device) ATR(_ context.Context) (token2.ATR, error)
- func (d *Device) Close() error
- func (d *Device) Configuration(ctx context.Context) (config token2.Configuration, err error)
- func (d *Device) DeviceInfo(ctx context.Context) (info token2.DeviceInfo, err error)
- func (d *Device) SetReaderNFC(ctx context.Context, enabled bool) error
- func (d *Device) SetReaderSoundLevel(ctx context.Context, level ReaderSoundLevel) error
- type ReaderSoundLevel
Constants ¶
This section is empty.
Variables ¶
var ErrOTPApplicationNotAvailable = errors.New(
"token2 pcsc: OTP application not available",
)
ErrOTPApplicationNotAvailable reports that the selected card does not expose the Token2 OTP application used for device information.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device is a Token2 device connected through a PC/SC reader.
func (*Device) Configuration ¶
Configuration returns the Token2 device configuration.
func (*Device) DeviceInfo ¶
DeviceInfo returns transport-neutral information derived from the device serial number.
func (*Device) SetReaderNFC ¶
SetReaderNFC enables or disables the Token2 reader NFC interface. A nil error confirms only that the reader returned 9000; unsupported readers may accept and ignore the command. Power-cycle the reader to apply the setting.
func (*Device) SetReaderSoundLevel ¶
func (d *Device) SetReaderSoundLevel(ctx context.Context, level ReaderSoundLevel) error
SetReaderSoundLevel configures the Token2 reader sound level. A nil error confirms only that the reader returned 9000; unsupported readers may accept and ignore the command. Power-cycle the reader to apply the setting.
type ReaderSoundLevel ¶
type ReaderSoundLevel byte
ReaderSoundLevel is the sound level configured on a Token2 reader.
const ( ReaderSoundOff ReaderSoundLevel = iota ReaderSoundLevel1 ReaderSoundLevel2 ReaderSoundLevel3 ReaderSoundLevel4 ReaderSoundLevel5 )