yes, that does indeed work. however, i find it confusing. perhaps the api doc for append should mention that it only can be used for apdu's whose constructor took int parameter. pretty awkward, isn't it? -a [EMAIL PROTECTED] wrote: > Aaron, > > this > > CommandAPDU apdu = new CommandAPDU(new byte[10]); > apdu.append((byte)0); > > does not work, because if you pass a byte array to the constructor, a > command apdu is created from that byte array, i.e. an APDU that has a > maximum size of 10 bytes and contains the 10 bytes you passed in the byte > array. > > You may try something like this: > ... > CommandAPDU doCHVAPDU = new CommandAPDU(13); > doCHVAPDU.append(DO_CHV_COMMAND_PREFIX); // constant array with Class, > Instruction > doCHVAPDU.append((byte) numCHV); // CHV number > doCHVAPDU.append((byte) 0x00); > doCHVAPDU.append((byte) 0x08); > doCHVAPDU.append(password); // Append 8 byte password > ... > > Best regards, > > Thomas > > Thomas Schaeck > IBM Pervasive Computing Division - Smart Card Solutions > E-mail: [EMAIL PROTECTED] Tel.: ++49-7031-16-3479 Fax.: > ++49-7031-16-4888 > Address: IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 > Boeblingen, Germany > > Aaron Stromas <[EMAIL PROTECTED]> on 17.08.99 17:04:37 > > Please respond to Aaron Stromas <[EMAIL PROTECTED]> > > To: [EMAIL PROTECTED] > cc: (bcc: Thomas Schaeck/Germany/IBM) > Subject: [OCF] bug in APDU append method > > hi, > > it appears to me there is a bug in the APDU's append method. i tried a > couple of ways, such as > > CommandAPDU apdu = new CommandAPDU(10); > apdu.append((byte)0); > > or > > CommandAPDU apdu = new CommandAPDU(new byte[10]); > apdu.append((byte)0); > > or > > byte[] bytes = new byte[2]; > CommandAPDU apdu = new CommandAPDU(10); > apdu.append(bytes); > > and evey other variation, like creating apdu with "new CommandAPDU(new > byte[0])", they all throw the ArrayIndexOutOfBoundException. > > -a > -- > Aaron Stromas | "Tick-tick-tick!!!... ja, Pantani is weg...." > Oracle Corp. | BRTN commentator, > +1 703 708 6821 | L'Alpe d'Huez, 1995 Tour de France > > ------------------------------------------------------------------------ > Name: att-1.htm > att-1.htm Type: Hypertext Markup Language (text/html) > Encoding: base64 > Description: Internet HTML -- Aaron Stromas | "Tick-tick-tick!!!... ja, Pantani is weg...." Oracle Corp. | BRTN commentator, +1 703 708 6821 | L'Alpe d'Huez, 1995 Tour de France
begin:vcard n:Stromas;Aaron tel;fax:+1 703-708 7922 tel;home:+1 301 493 4933 tel;work:+1 703 708 6821 x-mozilla-html:TRUE url:http://www.oracle.com org:Oracle;Advanced Technology Solutions adr:;;196 Van Buren Street;Herndon;VA;22070;USA version:2.1 email;internet:[EMAIL PROTECTED] title:Senior Principal consultant x-mozilla-cpt:;0 fn:Stromas, Aaron end:vcard
