Hi, I am currently trying to read and write to the memory within the smartcard.
Please correct me if I am wrong. I first have to select MF, then select DF, then select EF and perform read binary or write binary (for transparency file structure).

Now the question is:
1) How do I know the identifier of a DF? From the return code I get from SCardTransmit, I have 90 00, meaning no further qualification. Does this mean that there are no further information?
2) If I were to create a DF or EF, how would I do so? I cant seem to find a command in the ISO 7816-4  documentation.
3) How can I create an EF of different structure?
4) Finally, I have tried the following 2 APDU for selecting the MF and according to ISO 7816-4, I should obtain the same result. However, I did not. The following is the code segment:

Version 1:
-----------------
sendBuffer = (BYTE*) malloc(10*sizeof(BYTE));
recieveBuffer = (BYTE*)malloc(256*sizeof(BYTE));

memcpy(sendBuffer, "\x00\xA4\x00\x00\x02\x3F\x00",7);

dwLength = sizeof(recieveBuffer);
rv = SCardTransmit(CardHandle, SCARD_PCI_T0, sendBuffer, 7, &IORequest, recieveBuffer, &dwLength);


Version 2:
--------------------
sendBuffer = (BYTE*) malloc(10*sizeof(BYTE));
recieveBuffer = (BYTE*)malloc(256*sizeof(BYTE));

memcpy(sendBuffer, "\x00\xA4\x00\x00",4);

dwLength = sizeof(recieveBuffer);
rv = SCardTransmit(CardHandle, SCARD_PCI_T0, sendBuffer, 4, &IORequest, recieveBuffer, &dwLength);

I get 90 00 for version 1 (which i think is correct?) and 67 00 (Wrong Length) for version 2.
Why would this be so?

Thanks a lot for any generous help :)

Cheers,

  Arthur
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to