Java Card Manager NetBeans plug-in

Just to announce, I've uploaded a simple plug-in for NetBeans that provides basic functionality for Java Cards. Send APDU commands to card or simulator, browse content loaded on card, load & install & delete applets, open secure channel... Plug-in follows Open platform specification.
It has been used with GemXpresso cards (and works well) so there is no experience with other cards, but suppose that the card is OP compliant, it should work ok.
I have some ideas to improve and to extend it to support full OP/GP specs as well as plug-in for Java Card project type. However, I have no idea about what Sun prepares as tools with JC3.0 (I've noticed that it will be NB plug-ins too).
http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=10935

Hello, neinaggar1.
Well, on NetBeans plug-in portal, I've uploaded Java Card Manager plug-in. This plug-in brings to NetBeans the possibility to communicate (APDU commands, installing applets, etc.) with card or running simulator; no project types.
In comments on plug-in discussion, i.e. http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=10935 , I've put a link to second plug-in Java Card Project that provides the "project" functionality - new project type (new project type category "Java Card"), code completion, compiling, converting, starting simulator... However, this plug-in is in "beta" stage because it has some unsolved pitfalls - for example, you can provide just one export path for converting and there is a problem with plug-in depedency to internal NetBeans modules so it is strongly dependent on certain ide version (and probably even on its build).
Check the link above and discussion present there.
Just a note:
the access to the functionality Java Card Manager plug-in is from "Service" tab.
the access to the functionality Java Card Project plug-in is from properties (right click on the project name in project treeview) of existing java card project made by this plug-in or via new project wizard to make a new java card project.
Edited by: Vlasakcz on Aug 1, 2008 7:24 AM

Similar Messages

  • Java card Manager Deployment Error

    Hi
    i try to write the applet to the smart card, i got following error in JavaCard Manager, Can any one tell what is the exact issue here
    Following parameters i set in Javacard Manager
    AID:0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x00 0x00
    PID:0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x00
    output console
    Start Compiling
    Compilation Successfull
    Start Converting
    Conversion Successfull
    Start DeploymentCMD:
    ".\GPShell\GPShell.exe" .\target\be\msec\smartcard\GPShell.scp
    mode_201
    gemXpressoPro
    enable_trace
    establish_context
    card_connect
    * reader name Gemalto Prox-DU Contact_10900188 0
    select -AID A000000018434D00
    Command --> 00A4040008A000000018434D00
    Wrapped command --> 00A4040008A000000018434D00
    Response <-- 6A82
    select_application() returns 0x80216A82 (6A82: The application to be selected could not be found.)
    Deployment Error

    i tried to write applet using this application(gpj.sf.net)
    SMART CARD:Gemalto TOPDLv2)
    its ISD is A0 00 00 00 03 00 00 00h
    but when i write an applet to card (using command java -jar gpj.jar - sdaid A000000003000000 ) Following error came in console
    Found terminals: [PC/SC terminal Gemalto Prox-DU Contact_10900188 0, PC/SC terminal Gemalto Prox-DU Contactless_10900188 0]
    Found card in terminal: Gemalto Prox-DU Contact_10900188 0
    ATR: 3B 16 96 41 73 74 72 69 64
    DEBUG: Command APDU: 00 A4 04 00 08 A0 00 00 00 03 00 00 00
    DEBUG: Response APDU: 6A 82
    net.sourceforge.gpj.cardservices.exceptions.GPSecurityDomainSelectionException: Could not select AID A0 00 00 00 03 00 00 00 , SW: 6A 82
    at net.sourceforge.gpj.cardservices.GlobalPlatformService.open(GlobalPlatformService.java:246)
    at net.sourceforge.gpj.cardservices.GlobalPlatformService.main(GlobalPlatformService.java:1575)
    How i can solve this issue?

  • How to configure Java Card 3 in eclipse ?

    How to configure Java Card 3 in eclipse ? I have already configured Java Card2.2.2 by following
    1) http://eclipse-jcde.sourceforge.net/user-guide.htm
    And
    2)http://eclipse-jcde.sourceforge.net/
    the above two links.B ut for Java Card 3 when i am configuring window->preference->Java Card Home I am getting error as "Converter.jar" not found. i checked the lib and i didnt found these jar. I copied 2.2.2 converter.jar , then that jar file not matching. So please tell me how to configure this.
    Thanks in advance
    Anoop Michael

    there are many changes between 2.2.2 and 3.0.1. Folders and files are not same. EclipseJCDE is not going to work with JCDk3.0.1. Some one needs to update that plugin :).
    There is a NetBeans plugin in progress and you can try downloading latest NetBeans 6.7.1
    Some intro about the plugin can be found here http://weblogs.java.net/blog/2009/05/10/sneak-preview-java-card-tools-netbeans-67
    You can try Netbeans 6.8 nightly builds for latest changes, but it may be a while until the plugin is stable.
    -Anki.N

  • Java with Card Management Software

    hi every one
    i need java interface for card management software like (EDIsecure CMS or IDExpert CMS)
    please any help me is there any java interface for the CMS.
    in my java application while clicking the print button i need to sent the user information to CMS software.
    i already design the template for my card.
    then this card management Software apply data value to the template then it will print it.
    Thiagu.m

    Note: This thread was originally posted in the [Blades - General Discussion|http://forums.sun.com/forum.jspa?forumID=908] forum, but moved to this forum for closer topic alignment.
    I had no better idea to where to move that thread.

  • How to select Card manager on Default JavaCard simulator from NetBeans 7.2

    Hi
    I'm trying to resolve three questions
    1) to find FAQ/Manual about simulator included into 3.0.2 JavaCard Connected platform
    2) which commands for Card Manager of simulated default JavaCard are supported
    3) how to upload simple applet (ex. HelloWorld from JavaCard 3.0.2) using Card Manager applet simulated on Default javaCard Connected platfrom simulator available from NetBeans 7.2
    Thaaaanks

    From my understanding, NetBeans uses the CREF executable from the JCDK for simulation. You can check the documentation (developer guide etc) from the JCDK for more details. The CREF emulator uses a custom applet loader so it does not use standard GP commands and will be different to a real card. As for loading your applet, you should be able to run from NB and it will start your emulator and deploy your code. I do not use netbeans so cannot really comment further.
    - Shane

  • How does the Java Card simulator work? (Using NetBeans)

    Hi,
    I'm using NetBeans and am trying to simulate:
    Someone powering up the card, saving a value, and powering down... And then they power it up again, get the value, and power down.
    When I edit my APDU script to do the second part, the value I entered the first time is never stored, which probably means that when I 'run' my code, my application is loaded and everything is initialized again.
    How do I edit NetBeans to not install the application every time I hit 'run'? And not to initialize the values, so that when i power it up again, I can get a value stored in a previous running of a script?
    When I use powerup, powerdown and then powerup again, NetBeans doesn't powerup the simulator the second time. So understanding the Java Card Simulator would also help... where it is, how it runs, what options it runs with, etc.

    Hi Shane,
    I have not read anywhere else that the JC3 cards are not available, thank you so much for that tip! I am not doing it for research, but I am working on this alone and will have to deploy a card later on. I will be getting all the right versions now.
    I'll ask the question then, using just the JCDK:
    If I want to save a value on the card, and then need it at a later time, how do I go about it. Do I do the following?
    (1) Install the application on the card. (I know how to do this)
    (2) Run the simulator using -o "eeprom data filename"
    (3) Save the value using the APDU calls and Java code on the card + close connection.
    Code:
    public class MyApp extends Applet {
        private static byte[] data = {0x00, 0x00, 0x00};
        // Install method, method to register, process method that can call saveData or recallData, etc
        public static void saveData()
           // code to change data
           data = {0x01, 0x01, 0x01};
        public static byte[] recallData()
           // code to return data
           return data;
    }(4) Run the simulator using -i "eeprom data filename". get the value using recallData().
    Will selecting the app not make data initialize to {0x00, 0x00, 0x00} again?
    If I know this is the correct way of going about it, then I can work towards it getting done.
    From other examples I can see that this is probably the way it should work, but my data array always returns as {0x00, 0x00, 0x00}.

  • Java Card 2.2.1 in Eclipse or NetBeans

    Hi all!
    I'm trying to work with my card in a Java Card 2.2.1 development environment like Eclipse or NetBeans to generate and simulate applets but I can't find any plugin that allows me to work with this version.
    I searched the forum but not found a possible solution. Does anyone know what can I do?
    Thanks in advance

    http://netbeans.org/bugzilla/show_bug.cgi?id=189823
    my netbeans bug report is now open for one year and 9 months.
    It was last updated on Nov 30, 2011:
    Anton Chechel <[email protected]> changed:
    What |Removed |Added
    Target Milestone|7.1 |7.2
    but still not closed, so there is a slight hope to see something coming...

  • Java card - crd manager selection....

    hi...
    this is very basic, I would like to to know the procedures involved in the selection of card manager in a java card.
    A tutorial link would be useful.

    The Card Manager is defined in GlobalPlatform and is responsible and is a general term for the GP environment, Issuer Secrity Doman and the global PIN. It is the card administration service. In regards to Java Card Runtime Environment, it covers the Installer and the Deletion Manager.
    You can find examples in this forum about the Issuer Security Doman and the global PIN. The GlobalPlatform environment is described in the GP 2.1.1 spec. under section 3.2 .

  • Java card netbeans plugin

    Excuse me for posting stuff for netbeans here
    But I've been waiting for activation on their side.
    http://netbeans.org/kb/docs/javame/java-card.html
    Does anyone know where to download this plugin?
    There seems to be nothing to download on this page.
    Thanks
    Jack

    first idea of all: isn't there a netbeans support forum/mailing list/plugin page ?
    regards
    sebastien

  • Java card plugin problem with NetBeans 6.8

    Hi, I've got a problem with the netBeans 6.8 i couldn't add a java card plugin at all. I try to run it with the netBeans 6.7.1 and it installs the plugin and adds the java card platform, but when i try to build a sample project I've got an error:
    java.lang.NoClassDefFoundError: ${javacard/packagerClass}
    Any ideas
    Netbeans versions: 6.7.1, 6.8
    JavaCard version: JCDK3.0.2_ConnectedEdition
    OS: WindowsXP

    first idea of all: isn't there a netbeans support forum/mailing list/plugin page ?
    regards
    sebastien

  • Java Card + Netbeans

    There is a Java Card plugin for Netbeans (6.7.1) but has anyone succeeded in adding the Java Card platform in Netbeans? I have tested with Java Card 2.2.2 and 3.0.1 without any luck. It is simply not possible to push the "Next >" button after having pointed out the Java Card path. Any ideas?

    The problem I had before remains. I have downloaded java_card_kit-connected-3_0_1 (url below) and extracted the jar file to a directory but when I select the directory (step 4 at page 195) I cannot click Next!
    url:
    http://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/VerifyItem-Start/java_card_kit-connected-3_0_1-rr-bin-gl-b55-windows-26_may_2009.jar?BundledLineItemUUID=6b9IBe.nmC8AAAEj5EpeqxVE&OrderID=Qj1IBe.nNWIAAAEjzEpeqxVE&ProductID=yzNIBe.oUJ8AAAEhWxIzLohL&FileName=/java_card_kit-connected-3_0_1-rr-bin-gl-b55-windows-26_may_2009.jar

  • NetBeans java card platform

    Dear All,
    I need a java card simulator to debug my java card applet code.
    I try to use Java Card Platform on NetBeans IDE 7.1 for debugging purpose. After successfully building the applet and loading it onto the simulated card environment I try to select the applet instance using the following command through the Console.
    select //aid/3F564379F5/00279CD982
    in response I receive the following error.
    "Connection reset by peer: socket write error"
    Is anyone using Java Card Platform for debugging? I would be very happy to hear how to resolve this problem.
    Thanks in advance!
    Cheers!
    Mehmet

    Mehmet wrote:
    Hello Rohit,
    If you download the Java Card Development Kit (http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javame-419430.html#java_card_kit-2.2.1-oth-JPR)
    you will have a set of sample java card applets to use.
    You can use JPShell to download the cap files(compiled applet) onto the card and send ADPU to the card to see if you get correct response.
    Following link provides all the information to set up the environment and start developing java card applets using NetBeans IDE and GPShell.
    https://minotaur.fi.muni.cz:8443/~xsvenda/docuwiki/doku.php?id=public:smartcard:javacardcompilation
    I hope this can help.
    MehmetI already have , Netbeans 7.1 and now i have gpshell 1.4.4 ,i think netbeans is capable to making .cap file, did you mean that with use of gpshell i can connect with java card through reader? gp shell would work stand alone or we need to set this to netbeans? i read the link which u passed to me, it seems very good but "it seems very tough to implement" . HELL IS WAITING FOR ME... KIDDING DEAR,
    one last thing, anything other than net beans { here we create applet and it automatically create cap file} and gp shell are require to load applet onto the card? OR these is enough to implement wholo java card application- I asked this because i get the term JCOP and etc when i read uploading applet to card.
    anyways thanks for your help.

  • Java card applet debugging in Netbeans 6.8

    Hi,
    | am writing a Java Card applet and a client MIDlet. I would like to debug my applet: I want to see the interaction process with MIDlet. However, for some reason I cannot start debugging in Netbeans 6.8. Could someone help? Thanks in advance.
    Regards,
    Aleksandr

    Hi sanyas,
    sorry, i'm not answering your question..
    I'm a newbie in Java Card technology..
    After i had read your post, it makes me curious about Java Card Client..
    I want to know, what kind of Java Card Client that we could create?..
    Can we create a Java Card client application from Java SE (GUI/Swing base application), or it's limited for MIDlet only?
    Thanks in advance..

  • Java Card Memory Managament: How do you free-up allocated memory?

    I have a problem with java card memory management, that causes the applet to hang. I think the java card runs out of RAM when my applet runs for several iterations or process() calls. My program requires significant size of bytes for each APDU command to be sent. (around 100-250 bytes, for each apdu.sendBytes() call).
    I use a temporary byte array buffer that will contain the APDU command to be sent, declared as:
    private byte [] tmpBuff;Before each process() call, the tmBuff is initialized and contains a new byte array containing the APDU command to be sent. (array size around 100-250 bytes).
    tmpBuff = new byte[] {0x00, ... } On the process() call, the tmpBuff is copied to APDU and sendBytes() function is called. The tmpBuff byte array is reinitialized after every process() call to contain the next command. After about 20 successful commands by the process() call, the applet seems to ran out of RAM and hangs.
    I suspect, that when tmpBuff is reinitialized before each process() call, the Java Card garbage collector does now free-up the memory that was used for the previous tmpBuff byte array initialization.
    Is there a way to reclaim the memory allocated for tmpBuff after it has been initialized?
    Or maybe call the Java card garbage collector?

    Cenon,
    Generally speaking, the new keywork is a bad idea outside the install method or constructors as the JCRE is not guarenteed to have a garbage collector (and if it does, has to be called explicitly by JCSystem.requestObjectDeletion(); This however is slow.
    A better option may be to use memory more efficiently than to rely on garbage collection. A way of doing this would be to have an instance variable that is initialised once and reused. This allows you to use either a transient or persistent array.
    public class TestApplet extends Applet {
        private final static short BUFFER_SIZE = (short) 300;
        private final byte[] buffer;
        private TestApplet() {
            // only have one of the following not commented out
            /* persistent buffer */
            // buffer = new byte[BUFFER_SIZE];
            /* transient buffer (much faster) */
            buffer = JCSystem.makeTransientByteArray(BUFFER_SIZE, JCSystem.CLEAR_ON_DESELECT);
        public static void install(byte[] bArray, short bOffset, byte bLength) {
            // GP-compliant JavaCard applet registration
            new TestApplet().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
        public void process(APDU apdu) {
            // Good practice: Return 9000 on SELECT
            if (selectingApplet()) {
                return;
            // do some work here with buffer
    }In the above code you would be able to use the buffer to build the command and you will not have a memory leak.
    Cheers,
    Shane
    Edited by: safarmer on Jul 8, 2008 12:25 PM

  • How to ensure applet is written in java card?

    Hi all,
    I have written a java card applet, in which i am using the Biometry API of java card to enroll a fingerprint template in java card. Code is attached below:
    package classicapplet1;
    import javacard.framework.*;
    import javacardx.biometry.BioBuilder;
    import javacardx.biometry.OwnerBioTemplate;
    import javacardx.biometry.SharedBioTemplate;
    import javacardx.biometry.BioException;
    public class JavaBiometrics extends Applet implements SharedBioTemplate{
            public final static byte CLA = (byte)0xCF;
         public final static byte INS_ENROLL = (byte)0x10;
         public final static byte MATCH_TRY_LIMIT = (byte)3;
         public final static byte INVALID_DATA = (byte)0x77;
         public final static byte ERROR_MATCH_FAILED = (byte)0x9101;
         public static final byte CARD_ENROLL_SUCCESS = (byte)0x9000;
         public static final byte CARD_ENROL_FAILED = (byte)0x6900;
         private OwnerBioTemplate bio_temp;
         * Installs this applet.
         * @param bArray
         *            the array containing installation parameters
         * @param bOffset
         *            the starting offset in bArray
         * @param bLength
         *            the length in bytes of the parameter data in bArray
        public static void install(byte[] bArray, short bOffset, byte bLength) {
            new JavaBiometrics(bArray, bOffset, bLength);
         * Only this class's install method should create the applet object.
        protected JavaBiometrics(byte[] bArray, short bOffset, short bLength) {
        byte aidLen = bArray[bOffset];
              if(aidLen == (byte)0)
                   register();
              else
                   register(bArray, (short)(bOffset+1), aidLen);
              bio_temp = BioBuilder.buildBioTemplate(BioBuilder.FINGERPRINT, MATCH_TRY_LIMIT);
    public boolean select()
    return true;
         * Processes an incoming APDU.
         * @see APDU
         * @param apdu
         *            the incoming APDU
        public void process(APDU apdu) {
            //get the incoming APDU buffer
         byte []buffer = apdu.getBuffer();
         //Get the CLA; mask out the logical-channel info
         buffer[ISO7816.OFFSET_CLA] = (byte)(buffer[ISO7816.OFFSET_CLA] & (byte)0xFC);
         //If the INS Select, return -no need to process select
         if(buffer[ISO7816.OFFSET_CLA] == 0 && buffer[ISO7816.OFFSET_INS] == (byte)(0xA4))
              return;
         //If unrecognized class, return "Unsupported class."
         if(buffer[ISO7816.OFFSET_CLA] != CLA)
              ISOException.throwIt(ISO7816.SW_CLA_NOT_SUPPORTED);
         switch(buffer[ISO7816.OFFSET_INS])
         case INS_ENROLL:
              enroll(apdu);
              break;
         default:
              ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
    public void enroll(APDU apdu)
            byte[] buffer = apdu.getBuffer();
            short bytesRead = apdu.setIncomingAndReceive();
            bio_temp.init(buffer, ISO7816.OFFSET_CDATA, bytesRead);
            bio_temp.doFinal();
        public Shareable getShareableInterfaceObject(AID clientAID, byte parameter) {
            return this;
    ///////////// These methods implemets the ShareableBio interface///////////////
    public boolean isInitialized() {
            return bio_temp.isInitialized();
        public boolean isValidated() {
            return bio_temp.isValidated();
        public void reset() {
            bio_temp.reset();
        public byte getTriesRemaining() {
            return bio_temp.getTriesRemaining();
        public byte getBioType() {
            return bio_temp.getBioType();
        public short getVersion(byte[] dest, short offset) {
            return bio_temp.getVersion(dest, offset);
        public short getPublicTemplateData(short publicOffset, byte[] dest, short destOffset, short length)
                throws BioException {
            return bio_temp.getPublicTemplateData(publicOffset, dest, destOffset, length);
        public short initMatch(byte[] candidate, short offset, short length) throws BioException {
            return bio_temp.initMatch(candidate, offset, length);
        public short match(byte[] candidate, short offset, short length) throws BioException {
            return bio_temp.match(candidate, offset, length);
    Problem :
    I have developed this program in Netbeans using java card plug ins. when i am running this program, all the required CAP files and EXP files are generated.
    Now, i have to write this applet on java card through a card reader. My card reader is installed in an embedded system GeoAmida with IP 192.133.133.2 and port number 6789.
    I have used the following settings for my java card device in Netbeans:
    Host : 192.133.133.2
    Server URL: http://192.133.133.2:6789/
    Card Manager URL: http://192.133.133.2:6789/cardmanager/
    HTTP port: 6789
    The output shows me that Instances of this program has been successfully has been created on java card.
    But the problem is how can i ensure that my applet is been successfully installed on the java card?
    The code of host application program, accessing the developed java card applet is given below (it is written in C):
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <smartcard.h>
    int main()
         int ret, i, smartcard;
         unsigned char applet_id[100], apdu_len, apdu[300],response[300]={0};
         smartcard_info *context;
         smartcard=CONTACTLESS;
         //smartcard=CONTACT_BOT;
         if((context = smartcard_init(smartcard)) == NULL){
              printf("Smartcard Initi. Failed\n");
              return 0xBB;
         /* checking for smartcard */
         while (1){
              if(ret=smartcard_is_present(context, smartcard)!=0)
                   sleep(1);
              else
                   break;
         printf("Selecting Applet \n");
         i = 0;
         applet_id[i++]=0x00; applet_id[i++]=0xA4; applet_id[i++]=0x04; applet_id[i++]=0x00; applet_id[i++]=0x06;
         applet_id[i++]=0xA9; applet_id[i++]=0xBF; applet_id[i++]=0xA2; applet_id[i++]=0xB6; applet_id[i++]=0xB1; applet_id[i++]=0x3E; applet_id[i++]=0x7F;
         if ((ret=smartcard_select_applet(context, smartcard, applet_id, i))!=0){
              printf("select applet failed %02x\n",ret);
              return ;
         printf("Applet Selection Success \n");
    #if 1
         i=0;
         apdu[i++]=0xCF; apdu[i++]=0x10; apdu[i++]=0x04; apdu[i++]=0x04; apdu[i++]=0x7F;
         //apdu[i++]=0x3F; apdu[i++]=0x00;
         apdu_len = i;
         printf("Sending APDU command\n");
         if ((ret=smartcard_apdu(context, smartcard, apdu, apdu_len, response))!=0){
              printf("apdu failed %d\n",ret);
              //return;
         }else
              printf("APDU Success\n");
         //printf("\n");
    #endif
         smartcard_deinit(context);
         return 0;     
    }The output of this program is showing me that applet is been successfully selected, but APDU selection failed. Please solve this problem as soon as possible, because my project is deadline is not very much far.
    Thanks in advance.
    Mukul Gupta

    Hi Shane,
    I am getting error 6a86 which means that value of P1 is less than 1 or more than 8, and we have to change its value to any in between 1 to 8. I did that also but error still remains :(
    Please tell me what is reason behind this error. And, i'll try out your previous solution today, Thanks for it.

Maybe you are looking for

  • Windows Shares Not Showing Up In Finder (Master Browser Problem)

    Hi, on leopard I had no problems with Windows shares showing up in finder. However, having upgraded to Snow Leopard, I've now lost that ability. Before I had my Leopard computer set as the master browser. I did this by specifying domain master = yes

  • How to add and remove storage from ASM at the same time?

    Scenario: I want to drop some disks from asm 1- Add disk to asm -----> rebalance 2- drop disk from asm ----> rebalance Is there anyway to make this process faster instead of going to rebalancing twice?

  • How to "fix" RV180/180W Certificate Errors

    When I access setup on a RV180 or RV180W with Internet Explorer the following message always displays: "There is a problem with this website's security certificate. The security certificate presented by this website was not issued by a trusted certif

  • Turn off cover flow on the touch?

    Any way to turn off coverflow on the ipod touch? I know you can on a nano, and it annoys me and I want to turn it off on my touch. Thanks!

  • Help me out plz  Imac cant find my Hard drive

    hello im new to imac so plz help me out here my imac specs: model: MA199LL intel based 1.83 core duo 160gb serial sata My problem is i turn it on and pop up the question mark, i know that it mean that cant find my hard drive, i already tried to put t