Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TerminalFactory factory = TerminalFactory.getDefault();
- List<CardTerminal> terminals = factory.terminals().list();
- System.out.println("Terminals: " + terminals);
- // get the first terminal
- CardTerminal terminal = terminals.get(0);
- // establish a connection with the card
- Card card = terminal.connect("*");
- System.out.println("card: " + card);
- CardChannel channel = card.getBasicChannel();
- byte[] INIT_UPDATE = { (byte) 0x80, (byte) 0x50, (byte) 0x00,
- (byte) 0x00, (byte) 0x08, (byte) 0x11, (byte) 0x22,
- (byte) 0x33, (byte) 0x44, (byte) 0x55, (byte) 0x66,
- (byte) 0x77, (byte) 0x88 };
- ResponseAPDU r = channel.transmit(new CommandAPDU( INIT_UPDATE));
- System.out.println("response: " + Hex.encodeHexString(r.getBytes()));
- // disconnect
- card.disconnect(false);
Add Comment
Please, Sign In to add comment