Write Eeprom using APDU commands

[ Follow Ups ] [ BasicCard User Forum ]

Posted by linkit ( on October 07, 2008 at 10:51:41:

I am using a POS to send APDU commands to an Enhanced Basic Card ZC3.7
Each command that I have sent to the card works fine, even encrypted commands, but I cannot send a Write Eeprom

command (&HC0 &H06), I always get swDesCheckError (&H66 &HC3). I am encrypting the command, following the steps of

section 9.2 of the BasicCard Manual.

I have manually encrypted and decrypted the command and it looks fine, but when I send the APDU command to the

card using my application, it returns 66C3 error. We don't use Basic Language in our POS, these are custom

libraries based on C Language.
When I send an encrypted Echo Command it works fine, I only have problems with Write Eeprom command.

If I don't use Basic language I cannot use the sentence
Declare Command &HC0 &H06 WriteEeprom (data$, Disable Le)
Do I need to use a similar sentence in my source code or the Write Eeprom command should work anyway?

My source code looks like this:

unsigned char stxData[]={0xC0, 0x06, 0x80, 0x20, 0x02, 0x41, 0x42} //this is my command in plain text before

encrypt it.

//then I encrypt the data using DES algorithm.

//I send the APDU command after encrypt the data
chResCS = Transmit_APDU(slotNo, stxData, shSendLen, srxData, &shReadLen);

Thanks for your help.

Follow Ups:

[ Follow Ups ] [ BasicCard User Forum ]