12.07.2015 Views

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

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CAPÍTULO 5. <strong>JCML</strong> - JAVA CARD MODELING LANGUAGE 8001 public class UsuarioApplet extends Applet02 {0304 public static final byte CLA_SMARTESCOLA = (byte) 0x80;05 /** Instrução para verificar a senha. */06 public static final byte INS_VERIFICAR_SENHA = (byte) 0x00;07 /** Instrução para alterar o nome. */08 public static final byte INS_SET_MATRICULA = (byte) 0x11;09 /** Instrução para alterar o tipo do usuário. */10 public static final byte INS_SET_TIPO = (byte) 0x12;11 /** Instrução para recuperar o nome. */12 public static final byte INS_GET_MATRICULA = (byte) 0x21;13 .14 .15 .16 public static void install(byte[] bArray, short bOffset,17 byte bLength) {18 new Usuario(bArray, bOffset, bLength);19 }2021 //@ requires apdu != null;2223 public void process(APDU apdu) throws ISOException {24 byte[] buffer = apdu.getBuffer();25 byte cla = buffer[ISO7816.OFFSET_CLA];26 byte ins = buffer[ISO7816.OFFSET_INS];2728 // Tratamento da classe do comando29 if (cla != CLA_SMARTESCOLA) {30 ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);31 }32 .33 .34 .35 }36 }Figura 5.3: Código Válido: Membros <strong>Java</strong> <strong>Card</strong>.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!