Java Magazine, Nov/Dec 2017
O Target Host Side Command APDU On Target Java Card RE Response APDU CAD Figure 5 Java Card communication with outside devices ORACLE COM JAVAMAGAZINE NOVEMBER DECEMBER 2017 89 java card Applet Applet Applet example serial port I2C and SPI for contacted I O interfaces and ISO 1443 or SWP for contactless interfaces The communication model is a command response model where a Java Card applet acts as a server receiving requests from a client application running within the CAD see Figure 5 The Java Card VM processes one command at a time there is no thread support but the runtime can manage diferent sessions with a given applet and diferent applets at the same time Defining the protocol supported by an applet entails defining the APDUs to process This is one of the first steps if not the first step to developing an applet The Application Model All Java Card applications must extend the javacard framework Applet class The following are the typical methods to implement The applet constructor is invoked only once by the install method It serves to allocate objects that will be used during the entire lifetime of the applet to ensure that the applet will not lack memory The install static method is invoked by the Java Card RE during the applet installation process to create an instance of the applet The applet should perform any necessary initializations and must call one of the register methods successfully to complete the installation process The register method specifies the applet identifier AID as defined in ISO 7816 5 of the applet to be used to select the applet later
You must have JavaScript enabled to view digital editions.