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 .

Similar Messages

  • 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

  • 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

  • VERIFY fails if Card Manager selected first

    Hi,
    If I send VERIFY with the appropriate key the card replies with 0x9000 (OK). The VERIFY command looks like this: A0 20 00 00 08 XX XX XX XX XX XX XX XX
    If I first select the card manager (00 A4 04 00 07 A0 00 00 00 03 00 00) and then send VERIFY, the card replies with 0x6E00 (class byte expected by Transport Manager is not correct) or with 0x6D00 (Invalid instruction byte).
    I would like to ask this:
    Why does it matter if the Card manager is selected or not?
    Does not the card manager get selected at reset automatically?
    And who else would receive the command (and dispatch it) if not the card manager?
    Why would I get an "Invalid instruction byte" error when the same command does not fail when sent first? Does that mean that different entities are involved in processing the command?
    It is probably something silly, but buried somewhere where I cannot find it.
    Thanks
    Edited by: 815684 on Dec 20, 2010 7:02 AM

    815684 wrote:
    It is a multiapplication card and it is for GSM (I was actually wondering what class A0 was). But is not the Card Manager supposed to be selected immediately after reset (all this happens immediately after reset)?If you have a default selectable applet loaded onto your card, this will receive any APDU's sent to the card if no other applet has been selected first. If you want to perform card management operations, you need to select the card manager before you can proceed. You do not need to select anything after reset, but there will need to be something receiving your APDU's for your card to respond.
    We have a script that deletes our company's old applet (and its files) from the card and downloads a newer version. The first step of this process is to authenticate the user to the card. And though your reply clarified my question, it poses another one: Since I need to delete/download applets, why do I authenticate myself to someone else (the GSM applet) rather than the Card Manager (which is supposed to be in charge of deleting and downloading applets)? Is not the Card Manager supposed to be in charge of this?If you are doing card content management, you need to authenticate to the card manager. Your applet may have a mechanism that requires authentication to the applet before it will allow itself to be deleted. There is no official GP way of supporting this, so if this is the case someone that worked on the applet will be aware of this.
    PS I am reading the GP, unfortunately it does take time to understand this stuffBe patient :) Reading this document will raise more questions. You just need to look through the document for these answers as there is a good chance you will find it in there somewhere. If and when that fails, you can always get help here. Just don't be surprised if the answer is: it is in the GP card spec. Hopefully we can point you to where as well.
    Cheers,
    Shane

  • Java Card Applet Development

    Please I am doing my final year project on secure mobile application using Java Card Technology.
    I need to write and an application that can send SMS on a SIM card to another SIM card with the same application. The application will have a server side which manage the storage of messages and at the same time communicate information to the client on the SIM remotely. I am suppose to use wi-fi (TCP/IP) for transmission.
    Can anybody please give me ideas and possible working codes and simulators.
    I mean step by step procedure of how to start.
    THANK YOU.

    1. Good.
    2. I suggest you start testing using the simulator, however if you want to test directly on the card at once, select your card reader using the /term command and use the commands as described in help to start sending APDUs to the card.
    3. This is not a part of the JCOP tools for eclipse (which is developed by IBM and maintained by NXP), but part of the JavaCard development toolkit developed and maintained by Sun. See http://java.sun.com/products/javacard/dev_kit.html.
    4. Read the above. None of this is part of JCOP tools for eclipse.
    5. As far as I know, there is no independent newbie guide for JCOP tools, but I would check out the help function included in the tools themselves if I were you.
    Good luck!

  • Java Card 2.2.2 draft is out for public review

    A draft for the upcoming release of the Java Card Specification is available for public review.
    The Java Card 2.2.2 Specification will provide numerous enhancements to the award-winning Java Card platform. In particular it will include specific support for contactless communication and ID cards :
    * enhancements to ease the management and increase interoperability of contactless cards.
    * additional cryptography and security features
    * utility APIs for memory-efficient applet development
    Java Card technology v2.2.2 is ready for the next generations of smart card standards, and is fully backward-compatible with previous versions.
    New features in Java Card 2.2.2 :
    * Utility APIs for TLV, BCD, short, int
    * ISO7816-based Extended length APDU support
    * Support for up to 20 logical channels
    * External memory access API
    * Multiple Interfaces management
    * Additional cryptography algorithms : HMAC-MD5, HMAC-SHA1, SHA-256 and Korean Seed
    * Signature with message recovery
    * Partial message digest
    * Standardized Biometrics API
    Please direct your comments on this draft at [email protected] Feedback received before December 15th will be considered for the final version of the specification. For more information on the Java Card Platform Specification v2.2.2, Public Review Draft, refer to the release notes on http://java.sun.com/products/javacard/RELEASENOTES_jcspecsp.html

    The Installer and the Applet Deletion Manager are implemented in the JCRE and GlobalPlatform. On-card the Card Manager manages the content management, communication and the related security. JCRE specifies how it has to handle installation and deletion, but leaves room for different implementations. To the outside world, on a GP card, the Installer/ADM is the Card Manager with a specific AID.
    Installer and ADM are optional. For instance a Java Card Static product does not need an Installer/ADM.
    JCOP cards have the Installer/ADM fully implemented. It uses the GP functionality. The CM has to be selected to install or delete a package/applet.

  • 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.

  • How can i change my JAVA card life cycle state to OP_READY?

    I found the below script in this link and run it via `GPShell` on my java card and now I can't run `gpj -list` in `GPJ`!
    My questions:
    1- What is this code for? changing Card Domain Manager status from OP_READY to Secured?
    2- Why I can't find anywhere `80F0800708A000000003000000` And `80F0800F08A000000003000000` APDUs that used in script?! I searched `GP Specification 2.2` and `ISO 7814-4` for an APDU with `F0` in `CLA` section! But I found nothing!
    3- Is the operation of the below script reversible by another script?
    The Script :
        mode_211
        enable_trace
        establish_context
        card_connect
        select -AID A0000000
        open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f -kek_key
        404142434445464748494a4b4c4d4e4f
        send_apdu -sc 1 -APDU 80F0800708A000000003000000
        send_apdu -sc 1 -APDU 80F0800F08A000000003000000
        card_disconnect
        release_context
    And this is it's output in Console :
        C:\Users\ghasemi\Desktop\GPShell-1.4.4>gpshell lcchange.txt
        mode_211
        enable_trace
        establish_context
        card_connect
        select -AID a00000
        Command --> 00A4040003A00000
        Wrapped command --> 00A4040003A00000
        Response <-- 6F108408A000000003000000A5049F6501FF9000
        open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4
        f -enc_key 404142434445464748494a4b4c4d4e4f -kek_key 404142434445464748494a4b4c4
        d4e4f
        Command --> 80CA006600
        Wrapped command --> 80CA006600
        Response <-- 664C734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864
        886FC6B03640B06092A864886FC6B040215650B06092B8510864864020103660C060A2B060104012
        A026E01029000
        Command --> 805000000823CE2F4C2B6C689B00
        Wrapped command --> 805000000823CE2F4C2B6C689B00
        Response <-- 0000116001007F8B0AF9020201D1C94E4F787D75DD54805A7488BCF79000
        Command --> 84820100100BCCFE8818D2DFC6E5B48EA4B6892457
        Wrapped command --> 84820100100BCCFE8818D2DFC6E5B48EA4B6892457
        Response <-- 9000
        send_apdu -sc 1 -APDU 80F0800708A000000003000000
        Command --> 80F0800708A000000003000000
        Wrapped command --> 84F0800710A0000000030000007AA29B3A708E6E75
        Response <-- 9000
        send_APDU() returns 0x80209000 (9000: Success. No error.)
        send_apdu -sc 1 -APDU 80F0800F08A000000003000000
        Command --> 80F0800F08A000000003000000
        Wrapped command --> 84F0800F10A0000000030000004FCFC15FD7EBDE9A
        Response <-- 9000
        send_APDU() returns 0x80209000 (9000: Success. No error.)
        card_disconnect
        release_context
    Thankyou.

    Hi,
    Ad.1
    Yes, this script is dedicated to change ISD state from OP_READY to SECURED (cards compatible with GP 2.1.1 specs).
    Ad.2
    The script commands are constructed basing on GP 2.1.1 specs. As far as I know, the definition of SET STATUS command in GP 2.2 is the same as in GP 2.1.1 specs.
    Ad. 3
    The change of state from SECURED to OP_READY is irreversible. Sorry.
    Regards

  • GP Java Card

    Using the JPCSC from IBM, i have successfully send the apdu command to the smart card using pcsc compliant card. I have no problem sending and receiving apdu from IBM MFC4.1. The weird thing is when i communicate with GP compliant java card to select the Cad manager(ISD) AID, it rerurn 61 46. There is no problem when selecting other applet AID and return 90 00. Can anyone here tell me what 61 46 mean, i can neither find in ISO7816 or GP spec or OCF. And also give me a hint why the ISD cannot be selected. Your guidance would be appreciated!!!

    I think '6146' is concernd with FCI(File Control Information).
    Card Manager might response FCI as a result of sucessful execusion.
    I don't know about PCSC well, but usually '61xx' means that
    "the card want to send 0x46bytes data to CAD in the manner of T=0 protocol.
    If you send 'GET RESPONSE' command after the '6146' response,
    you will get the FCI data from Card Manager.
    Please check the reseponse message of 'SELECT' and 'GET RESPONSE'.

  • UPDATED: jcManager - Java Card Programming Visual Tool

    UPDATED with the following features, as requested:
    - new and improved GUI
    - possibility to select the reader
    - better output - display all commands sent to card and the replies
    - specify card manager AID
    - specify applet install command parameters
    ... and many more
    [Download here|http://www.brokenmill.com/2010/03/java-secure-card-manager/]
    Enjoy
    Stefan
    ... sorry for the double post...

    Thanks Stefan for your reply..
    i want to know, what versions of Java Card OS that supported by jcManager..
    Currently i use Java Card 2.2.1, but when i tried to load .CAP file using this tool, i always get this error :
    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
    <- 6F 10 84 08 A0 00 00 00 03 00 00 00 A5 04 9F 65 01 FF 90 00
    Init Update
    -> 80 50 00 00 08 7D 01 2C 52 CB 41 62 FB
    <- 00 00 71 54 57 17 3C 2B 8F C1 FF 02 00 53 CC D9 DE 61 D9 80 8E 65 D6 84 59 F5 DC 7C 90 00
    HostChallenge: 7D 01 2C 52 CB 41 62 FB
    CardChallenge: CC D9 DE 61 D9 80
    Card Calculated Card Cryptogram: 8E 65 D6 84 59 F5 DC 7C
    Derivation Data is 01 82 00 53 00 00 00 00 00 00 00 00 00 00 00 00
    Host Cryptogram Data (to encrypt) 00 53 CC D9 DE 61 D9 80 7D 01 2C 52 CB 41 62 FB 80 00 00 00 00 00 00 00
    Card Cryptogram Data (to encrypt for verification) 7D 01 2C 52 CB 41 62 FB 00 53 CC D9 DE 61 D9 80 80 00 00 00 00 00 00 00
    S_ENC: 03 82 60 2B BA CF 22 AC 27 4F 34 81 E6 66 0E 68 03 82 60 2B BA CF 22 AC
    The Current session MAC key is B3 D1 2B 42 AA 64 C3 A2 84 47 1E E5 AD 6A 01 FB
    The Current session DEK key is 56 47 C9 B7 A9 BC 67 63 1E BE 05 DC 39 1D B4 8B
    Encrypted CardCryptoGram is 3B C0 CF 36 E3 83 D2 38 83 61 10 D8 36 75 5F A7 8E 65 D6 84 59 F5 DC 7C
    Encrypted HostCryptoGram is 6F 72 46 A5 6B 01 64 6E 28 E9 16 1B D7 74 58 14 3E A2 C2 92 53 05 A9 D5
    -> 84 82 03 00 10 3E A2 C2 92 53 05 A9 D5 8E FE D9 90 92 D3 EC 1B
    <- 90 00
    Authenticated
    UplaodCAP
    Get AID from header.cap file
    FOR LOAD DATA: EF 04 C6 02 01 9B
    AID:A0 00 00 00 62 03 01 0C 01
    Applet AID:A0 00 00 00 62 03 01 0C 01 01
    Try to delete if existing...
    -> 84 E4 00 00 18 D6 11 44 FF FD 6D EF 28 70 A1 30 70 ED BA 78 8C B1 DB C6 AF 6C 86 0A A3
    <- 6A 88
    -> 84 E4 00 00 18 2C CA A4 41 C1 05 BD 3F 5E 26 13 D9 A1 AA BD AA B7 0E EF 02 1F CC 55 F9
    <- 6A 88
    Loading cap file. Please wait...
    Install for Load
    -> 84 E6 02 00 28 19 99 78 6D 57 F3 F8 E3 AE 41 D8 00 00 7F 92 5E AD 51 D6 E3 CB 70 D0 B5 9F 8E 19 FD EE 8A 26 37 B0 1D C8 E9 4A ED 9B FC
    <- 00 90 00
    Load CAP
    -> 84 E8 80 00 10 7C 0A D8 32 F3 D6 DF 00 80 BA 28 8F CD 90 02 DD
    <- 6A 80
    -> 84 E6 0C 00 38 19 99 78 6D 57 F3 F8 E3 7F 53 52 F0 15 33 97 38 0E D9 AB B1 12 BB 63 EA F8 6C CB 8B 93 47 DC 6C 88 71 7B F1 F7 25 4E E0 37 40 7F C9 0A 47 94 3F B5 3E 1C B4 4A 4E BC AE
    <- 6A 88
    Could not load applet. See debug for more infoDo you know why?, but it could be strange for me because when i tried to load HelloWorld.cap that shipped with GPShell 1.4.2, it could work well..
    Please help me..
    Thanks in advance..

  • Error: Unknown Global Platform Java Card.

    Dears,
    I use the jcop 3.1.1 and card by gemalto, the geXpresso,
    when i test the applet in simulated environment, his ok
    but, when i load applet to card, this error occurs:
    ??> upload -d "C:\Documents and Settings\antosantos\workspace\Teste\bin\br\ac\javacard\ac.cap"
    jcshell: Error code: 6d00 (INS value not supported)
    jcshell: Wrong response APDU: 6D00
    ??> /card -a a000000003000000 -c com.ibm.jc.CardManager
    ATR: 3B7D94000080318065B08301029083009000
    ATR: T=0, FI=9/DI=4 (64clk/etu), N=0, Hist=80318065B08301029083009000
    jcshell: Unable to select Card Manager or invalid FCI: Unknown Global Platform Java Card.
    Subsequent commands might fail! Inspection might not be possible!
    please, somebody can help me??

    Provide the trace: In the JCOP Shell, switch the APDU trace on (top, second icon from the right).

  • Develop Mutiple application java card?

    how does the multiple application java card works?I mean do we have to write different applets for different applications? and if yes then how does the card reader will recognize for which application the card should be used? Can anyone help me???

    Hi,
    how does the multiple application java card works?Multiple applets can exist on a single card because each applet instance is identified by a unique AID (application identifier). The card knows which applet is currently active and manages this for you. The active applet is the last applet that has been selected in the current session or the default applet for the card. If there is no default applet the card manager will be active.
    do we have to write different applets for different applications? If the different application requires different functionality you may want to use a separate applet but you can have multiple instances of the same applet as long as each instance has a unique instance AID. The instance AID is different to the applet/module AID (but it can be the same value). Each instance will have the same applet AID. You need to be careful with static variables when you have multiple instances of an applet as in any Java application, as there is still only on copy of the class in the JVM.
    how does the card reader will recognize for which application the card should be used?The card reader does not care which applet is being used. It only cares about the physical card. The card manager handles the currently active applet.
    I hope I have explained this clearly enough. One thing to remember is there are 3 AID's. The package AID, the module AID (for the applet class in the package) and the instance AID (for the instance of the applet created in the JVM with an install for install command).
    Cheers,
    Shane

  • Java card, problems uploading applet to Nokia 6131 NFC using Jcop + Eclipse

    Hi, we are trying to load an applet in this mobil phone ( [Nokia 6131 NFC|http://wiki.forum.nokia.com/index.php/Nokia_6131_NFC_-_FAQs] )
    and NXP people has redirect the support to this forum: [JCOP Tools|http://72.5.124.111/thread.jspa?threadID=5199227&tstart=329]
    So;
    This is the complete command sequence:
    >  /term "winscard:4|OMNIKEY CardMan 5x21-CL 0"
    --Opening terminal
    /card -a a000000003000000 -c com.ibm.jc.CardManagerresetCard with timeout: 0 (ms)
    --Waiting for card...
    ATR=3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 02 00    ;....O..........
        00 00 00 69                                        ...i
    ATR: T=0, T=1, Hist=804F0CA00000030603000200000000
    => 00 A4 04 00 08 A0 00 00 00 03 00 00 00 00          ..............
    jcshell: Unable to select Card Manager or invalid FCI: Unknown Global Platform Java Card.
    Subsequent commands might fail! Inspection might not be possible!somebody knows something about this error?
    Thanks in advance!

    The same!
    - /terminal pcsc:4
    --Opening terminal
    /atr--Waiting for card...
    ATR=3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 02 00    ;....O..........
        00 00 00 69                                        ...i
    T=0, T=1, Hist=804F0CA00000030603000200000000
    /select A00000030603000200000000 => 00 A4 04 00 0C A0 00 00 03 06 03 00 02 00 00 00    ................
        00 00                                              ..
    (0 msec)
    <= 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 02 00    ;....O..........
        00 00 00 69 00 00 00 00 00 00 00 00 00 00 00 00    ...i............
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
        00 00 00 00 00 00 00 00 00 00 00 00                ............
    Status: 0x0000
    Error code:     0 (0x0000)
    Offending APDU: 3B8F8001804F0CA000000306030002000000006900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
    Wrong response APDU.

  • Java card Applet RSA encryption Problems with Android

    hi all,I am new to java card development. I have used nxp jcop 31-36 java card and nexus s for testing the application.so i have faced lot of problems.first of all i want to encrypt data coming from the android app using RSA1024 and send back to the android application.there are the problems I faced
    1.RSA1024 and RSA2048 algorithms can't work with the nexus s Application.it means i can't receive any encrypt data from card.but when i test the application with eclipse jcop shell tool it is work properly.
    2.when i run the application in nexus s the application is crashed.it gives some wired sound when tap the java card to android phone.it may be java card application crashed or give some wired sound from android OS level.
    3.Then I Test the Application with Samsung S2. Sometimes it works but sometimes it crashed.in the S2 the encryption works fine(but we have to keep wile card 2 or 3 minutes).
    these are the steps i followed in established the connection i android phone.So fist i created the ISO dep connection and first select the Application(00A40400AID).Then using transive method i send data to java card.In the Java card in the installation i have created the RSA key pairs and get the RSA public key and private key.in some method i got the APDU buffer and read data and encrypt this data.Then those are send back to the card. First i want to know is there any problem in Android Os or JCOP 31/36 card.And other thing each time i requested to java crd is that need to reset the java card and how to reset the Java card.(some brief idea)

    Hi,
    1) Import android.smartcard libraries,
    2) Try to make a connection :
    ISmartcardConnectionListener connectionListener = new ISmartcardConnectionListener()3) create an instance of smartcardclient:
    smartcard = new SmartcardClient(this, connectionListener);4) get the list of readers :
    String[] readers = smartcard.getReaders();you can check if a specific reader is connected or nor with
    smartcard.isCardPresent(readers [0]);5) create a card channel and select your applet:
    cardChannel = smartcard.openLogicalChannel(cardReader, APPLET_AID);
    ICardChannel cardChannel = null;
    cardChannel = smartcard.openLogicalChannel(cardReader, APPLET_AID);6) you can send and receive APDUs with this line of code:
    byte[] response Apdu = cardChannel.transmit(commandApdu);Regards,
    Hana

  • Step by step installation for java card kit 2.2.2

    can anyone help me with a complete step by step installation information for java card kit 2.2.2, i already tried to follow the instruction given in the software i download n still stuck in setting the java path. any recommendation
    thanks for the help

    The javacard API is for developing applets on card. Java 6 is for developing clients off-card.
    yes u can use any java IDEs like netbeans or jcreator. But you will have to select the libraries within the downloaded java card kit folder for ur IDE in order to compile successfully.
    try reading up the documentation and run the samples in the java card kit. thats a good place to start.

Maybe you are looking for

  • Configuring ACH IAT payment method

    Hello Experts, We are trying to implement a new payment method (ACH IAT) for client's vendor payments. IAT is a new standard class entry (SEC) code that will replace the CBR and PBR SEC codes currently in use today. NACHA rules will require the IAT c

  • How to create a string array?

    Thanks!

  • ALV TREE in Web Dynpro

    Hi guys, I am trying to display data from the internal table to ALV tree by using TreeByKeyTableColumn. can anyone please help me out or suggest proper way to display. thanks,

  • Dynamicaly getting xml into java file

    hi, i want to xml dynamically into my java file . Is anyone having ida about it. Thanks

  • Code page conversion for chinese characters

    Hi, we receive an XML via JMS sender adapter where the code page in the Sending MQ system is cp850. One tag we receive contain chinese characters but are encoded as below <FAPIAO><Title>马么</Title><Remark>*æ¤,波特肉*</Rem