com.sun.javacard.clientlib
Interface CardAccessor

All Known Implementing Classes:
ApduIOCardAccessor

public interface CardAccessor

The CardAccessor interface represents a generic smartcard communication API. The interface based definition makes it platform and framework independent. This interface is used by Java Card RMI stubs to access the smart card.


Method Summary
 void closeCard()
          This method closes and resets the card
 byte[] exchangeAPDU(byte[] sendData)
          This method sends the specified data to the smartcard, waits for the response and returns the response in the return data.
 

Method Detail

exchangeAPDU

byte[] exchangeAPDU(byte[] sendData)
                    throws java.io.IOException
This method sends the specified data to the smartcard, waits for the response and returns the response in the return data. The input data is assumed to be formatted for ISO 7816-4 APDU communication as follows : [0] = CLA, [1]= INS, [2] = P1, [3]= P2, [4]=Lc, [4..]= command data. The response data is formatted for ISO 7816-4 APDU communication as follows : [0] = SW1, [1]= SW2, [2..]= response data.

Parameters:
sendData - the ISO 7816-4 formatted command APDU data with 5 bytes of header followed by the command data.
Returns:
responseData contains the response received from card with the 2 status bytes followed by the response data.
Throws:
java.io.IOException - if communication error occurs

closeCard

void closeCard()
               throws java.lang.Exception
This method closes and resets the card

Throws:
java.lang.Exception - Exception with a message about the problem.