SpringCard PcscBridge SDK for .NET  20.09.25
The SDK for PcscBridge and the virtual PC/SC drivers
SpringCard.PCSC.Bridge.Client.ReaderInterface Interface Reference

Reader-side interfaces - To be implemented by the client application. More...

Public Member Functions

void Enable (ReaderNotificationInterface rdr_to_pc)
 Function invoked by the ReaderEngine when a connection with the PC/SC driver has been established (through a BridgeLink). More...
 
void Disable ()
 Function invoked by the ReaderEngine when the connection with the PC/SC driver has been lost. More...
 
bool Control (byte[] command, out byte[] response)
 Function invoked by the ReaderEngine when a incoming SCardControl arrives. More...
 
bool Transmit (byte[] capdu, out byte[] rapdu)
 Function invoked by the ReaderEngine when a incoming SCardTransmit arrives. More...
 
bool PowerOn (out byte[] atr)
 Function invoked by the ReaderEngine when a incoming PowerOn request arrives. More...
 
bool PowerOff ()
 Function invoked by the ReaderEngine when a incoming PowerOff request arrives. More...
 
bool GetStatus (out bool present)
 Function invoked by the ReaderEngine when a incoming GetStatus request arrives. More...
 

Detailed Description

Reader-side interfaces - To be implemented by the client application.

Member Function Documentation

◆ Control()

bool SpringCard.PCSC.Bridge.Client.ReaderInterface.Control ( byte[]  command,
out byte[]  response 
)

Function invoked by the ReaderEngine when a incoming SCardControl arrives.

The client application shall process the SCardControl, and provide a suitable response.

The driver timeout for SCardControl requests is 10 seconds. If the client application fails to return from the function in this delay, the PC/SC driver will close the link.

The client application shall return true to keep the BridgeLink open. If the client application returns false, the ReaderEngine closes the link with the PC/SC driver.

◆ Disable()

void SpringCard.PCSC.Bridge.Client.ReaderInterface.Disable ( )

Function invoked by the ReaderEngine when the connection with the PC/SC driver has been lost.

The client application shall stop using the rdr_to_pc provided by an earlier Enable call, for it has become invalid.

◆ Enable()

void SpringCard.PCSC.Bridge.Client.ReaderInterface.Enable ( ReaderNotificationInterface  rdr_to_pc)

Function invoked by the ReaderEngine when a connection with the PC/SC driver has been established (through a BridgeLink).

The client application shall use the supplied rdr_to_pc interface to send its notification to the driver. The ReaderEngine with call Disable if the link with the PC/SC driver is closed for any reason.

◆ GetStatus()

bool SpringCard.PCSC.Bridge.Client.ReaderInterface.GetStatus ( out bool  present)

Function invoked by the ReaderEngine when a incoming GetStatus request arrives.

The driver timeout for GetStatus requests is 10 seconds. If the client application fails to return from the function in this delay, the PC/SC driver will close the link.

The client application shall return true to keep the BridgeLink open. If the client application returns false, the ReaderEngine closes the link with the PC/SC driver.

Remarks

GetStatus is invoked only when the ReaderEngine starts, to get the initial state of the client application's virtual reader.

Once the ReaderEngine is running, the client application shall use the ReaderNotificationInterface.NotifyInsert() and ReaderNotificationInterface.NotifyRemove() functions provided by the Enable() function to tell the driver that its status has changed.

◆ PowerOff()

bool SpringCard.PCSC.Bridge.Client.ReaderInterface.PowerOff ( )

Function invoked by the ReaderEngine when a incoming PowerOff request arrives.

The PowerOff request is likely to be related to an SCardDisconnect on the driver's side.

The driver timeout for PowerOff requests is 10 seconds. If the client application fails to return from the function in this delay, the PC/SC driver will close the link.

The client application shall return true to keep the BridgeLink open. If the client application returns false, the ReaderEngine closes the link with the PC/SC driver.

◆ PowerOn()

bool SpringCard.PCSC.Bridge.Client.ReaderInterface.PowerOn ( out byte[]  atr)

Function invoked by the ReaderEngine when a incoming PowerOn request arrives.

The PowerOn request is likely to be related to an SCardConnect on the driver's side.

The client application shall provide a valid ATR in response.

The driver timeout for PowerOn requests is 10 seconds. If the client application fails to return from the function in this delay, the PC/SC driver will close the link.

The response shall be a valid ATR in the terms of ISO/IEC 7816-3. If the ATR is invalid, it will be dropped by the driver or the PC/SC stack on the driver's side. If you don't know which ATR to use, use 3B 81 80 01 80 80 (atr = new byte[] { 0x3B, 0x81, 0x80, 0x01, 0x80, 0x80 })

The client application shall return true to keep the BridgeLink open. If the client application returns false, the ReaderEngine closes the link with the PC/SC driver.

◆ Transmit()

bool SpringCard.PCSC.Bridge.Client.ReaderInterface.Transmit ( byte[]  capdu,
out byte[]  rapdu 
)

Function invoked by the ReaderEngine when a incoming SCardTransmit arrives.

The client application shall process the SCardTransmit, and provide a suitable response.

The driver timeout for SCardControl requests is 60 seconds. If the client application fails to return from the function in this delay, the PC/SC driver will close the link.

The response shall be a valid R-APDU in the terms of ISO/IEC 7816-4, i.e. it shall be at least 2-byte long. The last two bytes are the Status Word. The only valid values are 6xxx and 9xxx in hex (0x6000 to 0x6FFF for errors, 0x9000 to 0x9FFF for success). If the R-APDU does not contain a valid Status Word, it is likely to be dropped by the driver or the PC/SC stack on the driver's side.

The client application shall return true to keep the BridgeLink open. If the client application returns false, the ReaderEngine closes the link with the PC/SC driver.


The documentation for this interface was generated from the following file: