JCML - Java Card Modeling Language: Definição e ... - Ifrn
JCML - Java Card Modeling Language: Definição e ... - Ifrn
JCML - Java Card Modeling Language: Definição e ... - Ifrn
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
CAPÍTULO 4. APLICABILIDADE DE JML A JAVA CARD 6601 public void process(APDU apdu) {02 byte[] buffer = apdu.getBuffer();03 if (buffer[ISO7816.OFFSET_CLA] != Wallet_CLA)04 ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);0506 switch (buffer[ISO7816.OFFSET_INS]) {07 case GET_BALANCE: getBalance(apdu);08 return;09 case DEBIT: debit(apdu);10 return;11 case CREDIT: credit(apdu);12 return;13 default: ISOException.throwIt14 (ISO7816.SW_INS_NOT_SUPPORTED);15 }16 }Figura 4.6: Método process - Wallet.01 /*@ requires apdu != null02 && ((byte[])apdu.getBuffer())03 [ISO7816.OFFSET_CDATA] < MAX_TRANSACTION_AMOUNT04 && balance + ((byte[])apdu.getBuffer())05 [ISO7816.OFFSET_CDATA]