0

I encountered a problem performing select for an installed applet. The applet is HelloWorld app from the Java Card SDK 2.2.1

If I understand correctly, after opening secure channel I should select an applet (execute the select command) and then send an apdu command to the selected applet. After that, HelloWorld should return the payload of the received command in response.

I am using gpshell. The applet is installed on a physical card. get_status -element 20 returns the following:

enter image description here

When I try to execute select I get error 6108. (Also tried d00000006203010c01 - same result)

The sequence of commands to execute in gpshell is as follows:

mode_211
enable_trace
set_context
card_connect
select -AID A000000003000000
open_sc -security 3 -scpimpl 0x15 -scp 2 -keyind 0 -key 404142434445464748494a4b4c4d4e4f -keyDerivation emvcps11
get_status -element 20
select -AID d00000006203010c01

I'm just starting to work with Java Card, so maybe the problem is obvious. What am I doing wrong?

P.S. According to https://www.eftlab.com/knowledge-base/complete-list-of-apdu-responses code 6108 is not an error code(??) It is Info message (61 - SW1; 08 - number of bytes available - SW2 ). So why gpshell terminate connection?

asked Mar 26, 2025 at 13:36

1 Answer 1

1

As you already have guessed, your command is returning data, and you should issue a GET RESPONSE with Lc = SW2 in order to read the remaining bytes. The response probably contains the FCI, FCP, AID, or other proprietary data returned by the applet upon selection.

The command should be as follows

00 C0 00 00 08

The reason why the command is returning 61 XX instead of the response bytes followed by 90 00 seems to be that gpshell is sending here the SELECT command without Le field (case 3 - no response). The best move would be to send the SELECT command with a Le field set to 00 (case 4 - return all the bytes from the response).

answered Mar 26, 2025 at 22:27
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.