Package javax.smartcardio

Examples of javax.smartcardio.ResponseAPDU


        exec(new CommandAPDU(command), "Write id error");
    }

    public int readID() throws CardException {
        commandSelect();
        ResponseAPDU resp = exec(new CommandAPDU(READ_COMMAND), "Read id error");
        if (Arrays.equals(Arrays.copyOf(COMMAND_HEAD, 14), Arrays.copyOf(resp.getData(), 14))) {
            return new BCD(resp.getData()).toInteger(16);
        } else {
            return 0;
        }
    }
View Full Code Here


        exec(SELECT_SOCIAL_APPLICATION, "Unable select social application");
        record1_7 = getRecord(READ_FILE_1_7);
    }

    private byte[] getRecord(CommandAPDU apdu) throws CardException {
        ResponseAPDU responce = exec(apdu, "Unable read user info");
        Messages msg = Messages.findMessage(responce);
        if (!msg.isOk()) {
            throw new CardException(msg.getMessage());
        }
        return responce.getData();
    }
View Full Code Here

     * @param errorMesssage Сообщение об ошибке, кторое будет отображено если будет ошибка
     * @return
     * @throws CardException
     */
    protected ResponseAPDU exec(CommandAPDU command, String errorMesssage) throws CardException {
        ResponseAPDU responce = smartcard.getCard().getBasicChannel().transmit(command);
        Messages msg = Messages.findMessage(responce);
        if (msg.isError()) {
            if (errorMesssage == null) {
                throw new CardFrameworkException(msg);
            } else {
View Full Code Here

TOP

Related Classes of javax.smartcardio.ResponseAPDU

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.