TestApplet: include object deletion test
This commit is contained in:
@@ -8,6 +8,7 @@ public final class Data {
|
||||
public static final byte INS_TEST_RSA_CRT = (byte)0x02;
|
||||
public static final byte INS_TEST_EC = (byte)0x03;
|
||||
public static final byte INS_TEST_PIN = (byte)0x04;
|
||||
public static final byte INS_TEST_DELETION = (byte)0x05;
|
||||
|
||||
public static final short SW_FAILED_TO_BUILD_PRIV_KEY = (short)0x6500;
|
||||
public static final short SW_FAILED_TO_BUILD_PUB_KEY = (short)0x6501;
|
||||
@@ -15,6 +16,7 @@ public final class Data {
|
||||
public static final short SW_PUB_KEY_NOT_INITIALIZED = (short)0x6503;
|
||||
public static final short SW_PIN_INVALID = (short)0x6504;
|
||||
public static final short SW_PIN_EMPTY = (short)0x6505;
|
||||
public static final short SW_DELETION_NOT_SUPPORTED = (short)0x6506;
|
||||
|
||||
public static final short BUFFER_RED_LENGTH = (short)0x200;
|
||||
public static final short BUFFER_BLACK_LENGTH = (short)0x200;
|
||||
|
@@ -341,6 +341,13 @@ public final class TestApplet extends Applet {
|
||||
}
|
||||
}
|
||||
|
||||
private final void processDeletion() {
|
||||
if(!JCSystem.isObjectDeletionSupported()) {
|
||||
ISOException.throwIt(Data.SW_DELETION_NOT_SUPPORTED);
|
||||
}
|
||||
JCSystem.requestObjectDeletion();
|
||||
}
|
||||
|
||||
public final void process(final APDU apdu) {
|
||||
final byte[] apdubuf = apdu.getBuffer();
|
||||
|
||||
@@ -376,6 +383,10 @@ public final class TestApplet extends Applet {
|
||||
}
|
||||
break;
|
||||
|
||||
case Data.INS_TEST_DELETION:
|
||||
processDeletion();
|
||||
break;
|
||||
|
||||
default:
|
||||
ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user