5

I try to access a SmartCard via C++. I got already the Connection and the CardHandle.

But when I send an APDU Command via SCardTransmit, i'll get 6E 00 as the answer from the card. No matter which APDU Command i send. Everytime 6E 00.

For Example:

  • FF CA FA 00 00 (Card's ATR - Answer To Reset) or
  • FF CA FF 82 00 (Product name in ASCII)

The same thing when i send the Command with an PC/SC Testtootl like "PC/SC Diag".

Has anybody an Idea what the meaning of this Error-Code and how to solve the problem?

Please help me !!!! ;-)

Pusher
  • 53
  • 1
  • 4

3 Answers3

7

According to ISO 7816-4 0x6E00 means "Class not supported".

Are you using the correct CLA value in the APDU?

The class (CLA) byte is usually 0x00, 0xA0, 0xC0 or 0xF0 and sometimes masked with 0x0C that indicates Secure Messaging on some cards. AFAIK, the only invalid CLA value is 0xFF.

But this varies from one card to another, do you have the card specification from the vendor?

Jonas Engström
  • 5,015
  • 3
  • 37
  • 36
  • Ah ok, when i use 0C or 00 i've got another Errorcode 6A 86. Where can i find a list of Errorcodes. I don't have the specification from the vendor – Pusher Jul 07 '11 at 11:10
  • You should read the [ISO 7816-4 standard](http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816.aspx) first before sending APDUs to the card. – Jonas Engström Jul 07 '11 at 11:14
  • 1
    Ok thanks, i promise to read it. But i just want to get an answer from the card, so that i know every thing works fine. Can you tell me an easy apdu which i can send? – Pusher Jul 07 '11 at 11:22
  • The easiest APDU command is probably the GET CHALLENGE which will ask the card for random data. `CLA` = card specific. `INS` = 0x84 `P1` = 0x00 `P2` = 0x00 `LE` = number of bytes you want (up to 0xFF for a short APDU). – Jonas Engström Jul 07 '11 at 11:33
1

It means "Wrong Instruction Class". Maybe it's just the wrong type of card?

https://datatracker.ietf.org/doc/html/draft-urien-eap-smartcard-05

Community
  • 1
  • 1
Roddy
  • 66,617
  • 42
  • 165
  • 277
0

The BasicCard PDF manual has a list of error codes on page 152-153.

The one you got they describe as "CLA byte of command not recognized".

"6A 86" is likely the response to a card specific command and I dont see it in the BasicCard list.

Martin Clemens Bloch
  • 1,047
  • 1
  • 12
  • 28