JCOP Tools don't detect Omnikey Cardman 3121 reader in activation

Hello,
I am trying to activate the JCOP Tools in my MacOS X, but my reader isn't detected by Eclipse / JCOP Tools.
I have installed pcsc lite 1.4.4, and used pcsctest to check if the reader is working, and it seems to be ok:
xxx:~ tuxed$ pcsctest
MUSCLE PC/SC Lite Test Program
Testing SCardEstablishContext    : Command successful.
Testing SCardGetStatusChange
Please insert a working reader   : Command successful.
Testing SCardListReaders         : Command successful.
Reader 01: OMNIKEY CardMan 3x21 0 0
Enter the reader number          : 01
Waiting for card insertion        
                                 : Command successful.
Testing SCardConnect             : Command successful.
Testing SCardStatus              : Command successful.
Current Reader Name              : OMNIKEY CardMan 3x21 0 0
Current Reader State             : 34
Current Reader Protocol          : 0
Current Reader ATR Size          : b
Current Reader ATR Value         : 3B 67 00 00 29 20 00 6F 78 90 00
Testing SCardDisconnect          : Command successful.
Testing SCardReleaseContext      : Command successful.
PC/SC Test Completed Successfully !Can anyone give me any clue to solve the problem?
Thanks in advance :)

I don't know about MacOS, but you can check the info about Linux:
http://forum.java.sun.com/thread.jspa?forumID=23&threadID=5221167
PC/SC Support (Linux)
JCOP Tools only works with pcsc-lite 1.2.0.

Similar Messages

  • JCOP tools under linux - no readers detected for activation

    [eclipse 3.1.2, pcsc-lite 1.4, redhat el3]
    I just downloaded the JCOP tools as described in the following post:
    http://forum.java.sun.com/thread.jspa?forumID=23&threadID=722788
    I found that it would not install under linux, because win32 has been specified in the site and feature manifest files. When I removed these entries, it installed OK.
    Now, when I attempt to activate using my "engineering sample" card, the activation wizard notifies me that no PC/SC readers were detected. I'm puzzled by this, since pcsc-lite (1.4) is working well on my system, and I can see the reader & card being detected in pcscd's log. I have also been careful to ensure that eclipse knows about the shared library paths and I've even included jpcsc.jar as an extra library.
    If anyone else has JCOP tools working under linux, I'd appreciate any insights that might help. My issue may be simply that I have downloaded a custom windows distribution (tools.zip) - hence the manifest hack - perhaps there is a linux one?

    Could be the pcsc-lite 1.4 version the problem?
    http://forum.java.sun.com/thread.jspa?forumID=23&threadID=688560PC/SC Support (Linux)
    JCOP Tools only works with pcsc-lite 1.2.0.

  • Unknown Error with JCop Tools 3.1.2

    Hello All ,
    I am using Eclipse program to create a javacard applet...
    But there is a unknown Problem appears to me ..I don't know how to solve it.
    First of All ,
    My OS is Windows 7 x64 bit
    My java version is : 1.6
    My Eclipse version is : 3.2
    My Smart Card Reader is : Omnikey ,CardMan 5321
    So First of All , i added the plugin "JCOP tools 3.1.2" to the Eclipse program , and i activated the tools successfully.
    and i created a new javacard project by using Basic Javacard template
    Now when i want to Run ,
    SO i when i set the Run options to Card Reader , and set the card reader to "OmniKey"
    like this image:
    [Image 1|http://img85.imageshack.us/img85/1158/runx.jpg]
    -By the way , i don't understand where "Philps Pegoda Reader" came from?? -
    Then when i press Run , the Eclipse program will be closed and this error appears:
    [Error Image|http://img135.imageshack.us/img135/2926/errorevs.jpg]
    I am not sure what is the problem ... so please some one help me here...
    Thank you for your time
    Edited by: ahmed30 on May 25, 2010 8:44 AM

    Hi,
    The pegoda reader is the default reader that has hard coded support (like JCOP engineering sample cards). I would say this is because NXP was founded by Phillips.
    I cannot help you with the second issue. I have only used JCOP 3.1.2 for a short time (quite a while ago now) and reverted to 3.1.1.b as 3.1.2 did not add any new features and from memory did not work properly on my WIndows XP machine (32-bit). I can confirm that 3.1.1 works on XP 64-bit under a 32-bit JVM.
    Is the issue when running against a card or the simulator or both?
    You could try running the jcop.exe executable in the plugins\com.ibm.bluez.jcop.eclipse_<version>\simuls\nJCOP\win32\x86 directory from a command prompt to see if it is an issue with Eclipse/Java or the JCOP simulator.
    Cheers,
    Shane

  • Getting started with JCOP Tools

    I have a working Eclipse + JCOP Tools installation, activated. I now also have a Cardman reader (drivers loaded) and some blank JCOP30 cards. I read through the Eclipse embedded JCOP help page, but couldn't find the answers to some simple questions:
    1. How can I see a list of connected readers to ensure my reader hardware is recognized? I read earlier on the forums about a "Launch Configuration page". How do I access this page?
    2. The JCOP Shell seems to be working... my cards are blank and /terminal does show "Slot empty" or "Card present" so I presume the interface is running fine. My cards are totally blank. Can I still read any useful info from them such as vendor strings, version#, etc?
    3. Do the JCOP Tools 3.1.2 come with a sample project? Since I've never used this environment, I would love to see an example of working code that can be simulated or loaded onto a physical card. It would help me "learn by example"
    If there is sample code, where can I find it? I tried to use Eclipse's import from archive but didn't find anything resembling samples within jcop tools. Any example you know of would be great.

    Here is the ATR and cplc output for my card. So far I know with certainty it's JCOP30-something and it supports T=CL.
    But I'm not even sure which Java Card and Global Platform it supports! The "JCOP version map" from the 2003 specs document says JC 2.1.1 and GP 2.0.1, but http://www-306.ibm.com/software/wireless/wecos/jcop30.html says these cards are JC 2.2.1 and GP 2.1.1. Yikes! Which do I have?
    cm>  /atr
    resetCard with timeout: 0 (ms)
    --Waiting for card...
    ATR=3B 86 80 01 4A 43 4F 50 33 30 12                   ;...JCOP30.
    ATR: T=0, T=1, Hist="JCOP30"
    cm>  get-cplc
    => 80 CA 9F 7F 00                                     .....
    (11274 usec)
    <= 9F 7F 2A 40 70 95 16 40 51 30 84 30 1A 61 12 00    ..*@[email protected]..
        69 00 90 95 59 40 70 61 19 00 00 00 00 06 31 13    [email protected].
        30 36 39 30 30 00 00 00 00 00 00 00 00 90 00       06900..........
    Status: No Error
      IC Fabricator                      : 4070
      IC Type                            : 9516
      Operating System ID                : 4051
      Operating System release date      : 3084 (25.3.2003)
      Operating System release level     : 301A
      IC Fabrication Date                : 6112 (22.4.2006)
      IC Serial Number                   : 00690090
      IC Batch Identifier                : 9559
      IC Module Fabricator               : 4070
      IC Module Packaging Date           : 6119 (29.4.2006)
      ICC Manufacturer                   : 0000
      IC Embedding Date                  : 0000
      IC Pre-Personalizer                : 0631
      IC Pre-Perso. Equipment Date       : 1330 (26.11.2001)
      IC Pre-Perso. Equipment ID         : 36393030
      IC Personalizer                    : 0000
      IC Personalization Date            : 0000
      IC Perso. Equipment ID             : 00000000

  • JCOP tools??

    hi,
    i�m trying to develop with the JCOP tools but i would like to have more information about APIs (java) and the diferences between packages included in the CD (JCOP 30,10,21id,21sim...).I�ve used the documentation in the CD,JCOP xx technical briefs, but i still have some questions about it.
    My application is a simulation relying on cryptographic services,public key, digital signature and security certificates.Wich JCOP can i use in my implementation?
    Where can i find the visa openplatform api to use it?
    thank a lot,
    waiting for your response,Javier.

    I find it hard to believe you read the JCOPOverview.pdf that came with the kit and you don't know which cards to use. J-10 only has DES, j-20/30 contain DES and RSA. How can you not see that ?
    Go to GlobalPlatform.org and download the older version, 2.0.1. You can also download the 2.1 version to see the visa op APIs but they are deprecated.

  • FYI: IBM has quit the JCOP Tools!

    Hi,
    I just checked the JCOP-Tools news site for new versions and found the following notice:
    The JCOP project comes to a close in our lab.The whole team working on JCOP in Zurich says goodbye and thanks all the users of our tools and on-card software.
    Please note that no orders for JCOP cards and activation codes can be placed on this website after January 31, 2006.
    See it yourself: http://www.zurich.ibm.com/jcop/news/news.html
    My suggestion for all developer who are using the JCOP-tools:
    Make yourself a backup of the JCOP plugin so you will be able to install it even if the online installation repository isn't available anymore.
    At least download the current plugin-file:
    http://www.zurich.ibm.com/jcop/download/eclipse/plugins/com.ibm.bluez.jcop.eclipse_3.1.1.b.jar
    Additionally you can download the site and feature file, too:
    http://www.zurich.ibm.com/jcop/download/eclipse/site.xml
    http://www.zurich.ibm.com/jcop/download/eclipse/features/com.ibm.bluez.jcop.eclipse_3.1.1.b.jar
    This allows you do perform an offline installation of the JCOP tools in case you have to clean up your eclipse.
    For installation you can extract this jar into a new subdirectory (named "com.ibm.bluez.jcop.eclipse_3.1.1.b") of the eclipse "plugin" directory.
    BTW: They are explicitly referring to this forum for "questions and answers for using JCOP".
    Perhaps that means some of the formerly JCOP members will participate in this forum? - We will see...
    Jan

    Can anybody provide details of how JCOP tools can now
    be aquired?Obvious answer: contact IBM. There is a link on the old Zurich pages. I know that they still work on JCOP, but I presume they have changed the conditions on acquiring the JCOP tools, since they have matured and have left Zurich. IBM is used to doing this; see Aphaworks. If their products get to a certain stage, they become (part of) a commercial product. I don't think they still provide sample cards etc. Read their page to be sure.

  • Java card cap file install error in jcop tools

    When i try to run java card applet in real java card it gives this error.i used jcop tools and java version 1.5  and eclipse 3.2.when i run the applet in simulater it works fine.i saw some document it says allocate memory for the installation process.i don't know how to do that.
    /term "winscard:4|SCM Microsystems Inc. SCL010 Contactless Reader 0"
    --Opening terminal
    >  /card -a a000000003000000 -c com.ibm.jc.CardManager
    resetCard with timeout: 0 (ms)
    --Waiting for card...
    ATR=3B 8A 80 01 4A 43 4F 50 33 31 56 32 33 32 7A       ;...JCOP31V232z
    ATR: T=0, T=1, Hist="JCOP31V232"
    => 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00          ..............
    (23807 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 73 51 2E 00 73 4A 06 07 2A    ...n.G.sQ..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 15 65 0B 06 09    ...*.H..k...e...
        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 AC B1 90 01 BF 2D 24 A0 00          .P........-$..
    (49906 usec)
    <= 00 00 91 18 01 39 93 95 05 59 FF 02 00 2C BE 39    .....9...Y...,.9
        5E A5 07 55 87 B8 C3 A8 A6 93 66 2B 90 00          ^..U......f+..
    Status: No Error
    cm>  ext-auth plain
    => 84 82 00 00 10 0C AE 50 3E C8 7E 1D 92 29 E2 59    .......P>.~..).Y
        08 D9 DA 02 16                                     .....
    (57276 usec)
    <= 90 00                                              ..
    Status: No Error
    cm>  delete 060504030201
    => 80 E4 00 00 08 4F 06 06 05 04 03 02 01 00          .....O........
    (40041 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>  delete 010203040506
    => 80 E4 00 00 08 4F 06 01 02 03 04 05 06 00          .....O........
    (17392 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 -d -b 250 "Cap File location"
    => 80 E6 02 00 13 06 01 02 03 04 05 06 08 A0 00 00    ................
        00 03 00 00 00 00 00 00 00                         .........
    (32303 usec)
    <= 00 90 00                                           ...
    Status: No Error
    => 80 E8 00 00 FA C4 81 F2 01 00 23 DE CA FF ED 02    ..........#.....
        02 04 00 01 06 01 02 03 04 05 06 12 68 6D 73 2F    ............hms/
        6A 61 76 61 63 61 72 64 2F 68 65 6C 6C 6F 02 00    javacard/hello..
        21 00 23 00 21 00 0A 00 0B 00 1E 00 0E 00 3D 00    !.#.!.........=.
        0A 00 0B 00 00 00 4D 01 BE 00 00 00 00 00 00 01    ......M.........
        01 00 04 00 0B 01 02 01 07 A0 00 00 00 62 01 01    .............b..
        03 00 0A 01 06 06 05 04 03 02 01 00 08 06 00 0E    ................
        00 00 00 80 03 00 FF 00 07 01 00 00 00 1C 07 00    ................
        3D 00 01 10 18 8C 00 05 7A 05 30 8F 00 00 3D 8C    =.......z.0...=.
        00 01 18 1D 04 41 18 1D 25 8B 00 02 7A 02 21 18    .....A..%...z.!.
        8B 00 03 60 03 7A 19 8B 00 04 2D 1A 04 25 73 00    ...`.z....-..%s.
        09 00 00 00 00 00 0F 11 6D 00 8D 00 06 7A 08 00    ........m....z..
        0A 00 00 00 00 00 00 00 00 00 00 05 00 1E 00 07    ................
        01 00 02 00 06 00 00 01 03 80 03 02 03 80 03 03    ................
        03 80 0A 01 06 80 03 00 06 80 07 01 09 00 0B 00    ................
        00 00 07 05 06 04 0A 07 07 13 0B 00 4D 01 00 00    ............M...
    (764519 usec)
    <= 6A 80                                              j.
    Status: Wrong data
    jcshell: Error code: 6a80 (Wrong data)
    jcshell: Wrong response APDU: 6A80
    Unexpected error; aborting execution

    Thanks ReNa
    i am using nxp jcop 31 contact-less card.and it will support for java card 2.2.1 and global-platform card specification 2.1.1 .so i am using nxp jcop training 2007 tools and it has java card 2.2.1 and global-platform card specification 2.1.1.Inside my project there are three jar files these are jc221.jar and gp211.jar and bio10.jar
    i will appreciate your help
    Thanks

  • Where can I download JCOP tools and activate it

    as I have learned that :As of July 1st 2007, all support activities for the JCOP operating system on NXP/Philips silicon will be serviced by NXP Semiconductors.
    Please email requests for the JCOP Tools to: [email protected]
    It means that I have to request the JCOP Tools from the above mail and have no any other means?
    can you tell me other way to get the JCOP Tools, thank you very much!

    A guy from NXP explained to me that they need to follow export control regulations strictly as it is basically an U.S. product. The second thing is that most JCOP products are Common Criteria certified and this requires that also the simulation included in JCOP is handled under NDA. To remove JCOP Tools from all this constraints would mean that all crypto functionality is minimized to the same level as in Sun's Java Card development kit (tools + simulation).
    Maybe IBM had a smarter way of deailing with this or had a special deal with the U.S. customs, don't know.

  • JCOP tools plugin is unable to upload the applet

    Greetings.
    I have installed Eclipse 3.3 and JCOP tools (activated). We got ready Java Card applet and my task is to upload it into the Java Card. Firstly I want test it on a simulator.
    The applet compiled successfully and the .CAP file is created. But when upload -d "blah blah blah .cap" command is executed either by me or by jcshell, it returns immediately and I don't actually see any data transmitted to the card (in this case simulator). After the card-info command is executed I see this:
    Card Manager AID : A000000003000000
    Card Manager state : OP_READY
    Load File : LOADED (--------) A0000000035350 (Security Domain)
    Module : A000000003535041
    Load File : LOADED (--------) 01020304054F5449
    Module : 0102030405
    The last file has AID of my applet. But I know it is not there (on the card). When I run install command it does not return. I get nothing. JCOP tools seems to be busy and working but no response... neither error code nor exception.
    I'm stuck with this issue three days already. Could anybody help me?
    Thank you in advance.
    Best regards, Greg
    Software engineer at OTI
    Edited by: neutrino on Oct 31, 2007 6:01 AM

    Hi.
    It is advised to install Eclipse 3.1.2, jdk 1.4.2 for JCOP tools plug-in 3.1.1.b/3.1.2.
    Also, regarding the usage of JCOP shell, write:
    /mode trace=on
    before uploading of your cap file to trace all the APDUs.
    Best regards,
    Eve
    Edited by: Ieva on Oct 31, 2007 6:38 AM

  • JCOP Tools 3.1.1.b and other Cards

    Hello
    At the moment I'am working at my degree dissertation. A little part of this dissertation is to write a cardlet on a javacard.
    I have got the JCOP Tools 3.1.1.b for Eclipse, but JavaCards of other      producers: Safenet Model 330J, GemSafeXpresso 32 k and cyberflex Access e-gate 32K(Schlumberger / Axalto).
    At the moment i don't know how to bring my java card applet on the card.
    In the JCOP Tools i can only choose the preconfigured Type "JCOP Engeneering Sample". Is there a way to become more preconfigured card types? Or anyone knows the custom type settings for any of the cards?

    I am on a similiar assignment in my office and not an expert but after a couple of weeks of research i have found a few things.
    1. Its better to get JCOP20,JCOP30 or JCOP41 cards for compatibility reason and avoiding over work
    2. Buy a PC/SC compliant Smart Card Reader for compatibility reasons.
    i have already ordered these.
    Secondly check this link for loader application, code is fine but cap file version was the issue.
    http://forum.java.sun.com/thread.jspa?forumID=23&threadID=702955
    i havnot got the real cards but i believe that JCOP tools will be able to uplaod the application on it without the need of above code. As running simulations we have option of Install in the ide.
    Any ways some expert guy on the forum will answer you shortly -:)
    Bilal

  • JCOP Tools init-update problem

    Hello, everybody!!!
    I wanna simulate CardManager authentication behaviour and have some problems... Below i show you excerpts from my applet and the process of sending INITIALIZE UPDATE command to it using JCOP Shell.
    If somebody has an idea to deal with this issue, please help.
    Here's the definition of key i've used:
    byte[] secKey = new byte[] {
          (byte)0x40, (byte)0x41, (byte)0x42, (byte)0x43,
          (byte)0x44, (byte)0x45, (byte)0x46, (byte)0x47
    };This is done inside the constructor (secKey declared as a class field).
    Next, i've added method to process INITIALIZE UPDATE command:
       private boolean processInitUpdate(APDU apdu) {
          byte[] buffer = apdu.getBuffer();
          if((buffer[ISO7816.OFFSET_CLA] != 0x80) &&
                (buffer[ISO7816.OFFSET_INS] != 0x50))
             return false;
          byte challengeLen = buffer[ISO7816.OFFSET_LC];
          byte dataRead = (byte)apdu.setIncomingAndReceive();
          if((challengeLen != 0x08) || (dataRead != 0x08)) {
             ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
          // Encrypted cryptogram buffer
          byte[] cryptogram = new byte[8];
          DESKey des_key = (DESKey)KeyBuilder.buildKey(
                KeyBuilder.TYPE_DES, KeyBuilder.LENGTH_DES, false);
          des_key.setKey(secKey, (short)0);
          Cipher cipher = Cipher.getInstance(Cipher.ALG_DES_ECB_NOPAD, false);
          cipher.init(des_key, Cipher.MODE_ENCRYPT);
          // Encrypt the incoming challenge
          cipher.doFinal(buffer, ISO7816.OFFSET_CDATA, (byte)8, cryptogram, (byte)0);
          // Output data
          byte[] keyDeriviation = new byte[] {
                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00
          byte[] keyInfo = new byte[] {
                (byte)0xff, (byte)0x02
          // TODO generate random
          byte[] challenge = new byte[] {
                (byte)0x11, (byte)0x22, (byte)0x33, (byte)0x44,
                (byte)0x55, (byte)0x66, (byte)0x77, (byte)0x88
          // Calculate total length of the data to be sent
          short totalLen = (short)(keyDeriviation.length + keyInfo.length +
                                   cryptogram.length + challenge.length);
          apdu.setOutgoing();
          apdu.setOutgoingLength(totalLen);
          apdu.sendBytesLong(keyDeriviation, (short)0, (short)keyDeriviation.length);
          apdu.sendBytesLong(keyInfo, (short)0, (short)keyInfo.length);
          apdu.sendBytesLong(challenge, (short)0, (short)challenge.length);
          apdu.sendBytesLong(cryptogram, (short)0, (short)cryptogram.length);
          return true;
       }This method returns true if command has been processed successfully.
    I've used GlobalPlatform specification to properly parse command APDU and to generate response APDU.
    Then i use JCOP Tools for Eclipse shell. I select above applet and define keys as follows:
    set-key 255/1/DES-ECB/4041424344454647
    set-key 255/2/DES-ECB/4041424344454647
    set-key 255/3/DES-ECB/4041424344454647Then i use init-update command:
    init-update 255Shell generates the following APDU command sequence:
    80 50 00 00 08 C3 17 13 59 C6 0F ED ED 00We can see the challenge, generated by simulator: C3 17 13 59 C6 0F ED ED.
    I got the response:
    00 00 00 00 00 00 00 00 00 00 FF 02 11 22 33 44 55 66 77 88 4D 4C E8 7E 6A 04 B1 43 90 00It seems everything all right, but shell shows an error:
    Status: No Error
    jcshell: Error code: -5 (Authentication failed)
    jcshell: Wrong response APDU: 00000000000000000000FF0211223344556677884D4CE87E6A04B1439000I think I set keys inside the shell incorrectly. I use triple-DES, but code uses simple DES. However, i use equal keysets for triple-DES so it's the same as DES.
    What's wrong?
    Thank you.

    Hello everybody, again!
    At last, I solved my problem. The issue was I incorrectly generated card cryptogram data. Cryptogram must be constructed using full triple DES algorithm. After that JCOP shell processes init-update 255 successfully.
    Below I'll present working code for processing INITIALIZE UPDATE command in JCOP tools, maybe this will be helpful for somebody.
       private boolean processInitUpdate(APDU apdu) {
          byte[] buffer = apdu.getBuffer();
          // Whether this INITIALIZE UPDATE command?
          if((buffer[ISO7816.OFFSET_CLA] != 0x80) &&
                (buffer[ISO7816.OFFSET_INS] != 0x50))
             return false;
          byte challengeLen = buffer[ISO7816.OFFSET_LC];
          byte dataRead = (byte)apdu.setIncomingAndReceive();
          if((challengeLen != 0x08) || (dataRead != 0x08)) {
             ISOException.throwIt(ISO7816.SW_WRONG_LENGTH);
          // TODO generate random
          // Card challange
          byte[] challenge = new byte[] {
                (byte)0x11, (byte)0x22, (byte)0x33, (byte)0x44,
                (byte)0x55, (byte)0x66, (byte)0x77, (byte)0x88
          // DES Secure Channel Encryption Key (S-ENC) generation
          // Deriviation data array
          byte[] derivData = new byte[16];
          // Secure Channel Encryption Key data array
          byte[] s_enc_key = new byte[16];
          // The construction of deriviation data
          Util.arrayCopy(buffer, (short)(ISO7816.OFFSET_CDATA + 4), derivData, (short)12, (short)4);
          Util.arrayCopy(challenge, (short)0, derivData, (short)8, (short)4);
          Util.arrayCopy(buffer, ISO7816.OFFSET_CDATA, derivData, (short)4, (short)4);
          Util.arrayCopy(challenge, (short)4, derivData, (short)0, (short)4);
          // Construct and initialize Cipher with des_key
          DESKey des_key = (DESKey)KeyBuilder.buildKey(
                KeyBuilder.TYPE_DES, KeyBuilder.LENGTH_DES3_2KEY, false);
          des_key.setKey(secKey, (short)0);
          Cipher cipher = Cipher.getInstance(Cipher.ALG_DES_ECB_NOPAD, false);
          cipher.init(des_key, Cipher.MODE_ENCRYPT);
          // Generate session S-ENC key
          cipher.doFinal(derivData, (byte)0, (byte)derivData.length, s_enc_key, (byte)0);
          // Card Authentication Cryptogram generation
          // Cryptogram data array
          byte[] cryptogram = new byte[8];
          // Initial vector data
          byte[] initVector = new byte[] {
                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00
          // Construct and initialize Cipher with s_enc_key
          des_key.setKey(s_enc_key, (short)0);
          cipher = Cipher.getInstance(Cipher.ALG_DES_CBC_NOPAD, false);
          cipher.init(des_key, Cipher.MODE_ENCRYPT, initVector, (short)0, (short)initVector.length);
          // Extract host challenge from input buffer
          byte[] hostChallenge = new byte[8];
          Util.arrayCopy(buffer, ISO7816.OFFSET_CDATA, hostChallenge, (short)0, (short)hostChallenge.length);
          // Step 1: Encrypt host challenge using ICV of binary zeroes
          byte[] inputData = xorOperation(initVector, hostChallenge);
          cipher.doFinal(inputData, (short)0, (short)inputData.length, cryptogram, (short)0);
          // Step 2: Encrypt card challenge using results of the previous operation
          inputData = xorOperation(cryptogram, challenge);
          cipher.doFinal(inputData, (short)0, (short)inputData.length, cryptogram, (short)0);
          // Step 3: Encrypt DES padding data using results of the previous operation
          byte[] pad = new byte[] {
                (byte)0x80, (byte)0x00, (byte)0x00, (byte)0x00,
                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00
          inputData = xorOperation(cryptogram, pad);
          cipher.doFinal(inputData, (short)0, (short)inputData.length, cryptogram, (short)0);
          // Generate output
          byte[] keyDeriviation = new byte[] {
                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
                (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00
          byte[] keyInfo = new byte[] {
                (byte)0xff, (byte)0x01
          // Calculate total length of the data to be sent
          short totalLen = (short)(keyDeriviation.length + keyInfo.length +
                                   cryptogram.length + challenge.length);
          apdu.setOutgoing();
          apdu.setOutgoingLength(totalLen);
          apdu.sendBytesLong(keyDeriviation, (short)0, (short)keyDeriviation.length);
          apdu.sendBytesLong(keyInfo, (short)0, (short)keyInfo.length);
          apdu.sendBytesLong(challenge, (short)0, (short)challenge.length);
          apdu.sendBytesLong(cryptogram, (short)0, (short)cryptogram.length);
          return true;
       private byte[] xorOperation(byte[] op1, byte[] op2) {
          byte[] res = new byte[8];
          if((op1.length != 8) || (op2.length != 8)) return null;
          for(byte i = 0; i < res.length; i++) {
             res[i] = (byte)(op1[i] ^ op2);
    return res;
    Regards, Eugene.

  • JCOP Tools site.xml

    Good day!
    i have already the file com.ibm.bluez.jcop.eclipse_3.1.1.b necessary for the installation of the eclipse plugin of the jcop tools.
    but this file is missing the Site.xml file necessary for the instalation, it gives me the error "not a valid update site" when it try to do an offline install
    Could anyone with a valid Site.xml file for this install tell me how to build it? or where to download it? or send it via email to me at [email protected]!
    i would be most appreciative for the help!
    Alex.

    Whu don't you choose 'archived site'?

  • JCOP Tools "This package has not been built"

    Hello,
    I'm using the Eclipse with JCOP Tools 3.1.1 and sometimes the .cap file is not built and the upload of the Applet fails when running the project
    cm> upload ".../workspace.1j.../myapp.cap"
    jcshell: Cannot read </../../myapp.cap>: java.util.zip.ZipException: error in opening zip fileThe "CAP File Properties" view in Eclipse says "This package has not been built" but I don't know how to force the build of the package. I tried to clean, manually/automatically build the project but it just won't get build :(
    Any ideas ?
    Thanks.
    Tex

    well nevermind, when this happens I just build the .cap alone:
    cd myproject/bin
    ..../java_card_kit-2_2_1/bin/converter -out CAP -applet 0x01:0x02:0x03:0x04:0x05:0x2E:0x61:0x70:0x70 com.test.MyApplet com.test 0x01:0x02:0x03:0x04:0x05 1.0 Tex

  • Can't get JCOP tools

    Hi everyone,
    I need to develop a Java Card application for NXP JCOP 21 - 36Kb cards. I don't have cards so far but want to look at JCOP API to ensure it is what I need and can work with.
    However, it seems that I simply can't get JCOP from anywhere! I tried to download it from IBM and here's what I got it tools.zip:
    As of July 1st 2007, all support activities for the JCOP operating system on NXP/Philips silicon will be serviced by  NXP Semiconductors.
    Please email requests for the JCOP Tools to: [email protected]
    As you may have guessed I wrote them to NXP. They don't reply for 4 days already. What am I supposed to do? Any ideas would be appreciated.
    Thanks in advance.

    Hi DomElion
    Ive been researching extensively on java smartcard project for a while since I got involved in one such project very recently. Im a total newbie hence need some guidance regarding the same. Came across this posting and thought maybe I could get some help (which I desparately need now :(( )
    Ive got SETECS 256k java smart card and a card reader. I installed java card 2.2, gpshell and java 6 (for smartcard IO). But sinct smart card IO can be used only to communicate with the card (and applets already on card) I still need java card kit and GPShell to install/load applets on the card. Hence Im now trying to understand the helloWorld applet loading given as example in the GPShell installation. But Im unable to understand few things in their script (which Im sure might be very basic and foolish of me to not understand that too :( ). But Ive successfully tried simulator, but I really need to write something and read it back from the "real" card !!
    Request to please please help me understand how to write and read back using GPShell. For example this is the script provided as sample by GPShell
    mode_211
    enable_trace
    establish_context
    card_connect
    select -AID a000000003000000
    open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f // Open secure channel
    delete -AID a00000006203010c0101
    delete -AID a00000006203010c01
    install -file HelloWorld.cap -nvDataLimit 2000 -instParam 00 -priv 2
    getdata
    # close_sc // Close secure channel
    # putkey // Put key
    // options:
    // -keyind Key index
    // -keyver Key version
    // -key Key value in hex
    card_disconnect
    release_context
    As seen above the line in bold is installing the helloworld on the card. But where is the AID assigned to it? What are the AIDs which are getting deleted? And what is the "select -AID a000000003000000" meaning?
    Also now that I have the helloWorld on the card how can I read that applet back to return to me "hello world" using smartcard io or even java card 2.2?
    Please please please please help !
    Thanks so much
    WAITING to hear back
    Best Regards

  • Jcop tool

    I just bought the JCOP tools and a javacard reader/writer and i am so much confused as per its functions one of the problems i am having
    is that
    (1) In Suns Javacard parkage , AIDS are in the form 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0x8:0x1 while in the JCOP
    environment i noticed was in the form 01020304050601 which i assumed is in the decimal format how do i convert.
    (2) i tried writing a program which compiled well , when i wanted to test it with the JCShell it came out with this
    error "Not yet Connected to terminal" What could be the cause of this.
    (3) I have a Gemplus GPR400 Reader/writer attached to my laptop, though the computer has located and loaded drivers for it
    i still don't know how to like access the reader or download applets onto it , I don't know if the JCOP tool can download onto it

    >
    3. JCOP requires a PC/SC reader attached if you want
    to load onto one of the JCOP cards. You can also use
    the simulator for debugging. It appears that your
    reader might not be found, which could be related to
    question 2.yeah i guess so cos when i went to services i tried starting "Smart Card Resource Manager" and "Smart Card Helper" they would not start , they always give this error "The Dependency Service or group failed to start" what can be causing this probs i am using win Xp

Maybe you are looking for