org.javacardforum.management
Interface CardManagement


public interface CardManagement

Defines a low level interface to the information needed to load, install and operate applets in a JavaCard (see loading parameters in ETSI 03.19). Defines an interface to the minimum information required to identify the card and to retrieve information about the resources available in the card.


Method Summary
 AID getAID(AID aid)
          Allows to iterate over all AID stored in the card.
 CardGUID getCardGUID()
          Retrieves the global unique identifier for this card from the underlying system.
 byte getCardLifecycleModel()
          Retrieves the type of the card lifecylemodel as a byte (these type indicators has to be defined) could also be included in the CID data
 byte getCardState()
          Get the actual state of the lifecyclemodel (these state indicators has to be defined) could also be included in the CID data
 short getCID(byte[] dest, short destOffset, short cidOffset, byte length)
          copy CID data into the buffer
 short getFreeNonVolatileMemory()
          Retrieves the number of bytes of the free non volatile memory
 short getFreeVolatileMemory()
          Retrieves the number of bytes of the free volatile memory
 short getJVMID()
          Gives the build version of the VM in the card.
 short getJVMVersion()
          Returns the current major and minor version of the Java VM
In JCSystem we have already a method to retrieve the version info of the "JavaCard API", however in the future the version number of the VM and of the JavaCard API can differentiate.
 short getLargestFreeBlockNonVolatileMemory()
          Retrieves the number of bytes in the largest free memory block
 byte getLifecycleModel(org.javacardforum.management.AID aid)
          Retrieves the type of the lifecycle for an applet identified by an AID (these type indicators has to be defined)
 short getMinimumFreeVolatileMemory()
          Retrieves the number of bytes of the free volatile memory
 byte getState(org.javacardforum.management.AID aid)
          Get the actual state of an applet identified by an AID (these state indicators has to be defined) could also be included in the CID data
 void setCardState(byte state)
          Set the actual state of the lifecyclemodel (these state indicators has to be defined)
 void setLifecycleModel(org.javacardforum.management.AID aid)
          Set the type of the lifecycle for an applet identified by an AID (these type indicators has to be defined)
 void setState(org.javacardforum.management.AID aid, byte state)
          Set the actual state of an applet identified by an AID (these state indicators has to be defined) could also be included in the CID data
 

Method Detail

getCID

public short getCID(byte[] dest,
                    short destOffset,
                    short cidOffset,
                    byte length)
copy CID data into the buffer
Parameters:
dest - destination byte array for the
destOffset - offset within destination byte array to start copy into
cidOffset - offset within the CID buffer to start copy from
length - length to be copied.
Returns:
destOffset + length

getCardGUID

public CardGUID getCardGUID()
Retrieves the global unique identifier for this card from the underlying system.
Returns:
the CardGUID object

getFreeNonVolatileMemory

public short getFreeNonVolatileMemory()
Retrieves the number of bytes of the free non volatile memory
Returns:
the free bytes in the non volatile memory

getLargestFreeBlockNonVolatileMemory

public short getLargestFreeBlockNonVolatileMemory()
Retrieves the number of bytes in the largest free memory block
Returns:
number of free bytes of the largest block in non valatilmemory

getFreeVolatileMemory

public short getFreeVolatileMemory()
Retrieves the number of bytes of the free volatile memory
Returns:
the number of bytes free in the volatile memory

getMinimumFreeVolatileMemory

public short getMinimumFreeVolatileMemory()
Retrieves the number of bytes of the free volatile memory
Returns:
the minimum number of bytes free in the volatile memory

getAID

public AID getAID(AID aid)
Allows to iterate over all AID stored in the card. We assume that the AID of all packages and applets loaded and installed in the card are stored in a card-specific order. The actual JavaCard 2.1 specification does not define the way how and in which order we storre these data in the JCRE. Also it is not defined how we can distinguish between AID's assigned to a package or to an Applet. Therefor this method allows only to iterate over all the AID's currently stored in the JCRE.
Definition:
  • if the parameter of the method is null the first AID stored in the card is returned
  • if the parameter of the method is an AID stored in the card the AID following the given AID is returned
  • if the parameter of the method is an AID stored in the card and there is no following AID the return value is null
  • Parameters:
    aid - the next AID in the card, null will give the first aid
    Returns:
    the next AID or null if the given aid was the last AID

    getJVMVersion

    public short getJVMVersion()
    Returns the current major and minor version of the Java VM
    In JCSystem we have already a method to retrieve the version info of the "JavaCard API", however in the future the version number of the VM and of the JavaCard API can differentiate. Therefor we think we need a special version info only for the VM.
    Returns:
    version number as byte.byte (major.minor)
    See Also:
    javacard.framework.JCSystem

    getJVMID

    public short getJVMID()
    Gives the build version of the VM in the card.
    This should be useful to identify VM's that are compliant to a specification but have some bug fixes or implementing additional features.
    Returns:
    the identifier for this specific VM

    getCardLifecycleModel

    public byte getCardLifecycleModel()
    Retrieves the type of the card lifecylemodel as a byte (these type indicators has to be defined) could also be included in the CID data
    Returns:
    the type of the card lifecycle

    getCardState

    public byte getCardState()
    Get the actual state of the lifecyclemodel (these state indicators has to be defined) could also be included in the CID data
    Returns:
    the type of the card lifecycle

    setCardState

    public void setCardState(byte state)
    Set the actual state of the lifecyclemodel (these state indicators has to be defined)
    Parameters:
    state - the new state of the card

    getLifecycleModel

    public byte getLifecycleModel(org.javacardforum.management.AID aid)
    Retrieves the type of the lifecycle for an applet identified by an AID (these type indicators has to be defined)
    Parameters:
    aid - of the applet
    Returns:
    the type of the card lifecycle

    setLifecycleModel

    public void setLifecycleModel(org.javacardforum.management.AID aid)
    Set the type of the lifecycle for an applet identified by an AID (these type indicators has to be defined)
    Parameters:
    aid - of the applet

    getState

    public byte getState(org.javacardforum.management.AID aid)
    Get the actual state of an applet identified by an AID (these state indicators has to be defined) could also be included in the CID data
    Parameters:
    aid - of the applet
    Returns:
    the type of the card lifecycle

    setState

    public void setState(org.javacardforum.management.AID aid,
                         byte state)
    Set the actual state of an applet identified by an AID (these state indicators has to be defined) could also be included in the CID data
    Parameters:
    aid - of the applet
    the - new state of the applet