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

StackOverflow https://stackoverflow.com/questions/8283950

문제

I am new to java card.

i have this code.....so please tell me how to read data from smart card using java card

        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);
    }
도움이 되었습니까?

해결책

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
  2. send read binary/record depending on EF type (read binary for transparent EF, read record for linear fixed/cyclic EF)
  3. send get response to get the EF contents

다른 팁

I think you can find an integrated development environment to write your javacard simulation code card, after burn into real card in the code. Free integrated debugging environment could go to the www.javacos.com.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top