On 21/02/06, Srinivas G. <[EMAIL PROTECTED]> wrote:
> Dear All,

Hello,

> I have a Siemens smart cards that support the T=1 protocol. I have a
> smart card reader. But I did not have the APDU command description for
> ReadBlock and WriteBlock for this card. But I have the sample code for
> the PrepareSBlock and SelectMF commands. The code is as follows.
>
> PrepareSBlock:
> ucIOData[0] = 0x6F;
> ucIOData[1] = 0x00;
> ucIOData[2] = 0x00;//NAD
> ucIOData[3] = 0xC1;//PCB
> ucIOData[4] = 0x01;//len
> ucIOData[5] = 0xFE;//IFS request
> ucIOData[6] = 0x3E;//checksum
> ulIOBytes =  7;
>
> SelectMF:
> ucIOData[0] = 0x6F;
> ucIOData[1] = 0x00;
> ucIOData[2] = 0x00;//NAD
> ucIOData[3] = 0x00;//PCB for Information Block
> ucIOData[4] = 0x07;//Length Byte
> ucIOData[2] = 0x00;//CLA Code
> ucIOData[3] = 0xA4;//Select File Command
> ucIOData[4] = 0x00;//P1
> ucIOData[5] = 0x00;//P2
> ucIOData[6] = 0x02;//P3
> ucIOData[7] = 0x3F;//DF Name
> ucIOData[8] = 0x00;//DF Name
> ucIOData[9] = 0x9E;//EL
> ulIOBytes =  10;
>
> Could any body please send me the same type of sample code for the
> ReadBlock and WriteBlock command operations?

Your example are T=1 TPDU blocks. You cannot use that at the PC/SC
level. You have to remove the 5 first bytes and the last one.
The select APDU in your example is:
> ucIOData[2] = 0x00;//CLA Code
> ucIOData[3] = 0xA4;//Select File Command
> ucIOData[4] = 0x00;//P1
> ucIOData[5] = 0x00;//P2
> ucIOData[6] = 0x02;//P3
> ucIOData[7] = 0x3F;//DF Name
> ucIOData[8] = 0x00;//DF Name

This is a normal select file APDU as described in standard ISO 7816-4.

Bye,

--
 Dr. Ludovic Rousseau

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

Reply via email to