public class SimulatorRuntime extends Object
JCSystem,
Applet| Modifier and Type | Class and Description |
|---|---|
static class |
SimulatorRuntime.ApplicationInstance
Represents an Applet instance
|
| Modifier and Type | Field and Description |
|---|---|
protected Method |
apduPrivateResetMethod
method for resetting APDUs
|
protected SortedMap<javacard.framework.AID,SimulatorRuntime.ApplicationInstance> |
applets
storage for installed applets
|
protected javacard.framework.AID |
currentAID
current selected applet
|
protected byte |
currentProtocol
current protocol
|
protected javacard.framework.APDU |
extendedAPDU
extended APDU
|
protected SortedMap<javacard.framework.AID,javacard.framework.AID> |
generatedLoadFileAIDs
storage for automatically generated loadFile AIDs
|
protected SortedMap<javacard.framework.AID,LoadFile> |
loadFiles
storage for load files
|
protected Object |
previousActiveObject
previousActiveObject
|
protected javacard.framework.AID |
previousAID
previous selected applet
|
protected ThreadLocal<BiConsumer<javacard.framework.Applet,javacard.framework.AID>> |
registrationCallback |
protected byte[] |
responseBuffer
outbound response byte array buffer
|
protected short |
responseBufferSize
outbound response byte array buffer size
|
protected boolean |
selecting
if the applet is currently being selected
|
protected javacard.framework.APDU |
shortAPDU
regular APDU
|
protected byte |
transactionDepth
current depth of transaction
|
protected TransientMemory |
transientMemory
transient memory
|
protected boolean |
usingExtendedAPDUs
if extended APDUs are used
|
| Constructor and Description |
|---|
SimulatorRuntime() |
SimulatorRuntime(TransientMemory transientMemory) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortTransaction() |
protected void |
activateSimulatorRuntimeInstance()
Register
this with SimulatorRuntime |
void |
beginTransaction() |
void |
changeProtocol(byte protocol)
Change protocol
|
void |
commitTransaction() |
protected void |
deleteApplet(javacard.framework.AID aid)
Delete applet
|
protected void |
deselect(SimulatorRuntime.ApplicationInstance applicationInstance) |
protected javacard.framework.AID |
findAppletForSelectApdu(byte[] selectApdu,
ApduCase apduCase) |
javacard.framework.AID |
getAID() |
protected javacard.framework.Applet |
getApplet(javacard.framework.AID aid)
Return
Applet by it's AID or null |
byte |
getAssignedChannel() |
short |
getAvailablePersistentMemory() |
short |
getAvailableTransientDeselectMemory() |
short |
getAvailableTransientResetMemory() |
javacard.framework.APDU |
getCurrentAPDU() |
short |
getJavaContext(Object obj) |
Object |
getJavaOwner(Object obj) |
short |
getMaxCommitCapacity() |
Object |
getPreviousActiveObject() |
javacard.framework.AID |
getPreviousContextAID() |
javacard.framework.Shareable |
getSharedObject(javacard.framework.AID serverAID,
byte parameter) |
byte |
getTransactionDepth() |
TransientMemory |
getTransientMemory() |
short |
getUnusedCommitCapacity() |
void |
installApplet(javacard.framework.AID loadFileAID,
javacard.framework.AID moduleAID,
javacard.framework.AID appletAID,
byte[] bArray,
short bOffset,
byte bLength) |
void |
installApplet(javacard.framework.AID appletAid,
byte[] bArray,
short bOffset,
byte bLength) |
boolean |
isAppletSelecting(Object aThis)
Check if applet is currently being selected
|
protected static boolean |
isAppletSelectionApdu(byte[] apdu) |
boolean |
isObjectDeletionSupported() |
void |
loadApplet(javacard.framework.AID aid,
Class<? extends javacard.framework.Applet> appletClass)
Load applet
|
void |
loadLoadFile(LoadFile loadFile)
Load a LoadFile
|
javacard.framework.AID |
lookupAID(byte[] buffer,
short offset,
byte length)
Lookup applet by aid contains in byte array
|
SimulatorRuntime.ApplicationInstance |
lookupApplet(javacard.framework.AID lookupAid)
Lookup applet by aid
|
void |
requestObjectDeletion() |
void |
reset()
powerdown/powerup
|
protected void |
resetAPDU(javacard.framework.APDU apdu,
ApduCase apduCase,
byte[] buffer) |
void |
resetRuntime() |
void |
sendAPDU(byte[] buffer,
short bOff,
short len)
Copy response bytes to internal buffer
|
void |
setJavaOwner(Object obj,
Object owner) |
void |
setPreviousActiveObject(Object previousActiveObject) |
byte[] |
transmitCommand(byte[] command)
Transmit APDU to previous selected applet
|
protected final ThreadLocal<BiConsumer<javacard.framework.Applet,javacard.framework.AID>> registrationCallback
protected final SortedMap<javacard.framework.AID,SimulatorRuntime.ApplicationInstance> applets
protected final SortedMap<javacard.framework.AID,LoadFile> loadFiles
protected final SortedMap<javacard.framework.AID,javacard.framework.AID> generatedLoadFileAIDs
protected final Method apduPrivateResetMethod
protected final byte[] responseBuffer
protected final TransientMemory transientMemory
protected final javacard.framework.APDU shortAPDU
protected final javacard.framework.APDU extendedAPDU
protected javacard.framework.AID currentAID
protected javacard.framework.AID previousAID
protected short responseBufferSize
protected boolean selecting
protected boolean usingExtendedAPDUs
protected byte currentProtocol
protected byte transactionDepth
protected Object previousActiveObject
public SimulatorRuntime()
public SimulatorRuntime(TransientMemory transientMemory)
protected final void activateSimulatorRuntimeInstance()
this with SimulatorRuntimepublic javacard.framework.AID getAID()
public javacard.framework.AID lookupAID(byte[] buffer,
short offset,
byte length)
buffer - the byte array containing the AID bytesoffset - the start of AID bytes in bufferlength - the length of the AID bytes in bufferpublic SimulatorRuntime.ApplicationInstance lookupApplet(javacard.framework.AID lookupAid)
lookupAid - applet AIDpublic javacard.framework.AID getPreviousContextAID()
protected javacard.framework.Applet getApplet(javacard.framework.AID aid)
Applet by it's AID or nullaid - applet AIDpublic void loadApplet(javacard.framework.AID aid,
Class<? extends javacard.framework.Applet> appletClass)
aid - Applet AIDappletClass - Applet classpublic void loadLoadFile(LoadFile loadFile)
loadFile - LoadFile to loadprotected void deleteApplet(javacard.framework.AID aid)
aid - Applet AID to deletepublic boolean isAppletSelecting(Object aThis)
aThis - appletpublic byte[] transmitCommand(byte[] command)
throws javacard.framework.SystemException
command - command apdujavacard.framework.SystemExceptionprotected javacard.framework.AID findAppletForSelectApdu(byte[] selectApdu,
ApduCase apduCase)
protected void deselect(SimulatorRuntime.ApplicationInstance applicationInstance)
public void sendAPDU(byte[] buffer,
short bOff,
short len)
buffer - source byte arraybOff - the starting offset in bufferlen - the length in bytes of the responsepublic void reset()
public void resetRuntime()
public TransientMemory getTransientMemory()
protected void resetAPDU(javacard.framework.APDU apdu,
ApduCase apduCase,
byte[] buffer)
public javacard.framework.APDU getCurrentAPDU()
public void changeProtocol(byte protocol)
protocol - protocol bitsAPDU.getProtocol()public byte getAssignedChannel()
public void beginTransaction()
JCSystem.beginTransaction()public void abortTransaction()
JCSystem.abortTransaction()public void commitTransaction()
JCSystem.commitTransaction()public byte getTransactionDepth()
JCSystem.getTransactionDepth()public short getUnusedCommitCapacity()
JCSystem.getUnusedCommitCapacity()public short getMaxCommitCapacity()
JCSystem.getMaxCommitCapacity()public short getAvailablePersistentMemory()
JCSystem.getAvailableMemory(byte)public short getAvailableTransientResetMemory()
JCSystem.getAvailableMemory(byte)public short getAvailableTransientDeselectMemory()
JCSystem.getAvailableMemory(byte)public javacard.framework.Shareable getSharedObject(javacard.framework.AID serverAID,
byte parameter)
serverAID - the AID of the server appletparameter - optional parameter datanullJCSystem.getAppletShareableInterfaceObject(javacard.framework.AID, byte)public boolean isObjectDeletionSupported()
JCSystem.isObjectDeletionSupported()public void requestObjectDeletion()
JCSystem.requestObjectDeletion()public short getJavaContext(Object obj)
public Object getPreviousActiveObject()
public void setPreviousActiveObject(Object previousActiveObject)
protected static boolean isAppletSelectionApdu(byte[] apdu)
public void installApplet(javacard.framework.AID appletAid,
byte[] bArray,
short bOffset,
byte bLength)
public void installApplet(javacard.framework.AID loadFileAID,
javacard.framework.AID moduleAID,
javacard.framework.AID appletAID,
byte[] bArray,
short bOffset,
byte bLength)