JavaCardRemoteClient



com.licel.jcardsim.remote
Class JavaCardRemoteClient

java.lang.Object
  extended by com.licel.jcardsim.remote.JavaCardRemoteClient
All Implemented Interfaces:
CardInterface, JavaCardInterface

public class JavaCardRemoteClient
extends Object
implements JavaCardInterface

RMI client


Constructor Summary
JavaCardRemoteClient(String serverHost, int serverIp)
           
 
Method Summary
 AID createApplet(AID aid, byte[] bArray, short bOffset, byte bLength)
          Create Applet instance in Simulator
 byte[] getATR()
          Returns ATR
 AID installApplet(AID aid, String appletClassName, byte[] appletJarContents, byte[] bArray, short bOffset, byte bLength)
          Install Applet into Simulator.
 AID installApplet(AID aid, String appletClassName, byte[] bArray, short bOffset, byte bLength)
          Install Applet into Simulator.
 AID loadApplet(AID aid, String appletClassName)
          Load Applet into Simulator
 AID loadApplet(AID aid, String appletClassName, byte[] appletJarContents)
          Load Applet into Simulator
 void reset()
          Powerdown/Powerup
 boolean selectApplet(AID aid)
          Select applet by it's AID It's method must be called before start working with applet instance
 byte[] transmitCommand(byte[] data)
          Transmit APDU to previous selected applet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaCardRemoteClient

public JavaCardRemoteClient(String serverHost,
                            int serverIp)
                     throws RemoteException,
                            NotBoundException
Throws:
RemoteException
NotBoundException
Method Detail

loadApplet

public AID loadApplet(AID aid,
                      String appletClassName)
               throws SystemException
Description copied from interface: JavaCardInterface
Load Applet into Simulator

Specified by:
loadApplet in interface JavaCardInterface
Parameters:
aid - applet aid
Returns:
applet AID
Throws:
SystemException - if appletClass not instanceof javacard.framework.Applet

loadApplet

public AID loadApplet(AID aid,
                      String appletClassName,
                      byte[] appletJarContents)
               throws SystemException
Description copied from interface: JavaCardInterface
Load Applet into Simulator

Specified by:
loadApplet in interface JavaCardInterface
Parameters:
aid - applet aid
appletClassName - fully qualified applet class name Strin
appletJarContents - contains a byte array containing a jar file with an applet and its dependent classes
Returns:
applet AID
Throws:
SystemException - if appletClass not instanceof javacard.framework.Applet

createApplet

public AID createApplet(AID aid,
                        byte[] bArray,
                        short bOffset,
                        byte bLength)
                 throws SystemException
Description copied from interface: JavaCardInterface
Create Applet instance in Simulator

Specified by:
createApplet in interface JavaCardInterface
Parameters:
aid - applet aid
bArray - the array containing installation parameters
bOffset - the starting offset in bArray
bLength - the length in bytes of the parameter data in bArray
Returns:
applet AID
Throws:
SystemException - if exception in Applet.install(..) method occurs.

installApplet

public AID installApplet(AID aid,
                         String appletClassName,
                         byte[] bArray,
                         short bOffset,
                         byte bLength)
                  throws SystemException
Description copied from interface: JavaCardInterface
Install Applet into Simulator. This method is equal to: loadApplet(...); createApplet(...);

Specified by:
installApplet in interface JavaCardInterface
Parameters:
aid - applet aid or null
appletClassName - fully qualified applet class name Strin
bArray - the array containing installation parameters
bOffset - the starting offset in bArray
bLength - the length in bytes of the parameter data in bArray
Returns:
applet AID
Throws:
SystemException - if appletClass not instanceof javacard.framework.Applet

installApplet

public AID installApplet(AID aid,
                         String appletClassName,
                         byte[] appletJarContents,
                         byte[] bArray,
                         short bOffset,
                         byte bLength)
                  throws SystemException
Description copied from interface: JavaCardInterface
Install Applet into Simulator. This method is equal to: loadApplet(...); createApplet(...);

Specified by:
installApplet in interface JavaCardInterface
Parameters:
aid - applet aid or null
appletClassName - fully qualified applet class name Strin
appletJarContents - Contains a byte array containing a jar file with an applet and its dependent classes
bArray - the array containing installation parameters
bOffset - the starting offset in bArray
bLength - the length in bytes of the parameter data in bArray
Returns:
applet AID
Throws:
SystemException - if appletClass not instanceof javacard.framework.Applet

selectApplet

public boolean selectApplet(AID aid)
Description copied from interface: JavaCardInterface
Select applet by it's AID It's method must be called before start working with applet instance

Specified by:
selectApplet in interface JavaCardInterface
Parameters:
aid - appletId
Returns:
true if applet selection success

getATR

public byte[] getATR()
Description copied from interface: CardInterface
Returns ATR

Specified by:
getATR in interface CardInterface

transmitCommand

public byte[] transmitCommand(byte[] data)
Description copied from interface: CardInterface
Transmit APDU to previous selected applet

Specified by:
transmitCommand in interface CardInterface
Returns:
response apdu
See Also:
CommandAPDU, ResponseAPDU

reset

public void reset()
Description copied from interface: CardInterface
Powerdown/Powerup

Specified by:
reset in interface CardInterface