2

I have EZ100PU usb smart card reader and new (clear) SLE4428 smart cards. I would like to write number sequence on them. I'm trying to do it with simple java application. That's my code based on others available on the internet:

public class Connection {

  public static void main(String[] args) throws Exception { 

    TerminalFactory factory = TerminalFactory.getDefault();

    CardTerminal terminal = terminals.get(1); 
    System.out.println("terminal: " + terminal.getName());
    Card card = terminal.connect("*");
    System.out.println("card: " + card);
    CardChannel channel = card.getBasicChannel(); 
    System.out.println("channel: " + channel.getChannelNumber());
    System.out.println("protocol: "+card.getProtocol());

    byte b[]=card.getATR().getBytes();
    for(int i=0;i<b.length;i++)
       System.out.print(b[i]);


//        byte[] bytes = {(byte)0xFF, (byte)0x00, (byte)0xFF, (byte)0x00};
//        ResponseAPDU r = channel.transmit(new CommandAPDU(bytes));

    card.disconnect(false);

  }
}

I have problem, because I always get "Unknown protocol 16" when card is inside reader. Probably because of that I can't write anything on the card, if I try I always get error. Can you help me?

4

2 回答 2

2

您的 SLE 4428 卡的默认 PIN = FFFF。首先,您需要使用以下命令验证 PIN:- FF 20 00 00 02 FFFF 然后您可以将数据写入 SLE 4428 卡。如果数据是“我的名字是 Kashyap”,那么十六进制是 4D79206E616D65206973204B617368796170。写入数据:- FF D0 00 20 12 4D79206E616D65206973204B617368796170。您还可以更改默认 PIN。假设我想将 PIN 从 FFFF 更改为 1234,然后使用以下命令:- FF D0 03 FD 03 FF 1234。

要读取以下命令的数据:- FF B0 00 20 12

谢谢, 卡什亚普

于 2015-06-26T07:06:28.457 回答
0

您正在尝试使用一种连接 ISO 7816-3(T=0、T=1 或 T=CL)兼容处理器卡的方法来连接低存储卡。您可能不得不使用特定于卡的读卡器库,而不能只使用javax.smartcardio.

于 2012-12-11T21:25:51.377 回答