简体   繁体   中英

Updating Smart Card User Area returns Security not satisfied

I'm having a Gemclub-Memo smart card I'm trying to update via the C# library PCSC . I'm trying to write byte values from range 0x10 to 0x15 using the following commando APDU commando.

var apdu = new CommandApdu(IsoCase.Case3Short, SCardProtocol.T0)
         {
              INS = 0xDE,
              CLA = 0x80,
              P1 = 0x00, // Parameter 1
              P2 = 0x10, // Parameter 2
              Data = new byte[4] { 0x54, 0x45, 0x53, 0x54 } // This will set the Lc to 0x04 as well, contains T E S T
         };
var response = isoReader.Transmit(apdu);

Yet I'm always receiving the status code SW1 0x69 and SW2 0x82 which means the following:

Security not satisfied, words in balance updated in wrong order or attempt to update flag word / PB_SECUR.

It also states

The update command updates the balance one word at a time

Thus I've been updating with the same APDU twice, but that's supposedly misunderstood by me?

I'm also confused by

The new balance is only updated after the second word has been updated

What do they mean with that? And what am I doing wrong for not being able to update the User Area ?

Had to verify the CSC code using the Verify command as described at page 21 it seems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM