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.
APÊNDICE A. CLASSES DA APLICAÇÃO DE CONTROLE DE USUÁRIO 120private void setTipo(APDU apdu) {if (!pin.isValidated()) {ISOException.throwIt(SW_AUTENTICACAO_INVALIDA);}}byte[] buffer = apdu.getBuffer();byte tam_tipo = (byte) apdu.setIncomingAndReceive();if (tam_tipo != Usuario.TAMANHO_TIPO) {ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);}byte tipo = buffer[ISO7816.OFFSET_CDATA];if (tipo != Usuario.TIPO_ESTUDANTE && tipo != Usuario.TIPO_PROFESSOR) {ISOException.throwIt(ISO7816.SW_WRONG_DATA);}u.setTipo(tipo);private void getTipo(APDU apdu) {byte[] buffer = apdu.getBuffer();byte tam_saida = (byte) apdu.setOutgoing();if (tam_saida != Usuario.TAMANHO_TIPO) {ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);}byte indice_inicio = 0;buffer[indice_inicio] = u.getTipo();apdu.setOutgoingLength(Usuario.TAMANHO_TIPO);apdu.sendBytes(indice_inicio, Usuario.TAMANHO_TIPO);}private void adicionarLocal(APDU apdu) {if (!pin.isValidated()) {ISOException.throwIt(SW_AUTENTICACAO_INVALIDA);}}byte[] buffer = apdu.getBuffer();byte tam_local = (byte) apdu.setIncomingAndReceive();if (tam_local != Usuario.TAMANHO_LOCAL) {ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);}byte local = buffer[ISO7816.OFFSET_CDATA];u.adicionarLocal(local);private void verificarLocal(APDU apdu) {if (!pin.isValidated()) {ISOException.throwIt(SW_AUTENTICACAO_INVALIDA);}}byte[] buffer = apdu.getBuffer();byte tam_local = (byte) apdu.setIncomingAndReceive();if (tam_local != Usuario.TAMANHO_LOCAL) {ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);}byte local = buffer[ISO7816.OFFSET_CDATA];if (!u.temAcessoLocal(local)) {ISOException.throwIt(Usuario.SW_LOCAL_INEXISTENTE);}