Card Terminal Interaction
When a Java Card technology-enabled smart card is powered up, the card sends an ATR (Answer to Reset) to the terminal. The Card Accessor returns the value of the ATR to the client program (shown in Figure 13-1).
Figure 13-1 Smart Card Sends an ATR to the Terminal
Description of "Figure 13-1 Smart Card Sends an ATR to the Terminal"
When the PurseClient
application calls the selectApplet
method of JavaCardRMIConnect
, it sends a SELECT APDU
command to the card via the CardAccessor
object. This results in a File Control Information (FCI
) APDU response from the RMIService
instance of PurseApplet
on the card in a TLV (Tag Length Value) format that includes the initial reference remote object information (shown in Figure 13-2).
Figure 13-2 Terminal Sends a SELECT Command to the Smart Card, Which Returns FCI
Description of "Figure 13-2 Terminal Sends a SELECT Command to the Smart Card, Which Returns FCI"
Later, when the PurseClient
application calls the debit
method of the remote interface Purse
, the PurseImpl_Stub
object sends an INVOKE
command to the card via the CardAccessor
object, identifying the remote object reference, interface, method, and parameter data for method invocation. The RMIService
instance of PurseApplet
unmarshalls this information and invokes the debit
method of the PurseImpl
instance, and returns the return value in the response RETURN
APDU (shown in Figure 13-3).
Figure 13-3 Terminal Sends an INVOKE Command to the Smart Card, Which Returns a Value
Description of "Figure 13-3 Terminal Sends an INVOKE Command to the Smart Card, Which Returns a Value"