March 18th, 2010

jcManager – Java Secure Card Manager (UPDATED)

Here is one of my projects concerning the Java Secure Cards. It’s called jcManager and it is a visual tool for the management of the jcop cards: adding/changing keys, uploading packages/applets, deleting, displaying card information, etc.

Some time ago there was a JCOP tools plugin for the eclipse IDE developed by IBM labs in Zurich but it is no longer available (moved to NXP). So, for those of you searching for an easy to use tool which lets you do all sort of operations on java secure cards, conforming to the Global Platform specification, here are some of the features of jcManager:

- low-level implementation according to GobalPlatform Card Specification
- supports both SCP01 and SCP02 card protocols
- open source
- cross-platform
- display detailed debug information to be able to understand the complex low-level operations – derivations, encryptions, padding, etc
- uses the musclecard pcsc java implementation for the low-level communication with readers/cards. Also, it is fully compatible with the IBM JCOP implementation  - if you do have the offcard.jar library from IBM it will also seamlessly work with it.
- works with the majority of card readers (pcsc compatible). Tested with Schlumberger, Omnikey, etc

UPDATED 11.10.2011:
Thanks to Martin Paljak there’s now a Github repository for the jcManager and an adaptation for it to work with javax.smartcardio instead of pcsc.

UPDATED 13.04.2010:
Version 1.2
-solved a problem when uploading JCDK generated CAP file

UPDATED 19.03.2010:

Version 1.1
- new and improved GUI
- possibility to select the reader
- better output – display all commands sent to card and the responses
-
specify card manager AID
- specify applet install command parameters
… and many more

Of course, there are some minor things still to be done, like:
- possibility to delete a single applet/package, for now it provides only a reset card button which deletes everything on the card

But hey, it’s open source, so it may be modified as you like. Please post a comment below if it does/does not work and if you need something more.

Will post shortly a simple card applet and some more details on compiling. And also C and Java code to use java cards in your own applications.

Hope it helps, here is the latest version:

jcManager-1.2.win.zip – Windows binary

jcManager-1.2.linux.zip – Linux/Unix binary

jcManager-1.2.source.zip source code

59 Comments »

Comment by Steve
  • Wow, thanks, it really saved my day.
    worked great with my reader+card on windows 7.

    Will it be possible to select a reader in the near future? – I usually have more than 1 connected to my computer. Or should I look in the sourcecode myself…

    Thanks again
    steve

    March 19, 2010 @ 08:12
  • Comment by bebe
  • Yes, I will add reader selection as soon as I can.

    Added

    stefan

    March 19, 2010 @ 08:41
  • Comment by Onur
  • This is a great tool. Really appreciate it. I still didn’t use it but I see that it has the facility to download the CAP file onto the card and also clear the card of it.

    What about creation of the CAP file? Is there a tool you suggest for this operation?

    March 31, 2010 @ 18:52
  • Comment by hmiika
  • i’d like to test this JCmanager with emulaors, could you help me !

    April 5, 2010 @ 11:14
  • Comment by bebe
  • @Onur : CAP creation tutorial will come as soon as I will find some time to post.

    @hmiika: You have complete source code. Adapt it to suit whatever needs you have

    stefan

    April 7, 2010 @ 00:45
  • Comment by Puri
  • Hi.

    Any idea why do I get this message while trying to upload a CAP file?

    Load CAP
    -> 84 E8 80 00 10 99 00 40 B1 5B 3B FF 9D 59 43 A8 CE 72 DE 7C 8A
    84 E6 0C 00 38 F5 3D 40 AC 88 B1 78 AA 96 00 A7 44 3C CD F5 A8 1A 01 4C BF CE 6C 1D D2 BF 8A 8A D5 AA A7 2B 35 C5 C9 EE 4A 6C 5F 21 65 DF 34 44 E2 57 45 AA 22 88 5C 01 0F F0 4B 69 27
    <- 6A 88
    Could not load applet. See debug for more info

    I'm trying to upload a helloworld application that came with java card specs.

    Tks.

    April 11, 2010 @ 19:12
  • Comment by Luciano
  • Your tool needs some viewer of the card’s ATR.

    April 12, 2010 @ 08:40
  • Comment by Luciano
  • Your tool needs some viewer of the card\’s ATR.

    April 12, 2010 @ 08:40
  • Comment by Onur
  • Thanks alot!!
    I searched around to get how to convert class to CAP. I can help putting up together a tutorial for you to post if you wish.

    So, I tried uploading the CAP I generated but I keep getting this error:

    **********************
    Selecting Card Manager
    ***********************
    -> 00 A4 04 00 08 A0 00 00 00 03 00 00 00
    80 50 00 00 08 83 D5 45 E0 19 49 A6 06
    84 82 03 00 10 A4 8D 8A B1 AE E3 5E F0 68 EF 83 BD 6D 00 F0 BB
    <- 69 82
    Could not authenticate. Aborting.

    Do you know what I have to do to complete the operation successfully? If I am able to do this then I will use this way to download CAPs to the cards.

    April 12, 2010 @ 09:49
  • Comment by bebe
  • @Onur: Check if your Card Manager AID is correct, you may get it by sending a SELECT command without data field: 00 A4 04 00 00.
    I will add an CM AID auto-detect button in the next days, hopefully this week. Also – to be able to upload a cap file to the card, jcManager needs to authenticate first, so check that your auth keys are correct.

    @Puri: I do not know what type of CAP file you are trying to upload. As I said I will post a tutorial on generating a CAP file from source…
    6A88 means: Reference data not found

    Stefan

    April 12, 2010 @ 10:12
  • Comment by Onur
  • I have acheived my authentication keys and applied. jcManager is able to authenticate. Install for load also returns a 9000 SW, but when jcManager tries to Load the CAP I get 6A88 SW.

    Load CAP
    -> 84 E8 80 00 10 3A 8C 86 32 F4 AE 6A FF 46 A8 63 D5 70 85 B5 44
    84 E6 0C 00 28 EC AE 6E 38 97 64 90 5F 82 A6 57 F8 7C 2F 06 D7 34 95 FF EF 7E 87 A6 3A 69 13 78 47 67 E3 10 A0 80 80 A2 EF 1D A5 C0 FD
    <- 6A 88
    Could not load applet. See debug for more info

    I am doing this for completing a task at work. Mr.Stefan, I have discussed with my managers, if you can contact me and support us, my company is willing to make it worth your while.

    April 12, 2010 @ 11:01
  • Comment by Onur
  • onur.tacettin@skype

    April 12, 2010 @ 11:03
  • Comment by Onur
  • My CAP file is generated via Sun’s Java Card 2.2.1 Development Kit’s Converter.jar

    April 12, 2010 @ 11:14
  • Comment by bebe
  • Onur: Send me an e-mail (bebeto -at- gmail -dot- com) and I will try to help you.

    Stefan

    April 12, 2010 @ 11:35
  • Comment by bebe
  • @Puri: Please check now with version 1.2, your problem should be solved

    Stefan

    April 13, 2010 @ 14:08
  • Comment by Puri
  • Stefan,

    it works!!!

    Tks a lot, really help me out! :D

    April 14, 2010 @ 01:10
  • Comment by Puri
  • Stefan, i was using jcmanager for a while, and now i getting this message every time:

    Open terminal …
    EstablishContext(): …
    Wait for card in a certain reader …
    Pick reader …
    **********************
    Selecting Card Manager
    ***********************
    -> 00 A4 04 00 08 A0 00 00 00 03 00 00 00
    80 50 00 00 08 45 7D C3 3C 35 07 41 40
    <- 69 82

    Always…

    Any idea?

    May 2, 2010 @ 19:16
  • Comment by bebe
  • I think the Card Manager AID you are sending to the card (A0 00 00 00 03 00 00 00) is not the correct one.
    Try with A0 00 00 00 03 00 00, I encountered cards with this AID also.
    If you do not know it, you may get it by sending a SELECT command without data field: 00 A4 04 00 00. I got no time to implement the custom APDU send to the cards and the auto-detection of CM AID, but you may modify the source code and send the custom APDU

    Stefan

    May 3, 2010 @ 10:08
  • Comment by Martin
  • Do you know GPJ (http://gpj.sf.net) How does it compare to GPJ? What about creating a single card management library?

    May 20, 2010 @ 08:19
  • Comment by Martin
  • Some comments after a short peek:
    - don’t use jpcsc, it’s an old piece of crap. Use Java 1.6+ and javax.smartcardio, which is actually a usable smart card access framework for Java (finally)
    - the .so you distribute is for *Linux* not “Linux/Unix binary” (for the same reason, using javax.smartcardio is superior to JNI bridges)
    - Even after I added jpcsc into my Mac, the GUI does not look OK on OS X.

    May 20, 2010 @ 08:26
  • Comment by bebe
  • Hi Martin,

    Thanks for your comments:

    - it is a GP implementation, so exactly what is used to communicate with the card is not so important. Its main target is to help understanding the GP specification – encryption, derivation, key generation, etc – and, of course, to provide an easy way to manage java cards.

    - The .so for linux is from MUSCLE. The same is the dll for windows. Feel free to use the IBM JCOP implementation or any other that is able to connect and send an APDU to the card. jcManager do not rely on the way you connect and sent APDUs to the card – so adding support for javax.smartcardio is very easy, just look in the source code.

    -feel free to modify the GUI to suit your needs, unfortunately I do not have the time to test on multiple platforms or improve jcmanager now. Being a pure swing interface, it should look similar on all platforms.

    Stefan

    May 20, 2010 @ 10:18
  • Comment by Martin
  • I consider Mac OS X a Unix but the download for Linux/Unix did not work. So would be nice to make it clear – it is for Linux only.

    I added a link to this post to http://www.opensc-project.org/opensc/wiki/Java If you know smart card related projects in Java, please add a link!

    May 20, 2010 @ 13:50
  • Comment by marti
  • Hi!

    I run on windows…
    when I run your program, I obtain:

    Exception in thread “Thread-4″ java.lang.NoClassDefFoundError: Could not initialize class com.linuxnet.jpcsc.PCSC
    at com.braicu.jcm.card.CardWorker.disconnectCard(CardWorker.java:507)
    at com.braicu.jcm.JCManager$22.construct(JCManager.java:619)
    at com.braicu.jcm.layout.MySwingWorker$2.run(MySwingWorker.java:108)
    at java.lang.Thread.run(Unknown Source)

    What is the solution?

    Thanks!!

    Martí

    May 26, 2010 @ 10:05
  • Comment by bebe
  • @marti: you do not have jpcsc.dll in your java lib path. See here:
    http://forums.sun.com/thread.jspa?forumID=23&threadID=5433283

    Stefan

    May 26, 2010 @ 18:58
  • Comment by Alireza firoozian
  • hi . first of all thanks for your nice Jcardmanager. i try to copile your source in eclipse but after loading the gui in fetching readers this exception will be thrown

    Exception in thread “Thread-4″ java.lang.NoClassDefFoundError: Could not initialize class com.linuxnet.jpcsc.PCSC
    at com.CardWorker.disconnectCard(CardWorker.java:490)
    at com.JCManager$22.construct(JCManager.java:605)
    at com.MySwingWorker$2.run(MySwingWorker.java:108)
    at java.lang.Thread.run(Thread.java:619)
    what is the problem?

    May 30, 2010 @ 09:36
  • Comment by bebe
  • Add jpcsc.dll to your java library path. You may do this by specifying:
    -Djava.library.path=res
    to your VM arguments on the run configuration…
    (of course if you moved jpcsc.dll from the res subdir, then you need to specify the new location)

    Stefan

    May 30, 2010 @ 23:01
  • Comment by Alireza firoozian
  • Thanks. its worked

    May 31, 2010 @ 12:09
  • Comment by Vibhor
  • Hi,

    Thank you so much for the wonderful utility. I am having some problem loading the cap file. Below is the code that comes in the debug.

    ************
    UplaodCAP
    *************
    Get AID from header.cap file
    FOR LOAD DATA: EF 04 C6 02 01 7B
    AID:A0 00 00 00 62 03 01 0C 01 01
    Applet AID:A0 00 00 00 62 03 01 0C 01
    Try to delete if existing…
    -> 84 E4 00 00 18 BD EF 55 C8 E2 EF DD 33 D5 01 F4 DB 71 83 66 15 62 80 7E 08 5B A9 B0 A0
    84 E4 00 00 18 81 F0 DB F2 54 1A A0 FE 92 0C 7C 2C AD 54 5A 7C 73 80 BC AE 9D E2 8A A7
    84 E6 02 00 20 09 4D AF 66 49 C2 FB DD 1D 6E E5 C1 6A 50 A4 BE BA F6 CF 61 63 FD 1C BF B1 3F 86 60 6A 6C 8D DA
    84 E8 00 00 D8 A1 13 02 3F 79 A3 F9 8E 67 57 08 B1 88 33 33 54 5F 9B FB 72 19 3A A8 53 BF 93 45 C1 E2 7A 9B 42 55 0B 08 23 2E 4F FB 9E 73 5C 1A DC 51 D9 A2 7A A0 38 56 F9 DB 5F 6A 04 3B 59 91 35 B4 04 00 9A F7 06 A8 FA 46 45 EB 74 67 E5 BF BD 9D 3D A5 DC 45 68 48 CE 8A 6E C0 70 67 28 53 A2 91 26 F7 D2 AB 02 A8 39 EE 4C 48 2A 80 03 B0 74 6D F2 DB A3 39 F0 A2 0C 5D 98 2F C6 F5 05 6A 1D E6 E2 96 16 21 CA 00 E3 35 4B CD A0 62 2E 0D D3 08 76 12 8A 30 2C 9B BE 7F F9 6E 62 0E 1D A8 B6 BB 08 05 85 06 A1 8A 63 D0 52 AA 69 00 8C 72 66 A4 B2 AF 3D 99 06 23 7C 00 32 18 72 06 F3 B0 EF 54 48 F1 BF 56 19 53 66 FE C4 FE A4 E2 07 8E 9A 63 0C 8F 48 DC AE 15 7B 0C CD 8C 2C
    84 E6 0C 00 30 09 4D AF 66 49 C2 FB DD E1 53 90 56 7E DB 6E 11 FA 2D 5D BC AA 96 83 E9 74 1A 87 83 48 76 D4 43 39 27 A9 23 4D CE 78 E0 54 76 6F D9 A1 FB 44 A7
    <- 6A 88
    Could not load applet. See debug for more info

    It would be a lot of help if you can help me solve this problem.

    Thanks,
    Vibhor

    June 22, 2010 @ 13:12
  • Comment by bebe
  • Are the applet+package aids correct?
    AID:A0 00 00 00 62 03 01 0C 01 01
    Applet AID:A0 00 00 00 62 03 01 0C 01

    How did you compile/generate the CAP file?
    Is the authentification on the card successful?

    Stefan

    June 23, 2010 @ 06:45
  • Comment by Vibhor
  • Hi Stefan,

    Thank you for your valuable support.

    Yes the authentication was successful and yes the applet and package aid are correct. Just for confirmation, i took the applet aid and package aid while converting the applet using java card kit 2.2.2.

    The procedure i followed for generating the cap file is as follows:
    1. Create a Java card project after defining the java card kit 2.2.2 path.
    2. Create a java card applet and assign the applet aid.
    3. Right click on the package and set the package aid.
    4. Right click on the package and click on convert.

    The cap file was thus generated along with .jca and .exp files.

    Can you please guide me where i am going wrong?

    Thank you,
    Vibhor

    June 23, 2010 @ 08:27
  • Comment by Vibhor
  • Hi Stefan,

    Thank you for your wonderful tool, i wouldn’t have been able to load the cap file without it.
    The problem that i was having was because of the version of the java card. Now that issue has been resolved and so thank you so much for your support.

    Regards,
    Vibhor

    June 24, 2010 @ 12:41
  • Comment by bebe
  • Ok – glad it worked.

    Stefan

    June 28, 2010 @ 07:47
  • Comment by Peter Lambrechtsen
  • Love the tool. I have made some code changes to it to support javax.smartcardio in Java 6. So no JPCSC shared libs needed anymore.

    Plus I added support to support the ACR Touchatag devices too as they need to encapsulate apdu’s to send them to the attached card.

    Do you mind if I post the updated code to Sourceforge or Google code? Please e-mail me and we can talk further.

    July 10, 2010 @ 23:14
  • Comment by Peter Lambrechtsen
  • Stefan, please send me an e-mail as I have made some changes to your code to use the javax.smartcardio instead of the jpcsc, so it’s fully cross-platform with JRE 6.

    July 12, 2010 @ 05:22
  • Comment by andrea
  • I use a serial reader Feig M02 and Nokia 6212 unlocked.
    When i press “get card info” get:
    0×80100069, General error.
    java.lang.NullPointerException at ….
    CardWorker.java:1152…

    I use a PN532 (CCID USB Reader 0).
    When i press “get card info” get:
    -> 00 A4 04 00 08 A0 00 00 00 03 00 00 00
    <- 6A 82
    and Nokia does nothing

    What is wrong?

    August 1, 2010 @ 23:00
  • Comment by andrea
  • I’m trying a different serial adapter. I’m always using CPR Feige M02. If I use gpshell, helloworld.cap to install, I get:
    C:\work>GPShell.exe helloworld.txt
    mode_211
    enable_trace
    establish_context
    card_connect
    * reader name FEIG ID CPR.M02.VP/AB-C 0
    open_sc -security 3 -keyver 42 -mac_key 404142434445464748494A4B4C4D4E4F -enc_ke
    y 404142434445464748494A4B4C4D4E4F -kek_key 404142434445464748494A4B4C4D4E4F
    –> 00CA006600
    80502A0008313BBBE336A0B41400
    8482030010F26A412631967224AA134965F70D8C0B
    80E400800C4F0AA00000006203010C010100
    80E400800B4F09A00000006203010C0100
    80E602001809A00000006203010C0100000AEF08C60201B0C80200640000
    80E80000EFC48201A5010013DECAFFED010204000109A00000006203010C0102001F0013001F
    000E00150036000C0067000A00130000006C00000000000002010004001502040107A00000006201
    01000107A000000062000103000E010AA00000006203010C0101001406000C008003010001070100
    00001F070067000210188C000118110100900B8700188B00027A02308F00033D8C00043B7A052319
    8B00052D198B0006320329041F651B1A08AD0016041F8D00073B16041F41290419088B00083270E6
    198B00093B19160408418B000A1903088B000B19AD000316048B000C7A08000A0000000000000000
    000005003600
    load_applet() returns 0x8010002F (Error comunication with smartcard.)

    The authentication work (9000) but not the installation.

    I try with jcManager:

    Open terminal …
    EstablishContext(): …
    Wait for card in a certain reader …
    Pick reader …
    **********************
    Selecting Card Manager
    ***********************
    -> 00 A4 04 00 08 A0 00 00 00 03 00 00 00
    80 50 00 00 08 1D 22 78 4F 0E D7 94 F8
    84 82 03 00 10 E6 5C E7 00 CE FB EF 37 13 A1 05 B1 CF 64 79 FB
    <- 69 82
    Could not authenticate. Aborting.

    why authentication is not working? keys just the same.

    Thanks, good work.

    August 2, 2010 @ 09:50
  • Comment by bebe
  • @andrea: are you sure the AID you are using is the correct one?
    See my comment on May 3 for details on how to get the CM AID.

    Hope it helps
    Stefan

    August 5, 2010 @ 11:02
  • Comment by g bruno
  • possible flaw in jcManager???
    I cant Authenticate with my card.
    -> 84 82 03 00 10 8A 52 FB A7 53 68 2F 7C FF 72 30 46 1A BE B3 3E INS ’82′ EXTERNAL AUTHENTICATE
    <- 69 82
    Could not authenticate. Aborting.

    I wrote a program which replicates the MAC FF 72 30 46 1A BE B3 3E (DES CBC then DESede ECB)
    But note:
    Mac3 PROGRAM GIVES “GOOD” c_mac BUT: DOUBLE PADDED WHY

    plain length 24
    plainall 84820300108A52FBA753682F7C8000008000000000000000 Padded Twice!!!
    SINGLE PADDED = 16 BYTES, DOUBLE PADDED = 24 BYTES
    plaina 84820300108A52FB
    plainb A753682F7C800000
    bkey D1C28C601652A4770D67AD82D2D2E1C4
    bkeya D1C28C601652A477
    bkeyb D1C28C601652A4770D67AD82D2D2E1C4D1C28C601652A477
    ciphert 0C9F4D3CF80F0D1A
    result C_MAC FF7230461ABEB33E – replicates jcManagers MAC, so……..
    ………. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    jcManager seems to be padding twice!!!
    TRY:
    Pad once, see if that works!

    August 12, 2010 @ 22:56
  • Comment by g bruno
  • correction to previous post:
    my code is only using the 1st 16 bytes so the ‘extra’ padding is mine and moot.
    So jcManager is fine
    Looks like my card is not default keys!

    August 12, 2010 @ 23:03
  • Comment by Lean
  • HI:

    I am going to study and do some project with java card but in my country there are a few of Technical Documents and websites. So could you help me and give me some advices about how to study java card?

    Is JCVM free for download now?
    If i get JCVM, Is it difficult to do some changes on JCVM?

    Are there some useful java card forums?

    Thanks,
    Lean

    August 13, 2010 @ 09:08
  • Comment by bebe
  • @g bruno: The authentication is implemented correct in jcManager. In many cases the default keys are 4041….4F or 5051…..5F.
    If none of those work you should contact the card manufacturer.

    @Lean: Start with the GP specification. jcManager will help you understand it better. Try also the java card forum at sun.

    Stefan

    August 13, 2010 @ 15:54
  • Comment by g bruno
  • no problems, I have some cards which ARE 4041… and jcManager loads HelloWorld.cap
    so my previous cards were not 4041…

    Also GPShell is having trouble loading its own HelloWorld.cap …@@@
    I think jcManager may be superior when looking into the CAP file to get some parameters
    Well Done BrokenMill

    August 19, 2010 @ 04:52
  • Comment by c t skinner
  • jcManager loads CAP like no other!
    see some JavaCard Links on my website
    ‘Kronecker’

    August 19, 2010 @ 04:56
  • Comment by c t skinner
  • I am loth to criticise jcManager, which is a great program
    but I wanted to see how the ‘live’ ‘ iscardpresent’ worked
    so I got the source code, unplugged the reader, got
    “class class com.linuxnet.jpcsc.PCSCException
    SCardListReaders: 0x8010002e, Cannot find a smart card reader.”
    which is fine
    BUT “canot find a smart card reader” is not in the source files.
    I guess its in a linuxnet library…

    I want to have my card-reader program “always on” like jcManager, but I get private sun exceptions which I cant trap

    August 19, 2010 @ 05:34
  • Comment by bmc
  • First, I should say this is a great tool. I only have one problem with it: it’s not able to change the default keys (or add a new keyset). It returns error 6A88. However, JCOP tools in Eclipse is able to change the keys. Do you have any idea what the problem could be? Thank you.

    Here is a part of the output:
    Authenticated
    ************
    Change Keys
    *************
    -> 84 D8 01 81 50 4F 8F A7 21 F4 2F 4A 47 4A 2E 3C 59 A2 8C 59 59 7A 29 CA 7B 2D DE BA A7 00 E0 F0 8E 10 13 53 C9 2B 96 1C 40 77 5D 83 1D 2D 08 93 BE 20 2B 27 AA 00 80 83 20 1C AD 61 77 87 F7 D5 62 05 DB 02 82 6B DE 53 CF AC 84 FE B8 80 34 E1 E7 C3 A8 AC C3
    <- 6A 88
    Could not add/change keys. Response: 6A 88

    December 12, 2010 @ 20:42
  • Comment by bmc
  • I figured this out: changing keys was only possible with a secure channel without secure messaging. Thus:
    - when authenticating, P1 in the external auth command should have been 0 instead of 3 (C-DECRYPTION and C-MAC)
    - when putting the key, the command itself should not be encrypted (only the data) and it should have 73 bytes, with the last set on 0
    With those changes it works. That’s how jcopshell changes the keys and that’s why it worked with jcopshell.

    December 16, 2010 @ 22:51
  • Comment by issis
  • Hi,

    I get this error on running the manager:

    EX: msg EstablishContext(): 0x8010001d, The Smart card resource manager is not running.
    , class class com.linuxnet.jpcsc.PCSCException
    EstablishContext(): 0x8010001d, The Smart card resource manager is not running.

    at com.linuxnet.jpcsc.Context.EstablishContext(Context.java:56)
    at com.braicu.jcm.card.CardWorker.getReaders(CardWorker.java:1143)
    at com.braicu.jcm.JCManager$22.construct(JCManager.java:608)
    at com.braicu.jcm.layout.MySwingWorker$2.run(MySwingWorker.java:108)
    at java.lang.Thread.run(Thread.java:619)

    Can anyone tell me what’s wrong here?

    Thanks,
    issis

    February 21, 2011 @ 11:43
  • Comment by Aeuone
  • Hi Stefan.
    I’m new at Java Card development, and certain circumstances are forcing me to learn this technology quickly now.
    Everything was going fine (i’ve start my development using an Java Card emulator) until the moment I’ve obtained hardware SC (NXP JCOP J2A 2.4.1).

    As far as I’ve learned, when you want to install your applet, the first APDU command to be sent is a SELECT FILE with proper Card Manager AID.

    The problem is, none of the AIDs suggested here doesn’t work. And even “00 A4 04 00 00″ APDU answers me “6A 82″, whuch is, I believe, means the same “FILE NOT FOUND” error.

    I’m very confused with this fact. Am I doing smth wrong? Or my SC is so special?

    April 5, 2011 @ 11:08
  • Comment by bebe
  • Hi Aeuone

    The card you have (J2A) is in a special state called “unfused” and there are some additional steps you have to make before selecting the AID applet.

    Please see this thread for more info, or go directly to the specification…
    http://forums.oracle.com/forums/thread.jspa?threadID=2137514&tstart=75

    However I would suggest to get a normal JCOP card if you need quick results and someting that works out-of-the-box with my tool.

    Hope it helps
    Stefan

    April 11, 2011 @ 21:52
  • Comment by Monex
  • Description Google Tech TalkJune 5 2009ABSTRACTPresented by Eric Arseneau Sun Microsystems and Fritjof Engelhardtsen Telenor.The Java Card system is the smallest Java platform available but what can you do with it? This session covers some interesting examples involving the playSIM development kit.playSim is an open-source development kit for prototyping new and creative Java Card 3 technology-based applications without the hardware limitations of todays smart cards. It combines the flexibility of the open Sun SPOT platform with the hard security requirements of SIM-card-based applications.

    May 17, 2011 @ 19:28
  • Comment by E. Keith Owens
  • With the Java Card users can program a device to make it application specific… ..It is an open interoperable platform for smart cards and secure tokens the technology is also widely used in SIM cards its used in GSM mobile phones and ATM cards…Java Card gives users the ability to program a device and make it application specific and lets smart card developers use a common card platform.

    May 20, 2011 @ 20:53
  • Comment by Tupac
  • Hi,
    I’m a newbie in Javacard programming.
    I running RHEL5, but when I run tour manager I obtain.

    Exception in thread “Thread-1″ java.lang.NoClassDefFoundError: Could not initialize class com.linuxnet.jpcsc.PCSC
    at com.braicu.jcm.card.CardWorker.disconnectCard(CardWorker.java:507)
    at com.braicu.jcm.JCManager$22.construct(JCManager.java:619)
    at com.braicu.jcm.layout.MySwingWorker$2.run(MySwingWorker.java:108)
    at java.lang.Thread.run(Thread.java:662)

    What is the solution?
    Thanks a lot for your interesting tool.
    Tupac

    June 6, 2011 @ 18:18
  • Comment by Tupac
  • Hi,
    I’m running Linux RHEL 5
    I tried your manager but I obtain this:

    Exception in thread “Thread-1″ java.lang.NoClassDefFoundError: Could not initialize class com.linuxnet.jpcsc.PCSC
    at com.braicu.jcm.card.CardWorker.disconnectCard(CardWorker.java:507)
    at com.braicu.jcm.JCManager$22.construct(JCManager.java:619)
    at com.braicu.jcm.layout.MySwingWorker$2.run(MySwingWorker.java:108)
    at java.lang.Thread.run(Thread.java:662)

    Please help me to solve this problem,
    Thanks
    Tupac

    June 6, 2011 @ 18:57
  • Comment by EthanPU
  • I’ve just stubled upon this site smart-card.com, could I just copy the technical
    data from the web site or do I need special permission?. I am writing a school project.

    Ethan

    August 25, 2011 @ 02:30
  • Comment by Rajbir Singh
  • Please help me.
    I am trying to upload .cap file through jcManager tool.But “Could not authenticate. Aborting” error is generated.

    AID
    A000000018434D
    keys
    S_ENC 404142434445464748494A4B4C4D4E4F
    S_MAC 404142434445464748494A4B4C4D4E4F
    DEK 404142434445464748494A4B4C4D4E4F

    Open terminal …
    EstablishContext(): …
    Wait for card in a certain reader …
    Pick reader …
    **********************
    Selecting Card Manager
    ***********************
    -> 00 A4 04 00 07 A0 00 00 00 18 43 4D
    80 50 00 00 08 0D 25 15 B8 FD 89 8B 9B
    84 82 03 00 10 6E 73 89 31 58 94 3A 9E E5 63 60 55 0C AC FD AE
    <- 63 00
    Could not authenticate. Aborting.

    August 25, 2011 @ 07:36
  • Comment by bebe
  • @EthanPU
    You can copy anything you want – would be nice to specify the source though…

    @Rabir
    Are you sure your cards are using the 4041…. keys / the specified AID?
    Take care! – if you are trying several times(10) without success to authenticate you may block your card…

    September 12, 2011 @ 08:20
  • Comment by bebe
  • @tupac – you are missing the pcsc shared library file – it has to be in your classpath.

    September 12, 2011 @ 08:22
  • Comment by Martin Paljak
  • I’ve uploaded the source code to Github and changed from jpcsc to javax.smartcardio. It seems to work, but I’ve not confirmed that all functionality is OK.

    http://github.com/martinpaljak/jcManager

    September 21, 2011 @ 11:02
  • Comment by bebe
  • Thanks Martin.
    Updated the post with the github address.

    Regards

    October 11, 2011 @ 17:50
  • RSS feed for comments on this post.

    Leave a comment

    Security Code:














    © 2009 Stefan Braicu www.brokenmill.com