|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectopencard.core.terminal.CardTerminal
opencard.opt.terminal.AbstractLockableTerminal
com.ibm.opencard.terminal.pcsc10.Pcsc10LockableTerminal
public final class Pcsc10LockableTerminal
Implementation of a lockable OpenCard CardTerminal for PCSC.
AbstractLockableTerminal| Field Summary |
|---|
| Fields inherited from class opencard.core.terminal.CardTerminal |
|---|
address, name, slots, type |
| Constructor Summary | |
|---|---|
protected |
Pcsc10LockableTerminal(java.lang.String name,
java.lang.String type,
java.lang.String address)
Instantiate an Pcsc10Terminal. |
| Method Summary | |
|---|---|
protected void |
cardRemoved(int slotID)
Signal to observers that an inserted card was removed. |
void |
close()
Close the connection to the card terminal. |
CardID |
getCardID(int slot)
Return the CardID of the presently inserted card. |
CardID |
getCardID(int slot,
int timeout)
Deprecated. |
protected void |
internalCloseSlotChannel(SlotChannel sc)
The internal closeSlotChannel method. |
protected java.util.Properties |
internalFeatures(java.util.Properties features)
Query the card terminal about its features. |
protected void |
internalLock()
|
protected void |
internalLockSlot(int slotNr)
|
protected CardID |
internalReset(int slot,
int ms)
Implementation of CardTerminal.internalReset(). |
protected ResponseAPDU |
internalSendAPDU(int slot,
CommandAPDU capdu,
int ms)
The implementation of CardTerminal.internalSendAPDU(). |
protected void |
internalUnlock()
|
protected void |
internalUnlockSlot(int slotNr)
|
boolean |
isCardPresent(int slot)
Check whether there is a smart card present. |
protected void |
lockableOpenSlotChannel(int slotID)
The internal openSlotChannel method. |
void |
open()
Open the card terminal: We register with the CardTerminalRegistry as a Pollable card terminal. |
void |
poll()
This method is normally used by the CardTerminalRegistry to generate the OpenCard events if the Slot implementation does not support events itself. |
byte[] |
sendTerminalCommand(byte[] cmd)
Send control command to terminal. |
byte[] |
sendTerminalCommand(byte[] cmd,
java.lang.Object lockHandle)
Send control command to terminal. |
protected CardTerminalException |
translatePcscException(PcscException e)
translate the PcscException into CardTerminalException. |
| Methods inherited from class opencard.opt.terminal.AbstractLockableTerminal |
|---|
getSlotLockHandle, getTerminalLockHandle, internalOpenSlotChannel, internalOpenSlotChannel, lock, lockSlot, unlock, unlockSlot |
| Methods inherited from class opencard.core.terminal.CardTerminal |
|---|
addSlots, cardInserted, closeSlotChannel, enumerateSlots, features, getAddress, getName, getSlot, getSlots, getType, internalReset, isCardPresent, isSlotChannelAvailable, isSlotChannelAvailable, openSlotChannel, openSlotChannel, openSlotChannel, reset, reset, reset, sendAPDU, sendAPDU, sendVerifiedCommandAPDU, slots, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected Pcsc10LockableTerminal(java.lang.String name,
java.lang.String type,
java.lang.String address)
throws CardTerminalException
name - The user friendly name.type - The terminal type (here "PCSC")address - not used
CardTerminalException - Thrown when a problem occured.| Method Detail |
|---|
public void open()
throws CardTerminalException
open in class CardTerminalCardTerminalException - thrown in case of initialization-errors
(e.g. couldn't setup transfer protocol between CardTerminal and reader).
public void close()
throws CardTerminalException
close in class CardTerminalCardTerminalException - Thrown if there are problems with closing the
connection
protected CardID internalReset(int slot,
int ms)
throws CardTerminalException
internalReset in class CardTerminalslot - The slot number of the slot to be resetted.ms - To be ignored. If the card does not respond within the time
specified for the protocol an exception should be thrown.
CardTerminalException - thrown in case of errors during resetprotected java.util.Properties internalFeatures(java.util.Properties features)
internalFeatures in class CardTerminalfeatures - A Properties object that needs to be enhanced
with the card terminal specific features.
public boolean isCardPresent(int slot)
throws CardTerminalException
isCardPresent in class CardTerminalslot - Number of the slot to check (must be 0 for PCSC)
CardTerminalException - thrown in case of problems getting the status from CardTerminal
(or other serious problems in the terminal).
public CardID getCardID(int slot,
int timeout)
throws CardTerminalException
getCardID in class CardTerminalCardTerminalException
public CardID getCardID(int slot)
throws CardTerminalException
getCardID in class CardTerminalslot - slot number
CardTerminalException - thrown when problem occured getting the ATR of the card
protected void lockableOpenSlotChannel(int slotID)
throws CardTerminalException
lockableOpenSlotChannel in class AbstractLockableTerminalslotID - The number of the slot for which a SlotChannel is requested.
CardTerminalException
protected void internalCloseSlotChannel(SlotChannel sc)
throws CardTerminalException
internalCloseSlotChannel in class CardTerminalsc - The SlotChannel to close.
CardTerminalException - thrown in case of errors closing the card (e.g. error disconnecting the card).
public byte[] sendTerminalCommand(byte[] cmd)
throws CardTerminalException
sendTerminalCommand in interface TerminalCommandcmd - a byte array containing the command to be sent to the card terminal
CardTerminalException - Exception thrown by driver.TerminalCommand
public byte[] sendTerminalCommand(byte[] cmd,
java.lang.Object lockHandle)
throws CardTerminalException
cmd - a byte array containing the command to be sent to the card terminal
CardTerminalException - Exception thrown by driver.TerminalCommand
protected ResponseAPDU internalSendAPDU(int slot,
CommandAPDU capdu,
int ms)
throws CardTerminalException
internalSendAPDU in class CardTerminalslot - logical slot numbercapdu - C-APDU to send to the cardms - timeout in ms (not supported, ignored)
CardTerminalException - thrown in case of errors in the CardTerminal (e.g. errors during data exchange)protected void cardRemoved(int slotID)
cardRemoved in class CardTerminalslotID - slot number
public void poll()
throws CardTerminalException
poll in interface PollableCardTerminalException - Thrown when error occurred in poll-mechanism.protected CardTerminalException translatePcscException(PcscException e)
protected void internalLock()
throws CardTerminalException
internalLock in class AbstractLockableTerminalCardTerminalException
protected void internalUnlock()
throws CardTerminalException
internalUnlock in class AbstractLockableTerminalCardTerminalException
protected void internalLockSlot(int slotNr)
throws CardTerminalException
internalLockSlot in class AbstractLockableTerminalCardTerminalException
protected void internalUnlockSlot(int slotNr)
throws CardTerminalException
internalUnlockSlot in class AbstractLockableTerminalCardTerminalException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||