package aspects; import javacard.framework.APDU; import javacard.framework.ISO7816; import javacard.security.KeyPair; import anoncard.ANONCardApplet; import anoncard.ANONCardAppletConfiguration; import anoncard.DataReceiveChannel; import anoncard.DataSendChannel; import anoncard.Log; import anoncard.Date; /** * This aspect makes the ANONCardApplet class testable. It is only used for * testing. * * Basically it allows to acces private fields. * * @author christoph * */ public privileged aspect ANONCardAppletAspect { /** * Part of a Wrapper for the key generation for testing. */ private boolean ANONCardApplet.initialized = false; /** * Part of a Wrapper for the key generation for testing. */ boolean around(ANONCardApplet applet) : target(applet) && call(boolean isInitialized()) { return applet.initialized; } /** * Part of a Wrapper for the key generation for testing. */ void around(ANONCardApplet applet) : target(applet) && call(void generateKeyPair()) { applet.initialized = true; } /** * Returns the current configuration. */ public ANONCardAppletConfiguration ANONCardApplet.getConfiguration() { return configuration; } /** * Returns the current configuration. */ public boolean ANONCardApplet.getIsTransactionOpen() { return isTransactionOpen; } /** * Returns the data transmission channel. */ public DataReceiveChannel ANONCardApplet.getDataReceiveChannel() { return dataReceiveChannel; } /** * Returns the data transmission channel. */ public DataSendChannel ANONCardApplet.getDataSendChannel() { return dataSendChannel; } /** * Returns the log. */ public Log ANONCardApplet.getLog() { return log; } /** * Returns the log. */ public Date ANONCardApplet.getDate() { return date; } }