Java card api and long

Java card runtime does not have support for primitive long..... but if you absolutly had to have a long, how could one do it.
I am thinking it would be some sort of byte[] representation. But I havent found any information. Can someone point me to the right direction

The int keyword and its 32-bit integer data type are optionally supported.
what is wrong with using a byte array ?
you can convert long to byte array and vice versa with your
own code.

Similar Messages

  • How to calculate call duration using java card API

    Hi,
    I am developing an application using Java card API. I want to calculate duration of otgoing calls in it. I am trying to start timer at the beginning of call in Call Control event. Can someone kindly check following code of Call control event? Here timerManagement function is sending proactive command for starting timer for 3 hours. Here I am asuming that maximum call will be of 3 hours. In callDisconnect event i can get current value of timer and use it to calculate duration of call. But this scenario is also not working.
    Problem is that during code execution program stuck at send command (proHdlr.send();) of timmerManagement function. I am sending postAsBERTLV command before starting timer so may be reason is that it is not possible to send proactive command while phone is busy.
    But I also cannot send postAsBERTLV after timerManagement function. Because it is mention in specification that "The EnvelopeResponseHandler content must be posted before the first invocation of a ProactiveHandler.send method or before the termination of the processToolkit, so that the GSM applet can offer these data to the ME (eg 9Fxx/9Exx/91xx). After the first invocation of the ProactiveHandler.send method the EnvelopeResponseHandler is no more available"
    Take a look at following code
                     * Method illustrating the use of the Call Control event.
                    private void callControlService() {
                                    /** @todo: Replace following sample code with your implementation */
                                    ProactiveHandler proHdlr = ProactiveHandler.getTheHandler();
                                    EnvelopeHandler envHdlr = EnvelopeHandler.getTheHandler();
                                    ProactiveResponseHandler rspHdlr = ProactiveResponseHandler
                                                                    .getTheHandler();
                                    EnvelopeResponseHandler envRspHdlr = EnvelopeResponseHandler
                                                                    .getTheHandler();
                                    durationCount = 0;
                                     // allow call with no modifications
                                    envRspHdlr.postAsBERTLV((byte)0x9F, (byte)0x00);
                                    // start clock using timer
                                    timerManagement(proHdlr, rspHdlr, (byte) 0x0, timer_id, tempBuffer);
                                    return;
                    }Please help me in this regard
    Thanks
    Yasir

    I am also unable to start timer in call connected event. I cannot send any proactive command while phone is busy. I am using Gemalto development Suite and there simulators (Simulation 2G chain).
    Is it limitation of simulator that you cannot send any proactive command while phone is busy?
    Is there any other work around for getting call duration?

  • About Java Card API 2.0

    Dear all,
    I want to get the Java Card API 2.0 but dont know where to get it.
    I go to the web pages of Sun but still cant find it.
    Do some body know where to get it or just have it and be able to send to me ?
    My e-mail is [email protected]
    Thank you very much .
    Angel Wang Taiwan.

    The reason I want Java Card 2.0 API is that
    I want to test something on my card
    because I meet some unkonown problems when I used API 2.1 .
    But now , all problems are fixed .
    So , I will continue to use API 2.1
    However, thank you very much.

  • Java Card API in Web Applet

    Hi,
    We have a website which uses username/password authentication for authorization for website usage.
    The client wants to add a new level of security by giving access to people using ActiveIdentity Smart Cards.
    We would like to read these smart cards from our login screen. Is there a way to communicate to smart cards by using Java Card API via web pages (maye be usage of applets)?
    Let me know, Its getting critiocal for us.
    Thanks,
    Joy T

    Not IIS nor Apache. We are deploying on Oracle OAS, which internally uses Apache.
    If you can point me to some guidelines to achive it on Apache, that will be great..

  • A question about Java Card API 2.2.1

    Hi,I am doing my first project on java card and I have the software installed(java_card_kit-2_2_1, OCF 1.2, j2sdk1.4.1).
    java_card_kit-2_2_1 include these package:
    java.lang
    java.io
    java.rmi
    javacard.framework
    javacard.security
    javacardx.crypto
    com.sun.javacard.impl
    com.sun.javacard.crypto
    My question is:
    How can I get the export files of the last two package:com.sun.javacard.impl and com.sun.javacard.crypto?
    I really need your help and please mail to me.My email is [email protected] you very much.

    Hi libin_hailang
    The last two packages are not part of the api.
    So, you only can use them on the Simulation.
    On a real card implementation you will not find these packages.
    This may be the reason for the not existing export files .
    But if you need them for other purpose you can create them with the converter.
    bye.

  • Java Persistence API and creation of databases

    Hi All
    I have designed a small address book application which uses a database to store the information. I have used the new Java Persistence API to take care of my transactions and querrys with the database. This works great for one set database which is generated the first time the application runs and is used all the time.
    However I would like to make it so that the user can create a new address book (database) with a different name, I am not sure how I would do this using the Java Persistence API. I know the persistence.xml file must be placed in the META-INF directory of the source, so how would I be able manipulate the file or could I place the file somewhere else.
    David

    I am using the Derby database. I can create a database by passing the create command when I create the entity Manager like so:
    Connection c = DriverManager.getConnection("jdbc:derby:AddressBook;create=true", "app", "app");My problem is that as I understand it the persistence.xml file must know the name of the database. Unless there is another way of setting this. The line in the persistence file I am referring to is:
    <property name="toplink.jdbc.url" value="jdbc:derby:AddressBook"/>I wonder if I can progamatically set this value so that I have a default database in the persistence.xml and others can then create there own.
    David

  • Java Communications API and Java SDK 1.4.2

    I just installed the Java Communications API 2.0 on my Windows XP system, with JDK 1.4.2. As per the install instructions, I copied files from the zip into my /lib and /bin directories and set the classpath. However, when I attempt to compile any of the samples, the compiler displays a large number of errors. I know the API documentation only references JDK1.2 -- are there any special tricks to installing on newer JDKs, or will I need to acquire an older JDK to develop?

    My path variable is still not being set! Here is the content of my autoexec.bat located on the root directory of C:\
    rem - By Groove Setup
    PATH=%PATH%;"C:\Program Files\Groove Networks\Groove\Bin"
    PATH=%PATH%;C:\PROGRAM FILES\J2SDK1.4.2_07\BIN
    /code]
    When I type 'path' at the MSDOS C:\ prompt, I receive the following in the get the following:C:\WINDOWS;C:\WINDOWS\COMMAND;\C:\PROGRAM FILES\GROOVE NETWORKS\GROOVE\BIN
    As an aside, I noticed that when I perform a search of the my hard drive (c:\), I find two autoexec.bat files. One at the root, and the other in C:\Windows\Command\EBD.
    I believe the instructions stated to modify the autoexec.bat at the root directory.
    TIA for any assistance. This is really becoming a nusance and taking up quite a bit of my time trying to resolve this problem.

  • Java card simulator and WTK communication problem.

    Hi ,
    I am a newbie to java card .I am doing project on java card based sim.
    For that I am using JavaCard SDK 2.2.2 and WTK 2.5.2 .
    Now when i am trying to connect to cref(java card simulator) from java card midlet,I am getting protocol mismatch error.This is because of WTK runs on slot T=0 and cref runs on T=1.
    then i tried with jcdk3.0.1 classic edition.It provides cref configured to run on both slots T=0 and T=1.
    But when I tried to deploy jcrmi applet on cref running on T=0 i am getting the same error "Protocol mismatch error".
    Can anybody please tell, if there is any way to configure cref to run with T=0?
    Please reply ASAP, as i am stucked with the problem from more than a month.
    Thanks in advance,
    Saviy

    Thanks Anki for replying.
    I am trying to run RMISample from development kit.With steps given in guide as follows
    1.cref -o demoee
    2.Navigate to the
    JC_CLASSIC_HOME\samples\classic_applets\RMIPurse\applet
    directory.
    3.ant all
    it works fine but when i do it with following steps:
    1.cref -o -t0 demoee
    2.Navigate to the
    JC_CLASSIC_HOME\samples\classic_applets\RMIPurse\applet
    directory.
    3.ant all
    i am getting protocol mismatch error.

  • Java Card Product and Price List

    Where to find the Java Card, Card Reader to read Java Card and its Price List issued by Sun Microsystems.I want these products and price list.
    What is the tool needed to install the .CAP file in to Java Card?. I have read from the Sun Material, that there will be a off-card installer that loads the binary file of .CAP to Java Card through the CAD device. Where to find the off- card installer?
    I had tested a sample application in Eclipse IDE with JCDK 2.2.2 and EclipseJCDE.
    Please anyone provide me the details
    Edited by: sachindev on Oct 24, 2007 6:22 PM

    Hi there,
    I found this site with everything that you might need, I would say that prices are reasonable (correct me if I am wrong):
    Cards: http://www.smartcardsource.com/cards.htm
    Readers: http://www.smartcardsource.com/readers1.htm
    SDK: http://www.smartcardsource.com/sdk.htm
    Hope it helps...

  • Java card application and applet

    Hi
    I' am developing a java card application which has three applets (1-ID, 2-Purse, 3-Library). I mean the same card should be use for personal ID, purse, and as library card. Using eclipse I first have to create a new project.
    File-New-New project-java card project. Then in the package Explorer view right click src then New-other-java card Applet. My question is because my java card application has more than one applet how do I add the other two. Should I add the other two by clicking src again or just add them under the same source code belonging to the java card Applet created at the beginning.

    you mean by again doing right click src then New-other-java card Applet.

  • Java card Applet and sim toolkit applet

    What is Difference between this two?
    When i load java card applet on sim ,then applet is not visible on GSM phone. But sim toolkit Applet is visible on GSM phone.
    i think,SIM uses sim.toolkit ad sim.access to interact with Applet.
    is it so?
    Plz solve my query.
    Thankx 4 ur valuable time.
    Regards
    Divyesh.

    for programming in sim card, you must use necessarily sim toolkit applet.
    I thing that the difference between Javacard applet and Simtoolkit applet is that:
    - sim toolkit applet is only for sim card
    - java card applet is for another smart card
    of course, both have some joint things.

  • IDES for writing Java card applets and converting the applets as CAP FILE.

    I have developed a JAVA CARD APPLET , FindMFValueJCA.java . It gets compiles in net beans 6.0 But while converting the applet to CAP file i am getting some errors. Is there any other IDES which take care of converting the CAP files

    What's the Java version you are using?
    As the java card tool kit has version dependencies. If you are using java_card _kit 2.2.2 then 1.5 is fine.                                                                                                                                                                                                                                                                                                   

  • Java Card / SIM Card proprietary APIs

    Hello all,
    I am finishing my graduation on Informatics Engineering and my final thesis is about Smart Cards.
    In the thesis I have to present all the development solutions available to create Smart Cards and SIM Cards applications
    This way, i not only have to talk about Java Card API and SIM Toolkit, but also about the UICC and USIM toolkit and about proprietary APIs, like Gemalto, G&D, etc APIs.
    I have searched on the web about proprietary APIs, or special events/features to each types of cards but I couldn't get any documentation on this. Of course if they are proprietary I am not expecting to get the implementation or the code of it, but I just need any documentation about these APIs, or any description about the methods or events on them.
    So, did any of you guys already used any proprietary APIs? or have any information about any proprietary API?
    Thank you very much,
    Helri

    Hi Joseph, thank you for your response, i'll search for .NET cards and for PKCS#15 cards as well.
    That was a great help, thank you

  • Default applets on brand new java card and spec support

    Hi,
    I have got brand new java card reader and real java card.
    I want to just access it using Java and see if I can access stuff on the java card before i go ahead with next things.
    I was thinking of just doing select on some applet which is present on brand new java card by default.
    1. Does anyone know if any default applet is present on java card?
    2. If yes, AID of that?
    3. Is there any APDU by which I can find out which java card spec that card supports?
    Btw, I am using Java Card 2.2.2 and the card i have should also have same support.
    Edited by: unic.man on Jul 12, 2008 2:11 AM

    >
    1. I know that any smart-card has a universally unique id which can be retrieved pro grammatically. Can you please tell me the APDU/API to retrieve it on Host app side? If not, card side at least?
    I don't know much about unique IDs but basically you've got the ATR which is given to you every time the card is powered on. The ATR identifies a particular family of cards. If you want to identify each card you need to have a look at the GET DATA command (in Global Platform) and especially the CPLC (Card Production Life Cycle). Apparently you can get a unique ID by combining the IC batch identifier and the IC serial number.
    2. I'm also struggling with deploying the app. It is not detecting the default installer applet via apdutool. I found some articles and netbeans plug-in talking about keys to download applet on card. Do you know standard keys/derivated keys to start secured channel?I don't think you can use the JCDK to install an applet on a real card. If you have a JCOP card I advise you to get the JCOP tools. And yes you will need the keys to establish a secure channel but I don't know what the default keys are on a JCOP card.

  • Java Card and Random Data

    Hello,
    i�m a student working with smart cards in my spare time. I�ve never
    worked with Java Cards before. As far as i know, instead of
    applications there are Java Applets on the Java Card. And instead of a
    native smart card OS there is the Java Card VM from Sun, with all its
    libraries.
    What i would like to know now is, how can i write a simple applet to
    generate for example a random number. According to Sun�s JC API 2.1.1
    there is a class called RandomData (in library javacard.security)
    which allows me to generate a random number. But this class is an
    abstract class. That means, i have to overwrite its abstract class
    functions setSeed(...) and generateData(...).
    Do i have to add the implementation code for these functions? How are
    these function calls handled to the JavaCard VM and to the hard ware
    of the Java Card? Does it depend on the possibilities of the hardware
    functionality of a Java Card?
    I would be very greatful if you could help me out with this.
    Sami

    You can call:
    RandomData r = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);
    Usually, the chips have hardware RNG and thus provide true random.

Maybe you are looking for

  • Simple Task - Syntax Question (how do you pass variables from one component to another component - databinding)?

    Hi all, I'm trying to pass some width/height/URLs from a Video Player component to a Social Bookmarking component's embed text input field. (for people to grab and share videos). I know this is a simple task, but it's the end of the day and I seem to

  • Progress Controle in Crystal Report 10.5

    Hi All, I am moving from crystal report 9.x to 10.5. In crystal report 9.0 some usefull properies such as EnableProgressControle to see your crstal report progress. I am trying hrad to find these properties. I am working on migration project and my c

  • Nautilus doesn't refresh directories

    Hello I am having a problem with nautilus because when another application adds or removes files the change is not seen in the directory when I use  nautilus (new files are not in the folder untill I go ot and get back to the directory),  I hope you

  • Security information resources.

    Security mailing lists provide some of the most up to date sources on security notices, disclosures, and vulnerabilities. The best aggregation of said mailing lists that I have found is at insecure.org (think nmap). They actually have their own site

  • What is wrong with this!! please help

    Hello friends, I'm a learner and I have done lot of JDBC connectivity with Acess database, and now I want to connect java program with oracle database, but the problem is I have downloaded the oracle driver, set the classpath, and I have created the