13 Replies Latest reply: Mar 7, 2012 9:27 AM by 801926 RSS

    JCOP Simulation problem

    919486
      Hi all,

      I have a simple project just using basic Java Card API to implement OwnerPIN.
      My applet runs fine if I simulate with Generic JCOP v2.4.1 R3 but it will throw a PINException on the line:
      pin.update(default_pin, (short)0, (byte) pinLength);
      if I use newer version of JCOP (e.g JCOP 2.4.2 R0, R0.9, R1).

      Please help me to solve this problem.

      This is my whole java file:
      /**
       * 
       */
      package test;
      
      import javacard.framework.APDU;
      import javacard.framework.ISO7816;
      import javacard.framework.Applet;
      import javacard.framework.ISOException;
      import javacard.framework.JCSystem;
      import javacard.framework.OwnerPIN;
      import javacard.framework.PINException;
      //import javacard.security.*;
      
      //import javacard.framework.Util;
      
      /**
       * @author Khanh Huynh
       * 
       */
      public class Test1 extends Applet
      {
      
           public final static byte TEST_CLA = (byte) 0xA0;
      
           public final static byte PIN_CHECK = (byte) 0xD0;
           public final static byte PIN_CHANGE = (byte) 0xD2;
      
           public final static byte PIN_TRY_LIMIT = (byte)5;
           public final static byte PIN_LENGTH = (byte) 4;
      
           final static byte[] default_pin = {(byte)0x12, (byte)0x34};
      
           OwnerPIN pin;
      
           public Test1()
           {
      
                     pin = new OwnerPIN(PIN_TRY_LIMIT, PIN_LENGTH);
      
                
                try
                {
                     byte pinLength = (byte)default_pin.length;
                     pin.update(default_pin, (short)0, (byte) pinLength);
                } catch (Exception e)
                {
                     int i = 0; //dummy
                }
      
      
           }
      
           public static void install(byte[] bArray, short bOffset, byte bLength)
           {
                // GP-compliant JavaCard applet registration
                new test.Test1().register(bArray, (short) (bOffset + 1),
                          bArray[bOffset]);
           }
      
           public void process(APDU apdu)
           {
                // Good practice: Return 9000 on SELECT
                if (selectingApplet())
                {
                     return;
                }
                byte[] buffer = apdu.getBuffer();
      
                if (buffer[ISO7816.OFFSET_CLA] != TEST_CLA)
                     ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
      
                switch (buffer[ISO7816.OFFSET_INS])
                {
                 case (byte) 0x00:
                 break;
      
                case PIN_CHECK:
                     if (!pin.check(buffer, ISO7816.OFFSET_CDATA, (byte)apdu.setIncomingAndReceive()))
                          ISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);
                     break;
      
                case PIN_CHANGE:
                     JCSystem.beginTransaction();
                     pin.update(buffer, ISO7816.OFFSET_CDATA, (byte)apdu.setIncomingAndReceive());
                     JCSystem.commitTransaction();
                     break;
      
                default:
                     // good practice: If you don't know the INStruction, say so:
                     ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
                }
           }
      }
        • 1. Re: JCOP Simulation problem
          918757
          Could you send the Exception it sends. Your code catch the exception but it is not printing it, if you wanna debug your code, you will want to read that exception.
          • 2. Re: JCOP Simulation problem
            Umer
            Hi,

            I have tested your code and its working fine to me.
            But i have a few tips for you.

            First is try this code, it will throw a reason code in the form of exception and paste that exception you got here:
                      try
                      {
                           byte pinLength = (byte)default_pin.length;
                           pin.update(default_pin, (short)0, (byte) pinLength);
                      } catch (PINException e)
                      {
                           ISOException.throwIt(e.getReason());
                      }
            2nd NEVER use Integer values in applet.
            //don't use 
            int i=0;
            //use 
            byte i = (byte)0x00;
            //or if necessary
            short i = 0;
            3rd, Your PIN should be numeric and if you seen in the ascii table 0x12 have no mapping character value. Try to use PIN within range of
             30, 31, 32, 33, 34, 35, 36, 37, 38, 39
            (0   1   2   3   4   5   6   7   8   9)
            I hope you will not get exception again ..

            BR
            Umer
            • 3. Re: JCOP Simulation problem
              919486
              Hi FrancisOL and Umer,
              Thank you for your suggestion.
              I modified the code to get the reason for the exception and I got PINException with reason code 1 - ILLEGAL_VALUE.
              Like I said, this problem only occurs on simulation with some type of JCOP cards, on some other model, the code works fine.
              I really don't know what went wrong there.

              Btw Umer, why is it that I should not use int in applet?
              • 4. Re: JCOP Simulation problem
                Umer
                Khanh wrote:
                I modified the code to get the reason for the exception and I got PINException with reason code 1 - ILLEGAL_VALUE.
                Like I said, this problem only occurs on simulation with some type of JCOP cards, on some other model, the code works fine.
                I really don't know what went wrong there.
                Are you still using 0x12 within the default PIN ? If not and still the same problem then you might be right that problem is with the card type not with the code.
                Btw Umer, why is it that I should not use int in applet?
                As you know that the card has very limited memory(either RAM or EEPROM) so when you are using int = 0 instead of byte i = 0 then you are wasting 3 bytes as int uses *4 bytes* of memory.
                Also, most of the java cards don't have support for the int value they only support short and byte data types.

                BR
                Umer
                • 5. Re: JCOP Simulation problem
                  919486
                  Umer,
                  Are you still using 0x12 within the default PIN ? If not and still the same problem then you might be right that problem is with the card type not with the code.
                  I changed the default PIN to 0x30 0x31 and the Exception is still there.
                  • 6. Re: JCOP Simulation problem
                    Umer
                    Can you share the trace plz
                    • 7. Re: JCOP Simulation problem
                      919486
                      Trace:
                      cm>  /term "Remote|localhost:1862"
                      --Opening terminal
                      
                      /card -a a000000003000000 -c com.ibm.jc.CardManager
                      resetCard with timeout: 0 (ms) --Waiting for card... ATR=3B FC 13 00 00 81 31 FE 45 4A 43 4F 50 76 32 34    ;.....1.EJCOPv24     32 52 30 2E 39 C5                                  2R0.9. IOCTL(). ATR:          T = 1                   => 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00          .............. (1305 usec) <= 6F 65 84 08 A0 00 00 00 03 00 00 00 A5 59 9F 65    oe...........Y.e     01 FF 9F 6E 06 47 91 03 47 36 00 73 4A 06 07 2A    ...n.G..G6.sJ..*     86 48 86 FC 6B 01 60 0C 06 0A 2A 86 48 86 FC 6B    .H..k.`...*.H..k     02 02 01 01 63 09 06 07 2A 86 48 86 FC 6B 03 64    ....c...*.H..k.d     0B 06 09 2A 86 48 86 FC 6B 04 02 55 65 0B 06 09    ...*.H..k..Ue...     2B 85 10 86 48 64 02 01 03 66 0C 06 0A 2B 06 01    +...Hd...f...+..     04 01 2A 02 6E 01 02 90 00                         ..*.n.... 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 8A 92 B6 B2 C3 A9 B1 CB 00          .P............ (375115 usec) <= 00 00 74 74 6E 6E 6E 62 62 62 FF 02 00 00 3D 02    ..ttnnnbbb....=.     9C 31 C7 89 E2 69 B8 B1 31 01 6A CF 90 00          .1...i..1.j... Status: No Error cm>  ext-auth plain => 84 82 00 00 10 7C 36 D9 F1 33 31 E7 C1 29 8E 0E    .....|6..31..)..     1D 4B F6 B5 C8                                     .K... (65913 usec) <= 90 00                                              .. Status: No Error cm>  delete -r 7465737431 => 80 E4 00 80 07 4F 05 74 65 73 74 31 00             .....O.test1. (1395 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 -c -d -b 250 "C:\Workfile\Eclipse Projects\Test1\bin\test\javacard\test.cap" => 80 E6 02 00 12 05 74 65 73 74 31 08 A0 00 00 00    ......test1.....     03 00 00 00 00 00 00 00                            ........ (2512 usec) <= 00 90 00                                           ... Status: No Error Start loading Header.cap (27 byte) => 80 E8 00 00 1B C4 82 05 25 01 00 14 DE CA FF ED    ........%.......     02 02 04 00 01 05 74 65 73 74 31 04 74 65 73 74    ......test1.test     00                                                 . (2970 usec) <= 00 90 00                                           ... Status: No Error Header.cap loaded (27 byte) Start loading Directory.cap (36 byte) => 80 E8 00 01 24 02 00 21 00 14 00 21 00 09 00 0B    ....$..!...!....     00 4A 00 0E 00 AC 00 0F 00 1F 00 00 00 7F 03 0A    .J..............     00 02 00 01 00 02 01 01 00 00                      .......... (2384 usec) <= 00 90 00                                           ... Status: No Error Directory.cap loaded (36 byte) Start loading Import.cap (14 byte) => 80 E8 00 02 0E 04 00 0B 01 03 01 07 A0 00 00 00    ................     62 01 01 00                                        b... (2101 usec) <= 00 90 00                                           ... Status: No Error Import.cap loaded (14 byte) Start loading Applet.cap (12 byte) => 80 E8 00 03 0C 03 00 09 01 05 54 65 73 74 31 00    ..........Test1.     38 00                                              8. (1898 usec) <= 00 90 00                                           ... Status: No Error Applet.cap loaded (12 byte) Start loading Class.cap (17 byte) => 80 E8 00 04 11 06 00 0E 00 00 00 80 03 01 00 01    ................     07 01 00 00 00 4C 00                               .....L. (2650 usec) <= 00 90 00                                           ... Status: No Error Class.cap loaded (17 byte) Start loading Method.cap (175 byte) => 80 E8 00 05 AF 07 00 AC 01 00 1B 80 10 00 2D 00    ..............-.     07 05 12 18 8C 00 0F 18 8F 00 0E 3D 08 07 8C 00    ...........=....     02 87 00 7B 00 08 92 5B 30 AD 00 7B 00 08 03 1D    ...{...[0..{....     8B 00 0D 70 0C 2C 19 8B 00 0A 31 1E 8D 00 03 7A    ...p.,....1....z     05 30 8F 00 11 3D 8C 00 06 18 1D 04 41 18 1D 25    .0...=......A..%     8B 00 09 7A 04 21 18 8B 00 0B 60 03 7A 19 8B 00    ...z.!....`.z...     0C 2D 1A 03 25 10 A0 6A 08 11 6E 00 8D 00 03 1A    .-..%..j..n.....     04 25 75 00 3B 00 03 FF D0 00 11 FF D2 00 27 00    .%u.;.........'.     00 00 41 AD 00 1A 08 19 8B 00 05 5B 8B 00 04 61    ..A........[...a     24 11 69 82 8D 00 03 70 1C 8D 00 01 AD 00 1A 08    $.i....p........     19 8B 00 05 5B 8B 00 0D 8D 00 10 70 08 11 6D 00    ....[......p..m.     8D 00 03 7A 00                                     ...z. (2610 usec) <= 00 90 00                                           ... Status: No Error Method.cap loaded (175 byte) Start loading StaticField.cap (18 byte) => 80 E8 00 06 12 08 00 0F 00 02 00 01 00 01 03 00    ................     02 30 31 00 00 00 00 00                            .01..... (2639 usec) <= 00 90 00                                           ... Status: No Error StaticField.cap loaded (18 byte) Start loading ConstantPool.cap (77 byte) => 80 E8 00 07 4D 05 00 4A 00 12 02 00 02 00 06 80    ....M..J........     08 01 06 80 09 00 06 80 07 01 03 80 09 01 03 80    ................     0A 06 06 00 00 09 01 80 0B 00 05 00 00 00 03 80    ................     03 02 03 80 0B 01 03 80 03 03 03 80 0A 01 03 80    ................     09 08 01 80 09 00 06 80 03 00 06 80 08 02 01 00    ................     02 00 00                                           ... (8416 usec) <= 00 90 00                                           ... Status: No Error ConstantPool.cap loaded (77 byte) Start loading RefLocation.cap (34 byte) => 80 E8 00 08 22 09 00 1F 00 04 1A 08 5A 19 00 17    ....".......Z...     07 06 04 06 05 08 05 07 05 06 04 0A 07 07 0E 1C    ................     04 08 05 08 04 03 08 00                            ........ (5701 usec) <= 00 90 00                                           ... Status: No Error RefLocation.cap loaded (34 byte) Start loading Descriptor.cap (130 byte) => 80 E8 00 09 82 0B 00 7F 01 00 01 00 02 00 00 02    ................     00 03 FF 18 00 00 00 00 26 00 00 00 02 00 00 28    ........&......(     00 81 00 09 00 2C 00 2D 00 01 00 00 01 09 00 38    .....,.-.......8     00 2E 00 12 00 00 00 00 07 01 00 4C 00 31 00 5E    ...........L.1.^     00 00 00 00 00 12 00 28 00 2C 00 35 00 38 00 3A    .......(.,.5.8.:     00 3D 00 2C FF FF 00 26 00 2E 00 3D 00 3F 00 41    .=.,...&...=.?.A     00 2E FF FF 00 2C 00 2C FF FF 01 B0 05 68 00 90    .....,.,.....h..     01 10 04 B4 31 06 68 00 A1 03 33 10 02 41 04 B4    ....1.h...3..A..     32 01 40 01 20 01 B0 00                            2.@. ... (1998 usec) <= 00 90 00                                           ... Status: No Error Descriptor.cap loaded (130 byte) Start loading Debug.cap (781 byte) => 80 E8 00 0A FA 0C 03 0A 00 21 00 0A 74 65 73 74    .........!..test     2F 54 65 73 74 31 00 19 6A 61 76 61 63 61 72 64    /Test1..javacard     2F 66 72 61 6D 65 77 6F 72 6B 2F 41 70 70 6C 65    /framework/Apple     74 00 0A 54 65 73 74 31 2E 6A 61 76 61 00 08 54    t..Test1.java..T     45 53 54 5F 43 4C 41 00 01 42 00 09 50 49 4E 5F    EST_CLA..B..PIN_     43 48 45 43 4B 00 0A 50 49 4E 5F 43 48 41 4E 47    CHECK..PIN_CHANG     45 00 0D 50 49 4E 5F 54 52 59 5F 4C 49 4D 49 54    E..PIN_TRY_LIMIT     00 0A 50 49 4E 5F 4C 45 4E 47 54 48 00 0B 64 65    ..PIN_LENGTH..de     66 61 75 6C 74 5F 70 69 6E 00 02 5B 42 00 03 70    fault_pin..[B..p     69 6E 00 1D 4C 6A 61 76 61 63 61 72 64 2F 66 72    in..Ljavacard/fr     61 6D 65 77 6F 72 6B 2F 4F 77 6E 65 72 50 49 4E    amework/OwnerPIN     3B 00 06 3C 69 6E 69 74 3E 00 03 28 29 56 00 04    ;..<init>..()V..     74 68 69 73 00 0C 4C 74 65 73 74 2F 54 65 73 74    this..Ltest/Test     31 3B 00 09 70 69 6E 4C 65 6E 67 74 68 00 01 65    1;..pinLength..e     00 21 4C 6A 61 76 61 63 61 72 64 2F 66 72 61 6D    .!Ljavacard/fram     65 77 6F 72 6B 2F 50 49 4E 45 78 63 65 70 74 00    ework/PINExcept. (2098 usec) <= 00 90 00                                           ... Status: No Error => 80 E8 00 0B FA 69 6F 6E 3B 00 06 72 65 61 73 6F    .....ion;..reaso     6E 00 01 53 00 07 69 6E 73 74 61 6C 6C 00 07 28    n..S..install..(     5B 42 53 42 29 56 00 06 62 41 72 72 61 79 00 07    [BSB)V..bArray..     62 4F 66 66 73 65 74 00 07 62 4C 65 6E 67 74 68    bOffset..bLength     00 07 70 72 6F 63 65 73 73 00 1C 28 4C 6A 61 76    ..process..(Ljav     61 63 61 72 64 2F 66 72 61 6D 65 77 6F 72 6B 2F    acard/framework/     41 50 44 55 3B 29 56 00 04 61 70 64 75 00 19 4C    APDU;)V..apdu..L     6A 61 76 61 63 61 72 64 2F 66 72 61 6D 65 77 6F    javacard/framewo     72 6B 2F 41 50 44 55 3B 00 06 62 75 66 66 65 72    rk/APDU;..buffer     00 04 74 65 73 74 00 20 00 01 00 00 00 01 00 02    ..test. ........     00 01 00 02 00 00 07 00 03 00 03 00 04 00 19 FF    ................     FF FF A0 00 05 00 04 00 19 FF FF FF D0 00 06 00    ................     04 00 19 FF FF FF D2 00 07 00 04 00 19 00 00 00    ................     05 00 08 00 04 00 19 00 00 00 04 00 09 00 0A 00    ................     18 00 00 00 00 00 0B 00 0C 00 00 00 00 00 00 00    ................     0D 00 0E 00 01 00 09 02 00 2D 00 04 00 08 00 00    .........-...... (1503 usec) <= 00 90 00                                           ... Status: No Error => 80 E8 00 0C FA 00 0F 00 10 00 00 00 2D 01 00 11    ............-...     00 04 00 16 00 0C 01 00 12 00 13 00 23 00 09 02    ............#...     00 14 00 15 00 28 00 04 00 00 00 03 00 24 00 04    .....(.......$..     00 0F 00 26 00 10 00 15 00 29 00 16 00 21 00 2A    ...&.....)...!.*     00 22 00 22 00 2B 00 23 00 27 00 2D 00 28 00 2B    .".".+.#.'.-.(.+     00 2E 00 2C 00 2C 00 30 00 16 00 17 00 09 00 38    ...,.,.0.......8     02 00 12 00 03 00 04 00 00 18 00 0A 00 00 00 12    ................     01 00 19 00 15 00 00 00 12 02 00 1A 00 04 00 00    ................     00 12 00 00 00 0A 00 35 00 0B 00 0D 00 36 00 0E    .......5.....6..     00 10 00 35 00 11 00 11 00 37 00 1B 00 1C 00 01    ...5.....7......     00 4C 02 00 5E 00 03 00 0F 00 00 0F 00 10 00 00    .L..^...........     00 5E 01 00 1D 00 1E 00 00 00 5E 02 00 1F 00 0A    .^........^.....     00 0C 00 52 00 00 00 05 00 3C 00 06 00 06 00 3E    ...R.....<.....>     00 07 00 0B 00 40 00 0C 00 12 00 42 00 13 00 18    .....@.....B....     00 43 00 19 00 2C 00 45 00 2D 00 3A 00 4B 00 3B    .C...,.E.-.:.K.;     00 40 00 4C 00 41 00 42 00 4D 00 43 00 45 00 00    .@.L.A.B.M.C.E.. (1454 usec) <= 00 90 00                                           ... Status: No Error => 80 E8 80 0D 1F 50 00 46 00 51 00 51 00 52 00 54    .....P.F.Q.Q.R.T     00 52 00 55 00 56 00 53 00 57 00 5C 00 57 00 5D    .R.U.V.S.W.\.W.]     00 5D 00 59 00                                     .].Y. (27799 usec) <= 00 90 00                                           ... Status: No Error Debug.cap loaded (781 byte) Load report:   1321 bytes loaded in 1.2 seconds   effective code size on card:       + package AID       5       + applet AIDs       12       + classes           17       + methods           175       + statics           11       + exports           0      ------------------------------         overall           220  bytes cm>  install -i 5465737431  -q C9#() 7465737431 5465737431 => 80 E6 0C 00 18 05 74 65 73 74 31 05 54 65 73 74    ......test1.Test     31 05 54 65 73 74 31 01 00 02 C9 00 00 00          1.Test1....... (3949 msec) <= 6A 80                                              j. Status: Wrong data jcshell: Error code: 6a80 (Wrong data) jcshell: Wrong response APDU: 6A80 Unexpected error; aborting execution {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                      • 8. Re: JCOP Simulation problem
                        Umer
                        Can you install your applet without Pin initialization code ?
                        • 9. Re: JCOP Simulation problem
                          919486
                          Hi Umer,

                          If i comment out the line to initialize the PIN at the beginning then the applet would install.
                          However, if using the applet with that installation, I cannot update the PIN from sending APDU command either.
                          • 10. Re: JCOP Simulation problem
                            Umer
                            Hmm. Then the code is fine, problem is with your card.
                            • 11. Re: JCOP Simulation problem
                              safarmer
                              Hi,

                              Considering that the 2.4.2 R0 platform is quite new, there may be an issue in the simulation. Do you have access to physical card samples to try your code?

                              Also, with OwnerPIN, you can use no ASCII entries (it can be a passcode or a hash of a PIN as well). There is the GP CVM that requires specific formats but OwnerPIN does not have these restrictions. The ILLEGAL_VALUE exception is for when the PIN is too long.

                              Cheers,
                              Shane
                              • 12. Re: JCOP Simulation problem
                                919486
                                Hi Shane,

                                I also think there is a problem with the simulation.
                                I don't have the physical card samples to try my code yet.
                                I also tried to contact NXP to ask about this problem and they just answered that my code throw an Exception, without explaining why I can simulate it fine in older version of JCOP.
                                When I have a clearer answer from them I will post it here.

                                Cheers,
                                • 13. Re: JCOP Simulation problem
                                  801926
                                  If you use JCOP Tools, do not use the generic simulation, but only the specific product type. The issue with the generic simulations is that it's not export controlled, hence most of the functionality in crypto and apparently PIN is not supported.