public class JCSystemProxy extends Object
JCSystemJCSystem| Constructor and Description |
|---|
JCSystemProxy() |
| Modifier and Type | Method and Description |
|---|---|
static void |
abortTransaction()
Aborts the atomic transaction.
|
static void |
beginTransaction()
Begins an atomic transaction.
|
static void |
commitTransaction()
Commits an atomic transaction.
|
static javacard.framework.AID |
getAID()
Returns the Java Card runtime environment-owned instance of the
AID object associated with
the current applet context, or
null if the Applet.register() method
has not yet been invoked. |
static javacard.framework.Shareable |
getAppletShareableInterfaceObject(javacard.framework.AID serverAID,
byte parameter)
Called by a client applet to get a server applet's
shareable interface object.
|
static byte |
getAssignedChannel()
This method is called to obtain the logical channel number assigned to
the currently selected applet instance.
|
static short |
getAvailableMemory(byte memoryType)
Obtains the amount of memory of the specified
type that is available to the applet.
|
static short |
getMaxCommitCapacity()
Returns the total number of bytes in the commit buffer.
|
static javacard.framework.AID |
getPreviousContextAID()
Obtains the Java Card runtime environment-owned instance of the
AID object associated
with the previously active applet context. |
static byte |
getTransactionDepth()
Returns the current transaction nesting depth level.
|
static short |
getUnusedCommitCapacity()
Returns the number of bytes left in the commit buffer.
|
static short |
getVersion()
Returns the current major and minor version of the Java Card API.
|
static boolean |
isAppletActive(javacard.framework.AID theApplet)
This method is used to determine if the specified applet is
active on the card.
|
static boolean |
isObjectDeletionSupported()
This method is used to determine if the implementation for the Java Card platform supports
the object deletion mechanism.
|
static byte |
isTransient(Object theObj)
Checks if the specified object is transient.
|
static javacard.framework.AID |
lookupAID(byte[] buffer,
short offset,
byte length)
Returns the Java Card runtime environment-owned instance of the
AID object, if any,
encapsulating the specified AID bytes in the buffer parameter
if there exists a successfully installed applet on the card whose instance AID
exactly matches that of the specified AID bytes. |
static Object |
makeGlobalArray(byte type,
short length)
Creates a global
CLEAR_ON_RESET transient array of the type specified, with the specified array length. |
static boolean[] |
makeTransientBooleanArray(short length,
byte event)
Creates a transient boolean array with the specified array length.
|
static byte[] |
makeTransientByteArray(short length,
byte event)
Creates a transient byte array with the specified array length.
|
static Object[] |
makeTransientObjectArray(short length,
byte event)
Creates a transient array of
Object with the specified array length. |
static short[] |
makeTransientShortArray(short length,
byte event)
Creates a transient short array with the specified array length.
|
static void |
requestObjectDeletion()
This method is invoked by the applet to trigger the object deletion
service of the Java Card runtime environment.
|
public static byte isTransient(Object theObj)
Note:
NOT_A_TRANSIENT_OBJECT if the specified object is
null or is not an array type.theObj - the object being queriedNOT_A_TRANSIENT_OBJECT, CLEAR_ON_RESET, or CLEAR_ON_DESELECTmakeTransientBooleanArray(short, byte),
makeTransientByteArray(short, byte),
makeTransientObjectArray(short, byte),
makeTransientShortArray(short, byte)public static boolean[] makeTransientBooleanArray(short length,
byte event)
throws NegativeArraySizeException,
javacard.framework.SystemException
length - the length of the boolean arrayevent - the CLEAR_ON... event which causes the array elements to be clearedNegativeArraySizeException - if the length parameter is negativejavacard.framework.SystemException - with the following reason codes:
SystemException.ILLEGAL_VALUE if event is not a valid event code.
SystemException.NO_TRANSIENT_SPACE if sufficient transient space is not available.
SystemException.ILLEGAL_TRANSIENT if the current applet context
is not the currently selected applet context and CLEAR_ON_DESELECT is specified.
public static byte[] makeTransientByteArray(short length,
byte event)
throws NegativeArraySizeException,
javacard.framework.SystemException
length - the length of the byte arrayevent - the CLEAR_ON... event which causes the array elements to be clearedNegativeArraySizeException - if the length parameter is negativejavacard.framework.SystemException - with the following reason codes:
SystemException.ILLEGAL_VALUE if event is not a valid event code.
SystemException.NO_TRANSIENT_SPACE if sufficient transient space is not available.
SystemException.ILLEGAL_TRANSIENT if the current applet context
is not the currently selected applet context and CLEAR_ON_DESELECT is specified.
public static short[] makeTransientShortArray(short length,
byte event)
throws NegativeArraySizeException,
javacard.framework.SystemException
length - the length of the short arrayevent - the CLEAR_ON... event which causes the array elements to be clearedNegativeArraySizeException - if the length parameter is negativejavacard.framework.SystemException - with the following reason codes:
SystemException.ILLEGAL_VALUE if event is not a valid event code.
SystemException.NO_TRANSIENT_SPACE if sufficient transient space is not available.
SystemException.ILLEGAL_TRANSIENT if the current applet context
is not the currently selected applet context and CLEAR_ON_DESELECT is specified.
public static Object[] makeTransientObjectArray(short length, byte event) throws NegativeArraySizeException, javacard.framework.SystemException
Object with the specified array length.length - the length of the Object arrayevent - the CLEAR_ON... event which causes the array elements to be clearedNegativeArraySizeException - if the length parameter is negativejavacard.framework.SystemException - with the following reason codes:
SystemException.ILLEGAL_VALUE if event is not a valid event code.
SystemException.NO_TRANSIENT_SPACE if sufficient transient space is not available.
SystemException.ILLEGAL_TRANSIENT if the current applet context
is not the currently selected applet context and CLEAR_ON_DESELECT is specified.
public static Object makeGlobalArray(byte type, short length)
CLEAR_ON_RESET transient array of the type specified, with the specified array length.
A global array can be accessed from any applet context.
References to global arrays cannot be stored in class variables or instance variables or array components.
(See Runtime Environment Specification, Java Card Platform, Classic Edition, section 6.2.2 for details)type - the array type - must be one of : ARRAY_TYPE_BOOLEAN, ARRAY_TYPE_BYTE, ARRAY_TYPE_SHORT, ARRAY_TYPE_INT, or ARRAY_TYPE_OBJECTlength - the length of the global transient arrayNegativeArraySizeException - if the length parameter is negativejavacard.framework.SystemException - with the following reason codes:
SystemException.ILLEGAL_VALUE if type is not a valid type code. An implementation which does not support the "int" type may throw this exception if type is ARRAY_TYPE_INT
SystemException.NO_TRANSIENT_SPACE if sufficient transient space is not available.
public static short getVersion()
public static javacard.framework.AID getAID()
AID object associated with
the current applet context, or
null if the Applet.register() method
has not yet been invoked.
Java Card runtime environment-owned instances of AID are permanent Java Card runtime environment
Entry Point Objects and can be accessed from any applet context.
References to these permanent objects can be stored and re-used.
See Runtime Environment Specification for the Java Card Platform, section 6.2.1 for details.
AID objectpublic static javacard.framework.AID lookupAID(byte[] buffer,
short offset,
byte length)
AID object, if any,
encapsulating the specified AID bytes in the buffer parameter
if there exists a successfully installed applet on the card whose instance AID
exactly matches that of the specified AID bytes.
Java Card runtime environment-owned instances of AID are permanent Java Card runtime environment
Entry Point Objects and can be accessed from any applet context.
References to these permanent objects can be stored and re-used.
See Runtime Environment Specification for the Java Card Platform, section 6.2.1 for details.
buffer - byte array containing the AID bytesoffset - offset within buffer where AID bytes beginlength - length of AID bytes in bufferAID object, if any; null otherwise. A VM exception
is thrown if buffer is null,
or if offset or length are out of range.public static void beginTransaction()
throws javacard.framework.TransactionException
Note:
Applet.register()
method has not yet been invoked. In case of tear or failure prior to successful
registration, the Java Card runtime environment will roll back all atomically updated persistent state.
javacard.framework.TransactionException - with the following reason codes:
TransactionException.IN_PROGRESS if a transaction is already in progress.
abortTransaction(),
commitTransaction()public static void abortTransaction()
throws javacard.framework.TransactionException
Note:
Applet.register()
method has not yet been invoked. In case of tear or failure prior to successful
registration, the Java Card runtime environment will roll back all atomically updated persistent state.
null reference.
javacard.framework.TransactionException - - with the following reason codes:
TransactionException.NOT_IN_PROGRESS if a transaction is not in progress.
beginTransaction(),
commitTransaction()public static void commitTransaction()
throws javacard.framework.TransactionException
Note:
Applet.register()
method has not yet been invoked. In case of tear or failure prior to successful
registration, the Java Card runtime environment will roll back all atomically updated persistent state.
javacard.framework.TransactionException - ith the following reason codes:
TransactionException.NOT_IN_PROGRESS if a transaction is not in progress.
beginTransaction(),
abortTransaction()public static byte getTransactionDepth()
public static short getUnusedCommitCapacity()
Note:
getMaxCommitCapacity()public static short getMaxCommitCapacity()
Note:
getUnusedCommitCapacity()public static javacard.framework.AID getPreviousContextAID()
AID object associated
with the previously active applet context. This method is typically used by a server applet,
while executing a shareable interface method to determine the identity of its client and
thereby control access privileges.
Java Card runtime environment-owned instances of AID are permanent Java Card runtime environment
Entry Point Objects and can be accessed from any applet context.
References to these permanent objects can be stored and re-used.
See Runtime Environment Specification for the Java Card Platform, section 6.2.1 for details.
AID object of the previous context, or null if Java Card runtime environmentpublic static short getAvailableMemory(byte memoryType)
throws javacard.framework.SystemException
Notes:
memoryType - the type of memory being queried. One of the MEMORY_TYPE_..
constants defined abovejavacard.framework.SystemException - with the following reason codes:SystemException.ILLEGAL_VALUE if memoryType is not a
valid memory type.
public static javacard.framework.Shareable getAppletShareableInterfaceObject(javacard.framework.AID serverAID,
byte parameter)
This method returns null
if:
Applet.register() has not yet been invokednullserverAID - the AID of the server appletparameter - optional parameter datanullApplet.getShareableInterfaceObject(AID, byte)public static boolean isObjectDeletionSupported()
true if the object deletion mechanism is supported, false otherwisepublic static void requestObjectDeletion()
throws javacard.framework.SystemException
Applet.process() method. The object deletion
mechanism must ensure that :
Applet.process() method.
CLEAR_ON_DESELECT or CLEAR_ON_RESET
transient object owned by the current applet context is deleted
and the associated space is recovered for reuse before the next card reset session.
javacard.framework.SystemException - with the following reason codes:SystemException.ILLEGAL_USE if the object deletion mechanism is
not implemented.
public static byte getAssignedChannel()
Applet.select(), Applet.deselect(),
MultiSelectable.select(boolean) and MultiSelectable.deselect(boolean) methods
during MANAGE CHANNEL APDU command processing, the logical channel number
returned may be different.public static boolean isAppletActive(javacard.framework.AID theApplet)
Note:
false if the specified applet is
not active, even if its context is active.
theApplet - the AID of the applet object being queriedtrue if and only if the applet specified by the
AID parameter is currently active on this or another logical channel