Class CTAPI


  • public class CTAPI
    extends java.lang.Object
    • 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 connection
      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.
      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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CTAPI

        public CTAPI​(java.lang.String libname)
        Create a CT-API access object for a given shared object / DLL
        Parameters:
        readername - the shared object or DLL name
    • 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 calls
        pn - 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 number
        dad - 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 bytes
        lenr - 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
      • setEventListener

        public void setEventListener​(ICTAPIEvent eventListener)
      • checkEvent

        public void checkEvent()