2

I'm new to Java card development. I use jcop tools as development kit. When I run simple applet in Eclipse it gives this error. In the run configurations I choose the Java card simulation mode. After successfully installed in simulation mode i want to install app in java card.

cm>  upload -b 250 "C:\Projects\Javacard\MyTestApp\bin\hms\javacatd\Myapp\javacard\Myapp.cap"
cm>  install -i 6d796170702e617070  -q C9#() 6d797061636b616765 6d796170702e617070
jcshell: Error code: 6985 (Conditions of use not satisfied)
jcshell: Wrong response APDU: 6985
Unexpected error; aborting execution

My applet id is myapp.app and package is mypackage

Please help me to find solution.

djf
  • 6,592
  • 6
  • 44
  • 62
Need
  • 97
  • 1
  • 11

3 Answers3

1

Is the Java-Card you are using a JCOP engineering card?

The error message "Conditions of use not satisfied" usually means that one required step is missing in the upload process, e.g. authentication.

Make sure the following steps are executed successfully before:

  1. Select Card Manager
  2. Authenticate for using the Card Manager (may depend on used card)
  3. Delete all instances of your applet before installing a new one
Robert
  • 39,162
  • 17
  • 99
  • 152
  • Thanks Robert yes i used jcop engineering card.now i can send apdu commands using jcop shell.it works.now i want to install this applet(.cap file) in to my card.when i run applet in eclipse after changing simulation mode to reader mode it gives this error.upload -b 250 "C:\Projects\Javacard\MytestThree\bin\hms\javacard\testthree\javacard\testthree.cap" <= 00 90 00 ... Status: No Error jcshell: Error code: 6a80 (Wrong data) jcshell: Wrong response APDU: 6A80 i couldn't install applet in to my card.can you give me a suggestion please. – Need Jul 01 '13 at 13:20
  • @Need you seem to mix up different error conditions. One is completely different from the other. This does not make it easier to answer this question.... – Maarten Bodewes Jul 03 '13 at 22:03
1

What usually works for me is to not try to do this through jcshell manually, but instead upload the applet by creating a run configuration:

  • Right click on your Java Card applet project
  • Select Run As -> Run Configurations...
  • Scroll to Java Card Application, right click -> New
  • Select your card reader in Target tab
  • Set package, applet, instance AID in Package upload tab

The defaults for the other tabs are ok for me (authenticating to card manager, deleting of previous instance and package, etc.).

enter image description here

Save the configuration, and run it.

martijno
  • 1,723
  • 1
  • 23
  • 53
  • Thanks martijno ,it is helpfull your reponse anyway.when i change the instance AID and try to run what you show in this image.but when i run this one it gives another error. upload -b 250 "Cap file path" response 9000 then automaticaly send another number of bits(i don't know why) then it gives 6A 80 j. Status: Wrong data jcshell: Error code: 6a80 (Wrong data) jcshell: Wrong response APDU: 6A80 Unexpected error; aborting execution please tell me how to solve this problem.and other thing i want to know is their any permission need for uploading app. – Need Jul 03 '13 at 05:41
  • Yes, you do need to authenticate to the card manager. But I think you're already doing this. Could those "bits" be install for install? If that's the case, show us the install method and constructor of your applet. – martijno Jul 03 '13 at 17:17
  • public static void install(byte[] bArray, short bOffset, byte bLength) { new MyTestApp().register(bArray, (short) (bOffset + 1), bArray[bOffset]); }this is the install method.. – Need Jul 04 '13 at 03:49
  • What do you mean with configuring "deleting of previous instance"? I'm looking through the other tabs, and I cannot seem to find it. I'd like to disable this, though, as it seems to be causing problems when first uploading the applet to a new card. – Joost Nov 05 '14 at 15:47
0

Usually, if you successfully installed applet in java card simulator, but when installed on the card fails, first, you need to determine the simulator and cards used java card version is the same? That is: the card supports java card version must be consistent with the version of development kit.

Second, you need to check whether the card supporting the functions in the applet.

TeddyBear
  • 112
  • 4