4 Replies Latest reply on Jul 4, 2012 3:20 PM by 946598

    install method in JMRTD

      in JMRTD PassportAppler I found that they use the install method as follows:

      public static void install(byte[] buffer, short offset, byte length) {
      new PassportApplet(PassportCrypto.PERFECTWORLD_MODE).register();

      can the new object PassportApplet have different parameters than the install parameters ?!
      because all the examples that I saw in javacard doesn't look like this (the new object always has the same parameters as the the install method) and because I receive an error in the method install when I try to run their program as the following:

      Failed to install applet sos.passportapplet.Applet0
      INSTALL (for install) response check failed with SW 6F 00

      any help ?
        • 1. Re: install method in JMRTD
          I don't see why the constructor could only be called with the same param values as the install method (or why it should be limited to the signature of install).

          What card are you testing with? Does it support the necessary crypto? You might want to explicitly catch any exception in the constructor and see if it's a CryptoException (rethrow it with 6F01 if it is, 6F02 if it isn't).

          • 2. Re: install method in JMRTD
            many thanks for your reply
            I use JCS Suite v3.0 from G&D and I am still trying to running the program in the simulation before move it to the card, i am not sure if it support the "necessary" crypto for JMRTD and I hope you can help me to know that, and I would be really grateful if you can describe in more detail how can i write the CryptoException .. because I am really newbie in javacard .
            I forgot to mention that when I check the project proprieties i see the following in the builders tab:
            missing builder "com.ibm.bluez.jcop.eclipse.jcopbuilder"
            with the other builders, does this has any affect on the project?
            • 3. Re: install method in JMRTD

              I'm not familiar with that G+D product. We used NXP's JCOP tools during development, that's probably where the reference comes from.

              Is it possible to debug the applet and inspect the exception that is thrown in your simulator? (6F00 means some exception was not caught. I'd be interested to know what type it is, if of type CryptoException what the "reason" field is, etc.

              If you're not able to debug it in your environment, you could place a try-catch around code that you expect to fail. Something like:

              try { /* code */ } catch (CryptoException e) { ISOException.throwIt((short)0x6F00|e.getReason()); }

              and see if you get 6F03 instead of 6F00.

              The applet has many features that you may not have a use for at this point. This introduces some dependencies, for instance EAC relies on presence of ECC which may not be supported by your card or simulator. If you just want a BAC + AA MRTD then those dependencies are in the way. We should probably restructure the code to get a more modular design. See also this discussion: http://sourceforge.net/projects/jmrtd/forums/forum/580232/topic/4684229. (Unfortunately there are too many other priorities...)

              • 4. Re: install method in JMRTD
                thanks a lot

                and yes you were right
                I added the Exception and the program gives me 6F 03 error instead of 6F 00
                I put it in the constructor around these lines :

                keyStore = new KeyStore(mode);
                switch (mode) {
                case PassportCrypto.CREF_MODE:
                crypto = new CREFPassportCrypto(keyStore);
                case PassportCrypto.PERFECTWORLD_MODE:
                crypto = new PassportCrypto(keyStore);
                case PassportCrypto.JCOP41_MODE:
                crypto = new JCOP41PassportCrypto(keyStore);

                and the problem seems to be from the JCOP41PassportCrypto
                so, if I want to run the JMRTD with all its features and without any problem what environment/tools do I have to use ? and is there a specific version of eclipse or JCOP tool should I use that support these all the required functions ?

                and many thanks in advance.