Problems with installing

Hello forum,

yesterday I got my JCOP activation key and started to test my applet.

When I started to install the applet I got the error code 6A80. I know the meaning I a found the error but I can磘 change it. Maybe there is anyone who can help me.

I tried anything (changes short to byte ...) but only leaving the new instance of DataFile in JCApplet5 constructor bring it to succes. But that is what I need to work with.

public JCApplet5(){

desKey = (DESKey)KeyBuilder.buildKey(KeyBuilder.TYPE_DES_TRANSIENT_DESELECT, KeyBuilder.LENGTH_DES,false);

MAC_buffer = JCSystem.makeTransientByteArray( MAX_MAC_DATA, JCSystem.CLEAR_ON_DESELECT);

desKey.setKey(keyForUse, (short)0);

keySign = Signature.getInstance(Signature.ALG_DES_MAC8_ISO9797_M2,false);

adminPin =new OwnerPIN((byte)0x01, PIN_LENGTH);

userPin =new OwnerPIN((byte)0x03, PIN_LENGTH);

userDataFile =new DataFile((short)2, (short)20);//here is the error produced. when I leave it it磗 ok but I need it to work with

}

DataFile constructor is this

public DataFile(short numNeededDataSets,short dataSetLength)

{

this.numNeededDataSets = numNeededDataSets;

this.dataSetLength = dataSetLength;

for (short dataSetNo=0; dataSetNo<=numNeededDataSets; dataSetNo++)

{

dataSetInstance[dataSetNo] =new DataSet(dataSetLength);

}

}

And DataSet is only a parent byte[]

byte[] dataSet;

public DataSet(short lengthOfDataSet)

{

dataSet =newbyte[lengthOfDataSet];

}

The APDU trace is here

cm> /term "Remote|localhost:1660"

--Opening terminal

> /card -a a000000003000000 -c com.ibm.jc.CardManager

resetCard with timeout: 0 (ms)

--Waiting for card...

ATR=3B FA 13 00 00 81 31 FE 45 4A 43 4F 50 34 31 56;.....1.EJCOP41V

32 32 31 96221.

ATR: T=1, FI=1/DI=3 (93clk/etu), N=0, IFSC=254, BWI=4/CWI=5, Hist="JCOP41V221"

=> 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00 ..............

(1604 usec)

<= 6F 10 84 08 A0 00 00 00 03 00 00 00 A5 04 9F 65o..............e

01 FF 90 00....

Status: No Error

cm> set-key 255/1/DES-ECB/404142434445464748494a4b4c4d4e4f 255/2/DES-ECB/404142434445464748494a4b4c4d4e4f 255/3/DES-ECB/404142434445464748494a4b4c4d4e4f

cm> init-update 255

=> 80 50 00 00 08 CE 93 81 11 46 42 A5 7D 00 .P.......FB.}.

(3008 usec)

<= 00 00 57 F3 97 D9 7F 72 88 55 FF 02 00 00 3D 02..W....r.U....=.

9C 31 C7 89 AE D0 CA 48 D5 96 AD BD 90 00 .1.....H......

Status: No Error

cm> ext-auth plain

=> 84 82 00 00 10 7C 94 C7 F4 E5 54 B4 50 39 38 9D.....|....T.P98.

A9 34 0F A3 DF .4...

(2746 usec)

<= 90 00 ..

Status: No Error

cm> delete 4170706c657456657273696f6e33

=> 80 E4 00 00 10 4F 0E 41 70 70 6C 65 74 56 65 72.....O.AppletVer

73 69 6F 6E 33 00 sion3.

(994260 nsec)

<= 6A 88 j.

Status: Reference data not found

jcshell: Error code: 6a88 (Reference data not found)

jcshell: Wrong response APDU: 6A88

Ignoring expected error

cm> delete 4a4361726456657273696f6e33

=> 80 E4 00 00 0F 4F 0D 4A 43 61 72 64 56 65 72 73.....O.JCardVers

69 6F 6E 33 00 ion3.

(1450 usec)

<= 6A 88 j.

Status: Reference data not found

jcshell: Error code: 6a88 (Reference data not found)

jcshell: Wrong response APDU: 6A88

Ignoring expected error

cm> upload -b 250 "F:\EclipseBA\WS_E_BA\JC3\bin\de\fhs\javacard\javacard\javacard.cap"

=> 80 E6 02 00 1A 0D 4A 43 61 72 64 56 65 72 73 69......JCardVersi

6F 6E 33 08 A0 00 00 00 03 00 00 00 00 00 00 00on3.............

(1803 usec)

<= 00 90 00...

Status: No Error

=> 80 E8 00 00 FA C4 82 04 CB 01 00 27 DE CA FF ED...........'....

02 02 04 00 01 0D 4A 43 61 72 64 56 65 72 73 69......JCardVersi

6F 6E 33 0F 64 65 2F 66 68 73 2F 6A 61 76 61 63on3.de/fhs/javac

61 72 64 02 00 21 00 27 00 21 00 12 00 1F 00 A2ard..!.'.!......

00 34 02 F1 00 0E 00 62 00 00 01 EB 0F B2 00 02.4.....b........

00 01 00 01 03 01 00 04 00 1F 03 00 01 07 A0 00................

00 00 62 00 01 02 01 07 A0 00 00 00 62 01 01 02..b.........b...

01 07 A0 00 00 00 62 01 02 03 00 12 01 0E 41 70......b.......Ap

70 6C 65 74 56 65 72 73 69 6F 6E 33 00 CD 06 00pletVersion3....

34 00 00 00 80 00 04 00 01 01 05 00 00 00 33 004.............3.

36 00 59 00 65 00 79 00 80 00 01 00 01 01 01 006.Y.e.y.........

00 00 B4 00 81 03 09 00 09 04 04 00 00 01 80 FF................

FF 01 6A 01 8D 07 02 F1 00 05 31 18 8C 00 20 18..j.......1... .

03 89 0A 18 03 89 08 18 03 89 02 18 1D 89 0A 18................

1E 89 08 03 32 70 11 AD 0B 1F 8F 00 22 3D 1E 8C....2p......"=..

00 0F 37 59 03 01 1F 1D 6F EF 7A 00 40 7A 05 00..7Y....o.z.@z..

(6207 usec)

<= 00 90 00...

Status: No Error

=> 80 E8 00 01 FA 20 18 8B 00 0C 3B AF 02 AF 0A 6B..... ....;....k

0A 11 6A 84 8D 00 18 70 0F AD 0B AF 02 8F 00 22..j....p......."

3D 19 8C 00 0D 37 7A 02 10 AD 0B 18 8B 00 0C 24=....7z........$

83 05 77 03 20 1D 65 06 1D 1D 6F 04 01 77 AD 0B..w. .e...o..w..

1D 04 43 24 83 05 77 03 11 03 30 70 17 AD 0B 1D..C$..w...0p....

24 83 05 03 25 60 0A 18 3D 85 02 04 41 89 02 59$...%`..=...A..Y

01 01 1D AF 0A 6C E8 AF 02 78 02 20 18 8C 00 20.....l...x. ...

18 1D 90 0B 87 05 7A 02 20 18 8C 00 20 18 19 87......z. ... ...

05 7A 04 41 1D 29 04 70 0E AD 05 16 04 1B 16 04.z.A.).p........

25 38 59 04 01 16 04 1E 6F F1 7A 05 30 8F 00 11%8Y.....o.z.0...

3D 8C 00 1D 18 1D 04 41 18 1D 25 8B 00 13 7A 05=......A..%...z.

10 18 8C 00 25 18 10 08 90 0B 3D 03 10 A2 38 3D....%.....=...8=

04 10 11 38 3D 05 10 BB 38 3D 06 10 2D 38 3D 07...8=...8=..-8=.

10 41 38 3D 08 10 8C 38 3D 10 06 10 39 38 3D 10.A8=...8=...98=.

07 10 DC 38 87 07 18 05 10 40 03 8D 00 0E 94 00...8.....@......

00 19 87 00 18 10 1E 05 8D 00 17 87 09 AD 00 00................

(1227 usec)

<= 00 90 00...

Status: No Error

=> 80 E8 00 02 FA AD 07 03 8E 03 00 19 05 18 10 06................

03 8D 00 1A 87 04 18 8F 00 1F 3D 04 10 08 8C 00..........=.....

1B 87 01 18 8F 00 1F 3D 06 10 08 8C 00 1B 87 03.......=........

18 8F 00 12 3D 05 10 14 8C 00 10 87 06 7A 01 10....=........z..

AD 03 8B 00 16 61 04 03 78 AD 01 8B 00 16 61 04.....a..x.....a.

03 78 04 78 01 10 AD 01 8B 00 21 AD 03 8B 00 21.x.x......!....!

7A 02 21 18 8B 00 26 60 03 7A 19 8B 00 24 2D 1Az.!...&`.z...$-.

03 25 10 80 6B 35 1A 04 25 75 00 2A 00 04 FF B2.%..k5..%u.*....

00 15 00 00 00 30 00 20 00 23 00 30 00 1C 18 19.....0. .#.0....

8C 00 1C 70 16 18 19 8C 00 15 70 0F 18 19 8C 00...p......p.....

23 70 08 11 6D 00 8D 00 18 7A 02 24 AD 03 8B 00#p..m....z.$....

1E 61 06 04 8D 00 18 19 8B 00 24 2D 1A 07 25 32.a........$-..%2

19 8B 00 27 5B 29 04 1F 16 04 6A 07 10 14 8D 00...'[)....j.....

18 1A 05 25 29 05 16 05 73 00 2D 00 01 00 13 00...%)...s.-.....

2D 00 2D 00 2D 00 2D 00 2D 00 2D 00 2D 00 2D 00-.-.-.-.-.-.-.-.

2D 00 2D 00 2D 00 2D 00 2D 00 2D 00 2D 00 2D 00-.-.-.-.-.-.-.-.

(1307 usec)

<= 00 90 00...

Status: No Error

=> 80 E8 00 03 FA 00 2D 00 2D 00 2D 7A 04 25 19 8B......-.-.-z.%..

00 24 2D 1A 07 25 32 03 29 04 19 8B 00 27 29 05.$-..%2.)....').

16 05 1F 6D 08 11 67 00 8D 00 18 1A 06 25 29 06...m..g......%).

16 06 73 00 41 FF 81 FF 82 00 0B 00 26 AD 01 1A..s.A.......&...

08 1F 8B 00 14 61 34 AD 01 8B 00 16 29 04 10 10.....a4.....)...

16 04 41 8D 00 18 70 23 AD 03 1A 08 1F 8B 00 14..A...p#........

61 19 AD 03 8B 00 16 29 04 10 11 16 04 41 8D 00a......).....A..

18 70 08 11 6A 86 8D 00 18 7A 02 24 19 8B 00 24.p..j....z.$...$

2D 1A 07 25 32 19 8B 00 27 5B 29 04 1F 16 04 6A-..%2...'[)....j

07 10 14 8D 00 18 1A 05 25 29 05 16 05 73 00 2D........%)...s.-

00 01 00 13 00 2D 00 2D 00 2D 00 2D 00 2D 00 2D.....-.-.-.-.-.-

00 2D 00 2D 00 2D 00 2D 00 2D 00 2D 00 2D 00 2D.-.-.-.-.-.-.-.-

00 2D 00 2D 00 2D 00 2D 00 2D 7A 08 00 0E 00 02.-.-.-.-.-z.....

00 01 00 01 03 00 01 00 00 00 00 00 05 00 A2 00................

28 02 00 22 02 02 00 22 01 02 00 02 03 02 00 22(.."..."......."

00 02 00 22 03 02 00 16 00 02 00 22 05 02 00 00..."......."....

(4104 usec)

<= 00 90 00...

Status: No Error

=> 80 E8 80 04 E7 22 08 02 00 02 02 02 00 22 04 02....."......."..

00 02 01 02 00 02 00 03 00 02 05 06 00 00 A9 06................

82 0D 00 06 00 00 9C 06 00 00 01 01 00 22 00 01............."..

00 02 00 03 81 03 02 03 81 09 01 06 00 01 D6 03................

81 09 02 06 81 08 0D 06 81 07 01 01 82 0A 00 06................

82 0F 00 06 81 09 00 06 00 02 A0 06 00 00 E1 03................

81 09 04 01 81 09 00 06 80 00 00 03 81 09 05 01................

00 16 00 06 00 02 32 03 81 0A 01 06 81 03 00 03......2.........

81 03 03 03 81 0A 06 09 00 62 00 29 0A 04 04 04.........b.)....

04 06 1E 02 0C 02 0E 07 0E 06 09 04 08 04 06 04................

0D 0B 0A 5B 0E 09 02 02 0F 0D 0D 0D 05 09 0D 05...[............

51 8B 0A 11 0A 00 35 05 1E 05 12 0D 09 05 0A 41Q.....5........A

0D 23 04 0A 07 39 04 09 0B 08 06 07 06 07 06 07.#...9..........

0A 09 0D 05 07 07 25 07 07 08 08 06 04 09 0D 3B......%........;

0C 0D 1A 07 0A 0A 07 0A 08 07 09 0D 00 .............

(20242 usec)

<= 00 90 00...

Status: No Error

Load report:

1231 bytes loaded in 0.0 seconds

effective code size on card:

+ package AID13

+ applet AIDs21

+ classes55

+ methods756

+ statics10

+ exports0

overall855 bytes

cm> install -i 4170706c657456657273696f6e33 -q C9#() 4a4361726456657273696f6e33 4170706c657456657273696f6e33

=> 80 E6 0C 00 32 0D 4A 43 61 72 64 56 65 72 73 69....2.JCardVersi

6F 6E 33 0E 41 70 70 6C 65 74 56 65 72 73 69 6Fon3.AppletVersio

6E 33 0E 41 70 70 6C 65 74 56 65 72 73 69 6F 6En3.AppletVersion

33 01 00 02 C9 00 00 003.......

(5041 usec)

<= 6A 80 j.

Status: Wrong data

jcshell: Error code: 6a80 (Wrong data)

jcshell: Wrong response APDU: 6A80

Unexpected error; aborting execution

[11555 byte] By [mimaxxa] at [2007-11-27 9:44:58]
# 1
Where do you allocate memory for the array dataSetInstance?
lexdabeara at 2007-7-12 23:52:45 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 2
DataSet[] dataSetInstance;This instance is allocating in class DataFile.
mimaxxa at 2007-7-12 23:52:45 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 3

By allocation for an array I mean e.g. DataSet[] dataSetInstance = new DataSet[100];

If you did not allocate this memory you will get NullPointerException at dataSetInstance[dataSetNo] = new DataSet(dataSetLength);

Check it out with the simulator. Surround it with try/catch and set a breakpoint.

lexdabeara at 2007-7-12 23:52:45 > top of Java-index,Java Mobility Forums,Consumer and Commerce...
# 4

You are right, it works.

But why can I do this in the applet directly without initializing and it does it磗 work ?

And I have seen this although in some examples.

But it磗 ok, now I know why this error has come and I will regard to this next time.

Thank you very much for your help.

mimaxx

mimaxxa at 2007-7-12 23:52:45 > top of Java-index,Java Mobility Forums,Consumer and Commerce...