Throw an error for incorrect CLAs

This commit is contained in:
Manuel Thalmann 2023-10-13 01:28:12 +02:00
parent 22b11b1ee8
commit 995ba68bdf

View file

@ -52,6 +52,9 @@ public class MyApplet extends Applet {
short length;
byte[] buffer = apdu.getBuffer();
if (buffer[ISO7816.OFFSET_CLA] != 0x80) {
ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
} else {
byte instruction = buffer[ISO7816.OFFSET_INS];
switch (instruction) {
@ -88,3 +91,4 @@ public class MyApplet extends Applet {
}
}
}
}