1
votes

I'm writing a smart card program for ISO 7816 Cards which I need to update a record. I write the program with JAVA and javax.smartcardio Library.

I select the file with this command: ins = 0xA4

I can read record with this command: cla = 0x80 , ins = 0xB2 , p1 = 0x00 , p2 = 0x00 , le = 90

Read record works correct and send me 90 00. Now I need to update this record. So I use this command: cla = 0x80 , ins = 0xDC , p1 = 0x00 , p2 = 0x00 , and some data.

But in response APDU I get 6D 00 Error which means "Ins Value not supported".

How can I update records correctly?

1
What card is this? Why do you expect the record to be writable (with this command / without authentication / at all)? - Michael Roland
@MichaelRoland It's ISO 7816-4 smart card... I have the source code of the program which use for reading the datas of card... I thought that I can change command to change data of this file... but it's not authentication problem because error is about ins value... It's not possible? - Saman Salehi
ISO/IEC 7816-4 is a standard defining the data structures and a set of commands for smartcards, it's not a smartcard product. Smartcards may follow parts of ISO/IEC 7816-4 but typically don't implement all commands. Specifically the command that your card supports (CLA=80, INS=B2) is a proprietary command that does not follow the ISO/IEC 7816-4 standard (CLA=80 indicates the proprietary class). You would need to get more information about the smartcard chip (and possibly the applications running on it) in order to determine if (and how) data structures on the chip could be modified. - Michael Roland
You can analyse the ATR and guess the smart card type. - Jitendra
For a quick check you could try Write Record (INS=0xD2) instead of Update Record (INS=0xDC) - guidot

1 Answers

-2
votes

I have this command: 00 DC 01 04. It works:

00 : class     
DC : INS  
01 : P1 , position of record  
04 : P2 ,  

Cordially.