简体   繁体   English

有人可以告诉我如何使用Java卡读取智能卡中的数据吗? 我有此代码,我正在使用Java卡2.2

[英]can some one tell me how to read data in smart card using java card? I have this code i am using java card 2.2

I am new to java card. 我是Java卡新手。

i have this code.....so please tell me how to read data from smart card using java card 我有此代码.....所以请告诉我如何使用Java卡从智能卡读取数据

        private void readName(APDU apdu) throws ISOException
    {
      byte[] apduBuffer = apdu.getBuffer();
      for (byte i=0; i<userName.length; i++)
      {
        apduBuffer[5+i] = userName[(byte)i] ;
      }
      apdu.setOutgoing();
      apdu.setOutgoingLength((short)userName.length);
      apdu.sendBytes((short)5, (short)userName.length);
    }

I think you can find an integrated development environment to write your javacard simulation code card, after burn into real card in the code. 我认为您可以找到一个集成的开发环境,在将代码烧成真实卡之后,再编写您的javacard模拟代码卡。 Free integrated debugging environment could go to the www.javacos.com. 免费的集成调试环境可以访问www.javacos.com。

The common mechanism to read data from files in smart card is: 从智能卡中的文件读取数据的常见机制是:

  1. select the file (EF), follow the rules, you can't blindly select as in desktop computer filesystem 选择文件(EF),请遵循规则,您不能像在台式计算机文件系统中那样盲目选择
  2. send read binary/record depending on EF type (read binary for transparent EF, read record for linear fixed/cyclic EF) 根据EF类型发送读取的二进制/记录(透明EF的读取二进制,线性固定/循环EF的读取记录)
  3. send get response to get the EF contents 发送获取响应以获取EF内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM