Examples of BCD


Examples of org.infotechservice.smartcard.utils.BCD

        }
    }

    public void writeID(int id) throws CardException {
        commandSelect();
        byte[] command = ByteArrayHelper.concat(COMMAND_HEAD, new BCD(id).getValue());
        command[14] = (byte) (command.length - 15);
        command = ByteArrayHelper.expand(command, 28, (byte) 0xff);
        command = ByteArrayHelper.concat(WRITE_COMMAND, command);
        exec(new CommandAPDU(command), "Write id error");
    }
View Full Code Here

Examples of org.infotechservice.smartcard.utils.BCD

    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

Examples of org.infotechservice.smartcard.utils.BCD

        }
        byte[] result = readTag(new byte[] {(byte)0xDF, (byte)(0x12 + index)}, record2_1, 0);
        if(result.length == 0) {
            return null;
        }
        Integer type = new BCD(result).toInteger(0, 4);
        Date begin = bcdToDate(result, 4);
        Date end = bcdToDate(result, 8);
        return new Excemption(type, begin, end);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.