Package de.cardcontact.ctapi
Class CTAPI
- java.lang.Object
-
- de.cardcontact.ctapi.CTAPI
-
public class CTAPI extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
CT
static int
ERR_CT
static int
ERR_HOST
static int
ERR_INVALID
static int
ERR_MEMORY
static int
ERR_TRANS
static int
HOST
static int
ICC1
static int
ICC2
static int
NO_READER_NAME
static int
OK
static int
REMOTE_HOST
-
Constructor Summary
Constructors Constructor Description CTAPI(java.lang.String libname)
Create a CT-API access object for a given shared object / DLL
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkEvent()
int
CT_Close(int ctn)
Close Host to Card Terminal connectionint
CT_Data(int ctn, byte dad, byte sad, byte[] command, int lenr, byte[] response)
Exchange an Application Protocol Data Unit (APDU) with the card terminal.int
CT_Init(int ctn, int pn)
Initialize Host to Card Terminal connection.java.util.List<CTAPITerminal>
CT_List()
java.util.List<CTAPITerminal>
CT_List(boolean noName)
void
setEventListener(ICTAPIEvent eventListener)
-
-
-
Field Detail
-
OK
public static final int OK
- See Also:
- Constant Field Values
-
ERR_INVALID
public static final int ERR_INVALID
- See Also:
- Constant Field Values
-
ERR_CT
public static final int ERR_CT
- See Also:
- Constant Field Values
-
ERR_TRANS
public static final int ERR_TRANS
- See Also:
- Constant Field Values
-
ERR_MEMORY
public static final int ERR_MEMORY
- See Also:
- Constant Field Values
-
ERR_HOST
public static final int ERR_HOST
- See Also:
- Constant Field Values
-
ICC1
public static final int ICC1
- See Also:
- Constant Field Values
-
CT
public static final int CT
- See Also:
- Constant Field Values
-
HOST
public static final int HOST
- See Also:
- Constant Field Values
-
ICC2
public static final int ICC2
- See Also:
- Constant Field Values
-
REMOTE_HOST
public static final int REMOTE_HOST
- See Also:
- Constant Field Values
-
NO_READER_NAME
public static final int NO_READER_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
CT_Init
public int CT_Init(int ctn, int pn)
Initialize Host to Card Terminal connection.- Parameters:
ctn
- the logical card terminal number assigned by the caller and used in subsequent CT_Data and CT_Close callspn
- the port number representing the physical port- Returns:
- the return code
-
CT_Close
public int CT_Close(int ctn)
Close Host to Card Terminal connection- Parameters:
ctn
- the logical card terminal number- Returns:
- the return code
-
CT_Data
public int CT_Data(int ctn, byte dad, byte sad, byte[] command, int lenr, byte[] response)
Exchange an Application Protocol Data Unit (APDU) with the card terminal. The API works like the native CT_Data API, with exception of the lenr parameter which in inbound only. The value for lenr returned by the CT-API device is passed as result of the method instead- Parameters:
ctn
- the logical card terminal numberdad
- the destination address (ICC1, CT, ICC2...)sad
- the source address (usually HOST)lenc
- the number of bytes to be send from command. Must be less or equal command.length()command
- the outgoing command byteslenr
- the number of bytes reserved in response. Must be less or equal response.length()response
- the buffer allocated to receive the response- Returns:
- the number of bytes placed in response or one of the negative error codes
-
CT_List
public java.util.List<CTAPITerminal> CT_List() throws CTAPIException
- Throws:
CTAPIException
-
CT_List
public java.util.List<CTAPITerminal> CT_List(boolean noName) throws CTAPIException
- Throws:
CTAPIException
-
setEventListener
public void setEventListener(ICTAPIEvent eventListener)
-
checkEvent
public void checkEvent()
-
-