Guest User

Untitled

a guest
Jan 17th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. // Send pseudo APDU to retrieve the card serial number (UID)
  2. int cla = 0xFF;
  3. int ins = 0xCA;
  4. int p1 = 0x00;
  5. int p2 = 0x00;
  6. byte[] data = null;
  7. int dataOffset = 0x00;
  8. int dataLength = 0x00;
  9. int le = 0x00;
  10.  
  11. CommandAPDU getDataApdu = new CommandAPDU(cla, ins, p1, p2, data, dataOffset, dataLength, le);
  12. ResponseAPDU r1 = channel.transmit(getDataApdu);
  13.  
  14. // wait 10 seconds for a card
  15. CardTerminal terminal = terminal.waitForCardPresent(10000);
  16.  
  17. Card card = terminal.connect("*");
  18. ATR atr = card.getATR();
Add Comment
Please, Sign In to add comment