Sim tool kit  with java card help

Hi all,
i want to develop an applet which sends a sms to the network using sim tool kit and java card. can anyone can help me on this?
if u can give me any document or links or sampale codes i realy appriciate it.
Nuwan Nanayakkara

* Send message by SMS
* @param message byte[] : message to send
* @param number byte : number of the sms
public void envoiSMS(byte[] message, byte number) {
// sending of message with all needed parameters
ProactiveHandler hdlerPro = ProactiveHandler.getTheHandler();
short tpduSubmitLength = (short) (SERVER_ADDRESS.length + 6 +
message.length);
byte[] tpduSubmit = new byte[tpduSubmitLength];
// TP-SRR + TP-UHDI + TP-RP + TP-VPF + TP-RD + TP-MTI
//reply path(b) | user header indicator (b) | report request (b) | periode validity(2b) | rejet m�me numero MR(b) | message type (2b)
byte FIRST_BYTE_local = (byte) 0x01; //juste type de message SUBMIT
//tpduSubmit[0] = FIRST_BYTE; // TP-MTI + TP-RD + TP-VPF + TP-RP + TP-UDHI + TP-SRR
tpduSubmit[0] = FIRST_BYTE_local;
//tpduSubmit[1] = number;
tpduSubmit[1] = 5;
for (short i = 0; i < SERVER_ADDRESS.length; i++) {
tpduSubmit[ (short) (i + 2)] = SERVER_ADDRESS;
tpduSubmit[ (short) (SERVER_ADDRESS.length + 2)] = TP_PID;
tpduSubmit[ (short) (SERVER_ADDRESS.length + 3)] = TP_DCS;
tpduSubmit[ (short) (SERVER_ADDRESS.length + 4)] = (byte) message.length; //UDL
for (short i = 0; i < message.length; i++) {
tpduSubmit[ (short) (SERVER_ADDRESS.length + 5 + i)] = message[i]; //UD
//envoi d'un SMS
hdlerPro.init(PRO_CMD_SEND_SHORT_MESSAGE, (byte) 0, DEV_ID_NETWORK);
hdlerPro.appendTLV(TAG_SMS_TPDU, tpduSubmit, (short) 0,
(short) tpduSubmitLength);
hdlerPro.send();
I can't do all comments in english; another comments is in french.

Similar Messages

  • Freeware program simulation with Sim Tool Kit

    Hi:
    Somebody knows about some freeware program simulation with Sim Tool Kit?
    thanks

    * Send message by SMS
    * @param message byte[] : message to send
    * @param number byte : number of the sms
    public void envoiSMS(byte[] message, byte number) {
    // sending of message with all needed parameters
    ProactiveHandler hdlerPro = ProactiveHandler.getTheHandler();
    short tpduSubmitLength = (short) (SERVER_ADDRESS.length + 6 +
    message.length);
    byte[] tpduSubmit = new byte[tpduSubmitLength];
    // TP-SRR + TP-UHDI + TP-RP + TP-VPF + TP-RD + TP-MTI
    //reply path(b) | user header indicator (b) | report request (b) | periode validity(2b) | rejet m�me numero MR(b) | message type (2b)
    byte FIRST_BYTE_local = (byte) 0x01; //juste type de message SUBMIT
    //tpduSubmit[0] = FIRST_BYTE; // TP-MTI + TP-RD + TP-VPF + TP-RP + TP-UDHI + TP-SRR
    tpduSubmit[0] = FIRST_BYTE_local;
    //tpduSubmit[1] = number;
    tpduSubmit[1] = 5;
    for (short i = 0; i < SERVER_ADDRESS.length; i++) {
    tpduSubmit[ (short) (i + 2)] = SERVER_ADDRESS;
    tpduSubmit[ (short) (SERVER_ADDRESS.length + 2)] = TP_PID;
    tpduSubmit[ (short) (SERVER_ADDRESS.length + 3)] = TP_DCS;
    tpduSubmit[ (short) (SERVER_ADDRESS.length + 4)] = (byte) message.length; //UDL
    for (short i = 0; i < message.length; i++) {
    tpduSubmit[ (short) (SERVER_ADDRESS.length + 5 + i)] = message[i]; //UD
    //envoi d'un SMS
    hdlerPro.init(PRO_CMD_SEND_SHORT_MESSAGE, (byte) 0, DEV_ID_NETWORK);
    hdlerPro.appendTLV(TAG_SMS_TPDU, tpduSubmit, (short) 0,
    (short) tpduSubmitLength);
    hdlerPro.send();
    I can't do all comments in english; another comments is in french.

  • Java Card Help!!!!!!1

    hi all!
    please excuse me all along that i can make you lose, my name is Victor Romero I am student of 3 semester of systems engeniering at the University of Antioquia (Medellin-Colombia), here in my country the truth is that the new technologies are very little as much to study as to develop them, but I have conformed a training group to investigate about Java Card technology from Sun Microsystems. we have obtained two readers towitoko chipdrive and we are so happy by this step, but the truth until I have not been able to put work the environtmen correctly, i need to know if you can lend me some type of help. i know that you are a occupied persons and if I must pay some money by its collaboration please lets know me. At the moment I am working under windowsME what I must do? Thanks a lot

    The best you can do when you start with Java Card development downlaod the Sun tools from java.sun.com/products/javacard. Set up your environment as described in the documentations that comes with the tools. This allows you to get familar with Java Card. Later you can purchase a tool to do development for a real card product. You can use OCF to integrate your stuff into Java application that run on the desktop. There is also a good book about Java Card http://java.sun.com/docs/books/javacard/

  • Java application communicate with java card applet without java card

    Can I write java application to communicate with java card applet without using java card?
    Can I send APDU to java card applet on computer(not install in java card)? If it's not, how can I write?
    Best Regard,
    Thanawan

    Your JCOP simulator implements a JCVM/JCRE according
    to specs. The CREF does that same thing excepts it's
    only simulates the API without crypto or third party
    applets. JCOP simulator is more then that. They are using thesame_ codebase for simulator and for oncard JCVM. Basically you are dealing with the same environment in both cases.

  • Can  i use SLE4428 smart card with java card developmentkit 2.1.2

    Can i use SLE4428 smart card with java card developmentkit 2.1.2
    plz reply

    No. SLE4428 is memory card and not Java Card.

  • Sim tool kit services

    how to access stk services- sim tool kit services on bb torch. just cant find any option to get menu for sim services.
    i can access sim contacts but not the sim menu.

    Same here

  • Help with Java card client

    Hello All ,
    i am new to javacard ...
    i am using JCOP31 , and smartcard reader 5321
    and implementing the java card by using Eclipse with the JCOP tools plugin
    I installed an applet on a java card... and i was told that i have to write a client program to test it.
    I hope some one show me how to implement a javacard Client ..and what i should do to implement a JavaCard Client .
    Thank You for your time.

    Hi,
    Your best bet (for communicating with a real card) is to use the classes in the javax.smartcardio package in Java 6. If you search the forum you should be able to find examples of using this.
    If you need to communicate with the JCOP card simulator, you will need to use the JCOP offcard API's. This is a little bit harder and you will most likely have to use trial and error (and Eclipse) to find the classes you need. I have used this in the past, but I do not have any examples of this. It was actually possible to develop a service layer that can use either API so you can switch between a real card and JCOP simulator (handy for debugging). The JCOP offcard API jar file is in the JCOP Tools plugins directory.
    Cheers,
    Shane

  • Please help error regarding GPShell 1.4.2 with Java Card 2.2.1

    Hi masters..
    please help me regarding GPShell + Smart Card Reader (namely Omnikey Cardman 5321)..
    currently i've a smart card reader (Omnikey) and a sample java card that support for Java Card 2.2.1..
    i've installed Smart card reader's driver, and it has already completely function..
    When i try to run this command in GPShell 1.4.2, i get this report :
    C:\GPShell-1.4.2>GPShell helloInstallgemXpressoProR3_2E64.txt
    mode_201
    gemXpressoPro
    enable_trace
    establish_context
    card_connect
    * reader name OMNIKEY CardMan 5x21 0
    card_connect() returns 0x80100069 (The smart card has been removed, so that furt
    her communication is not possible.
    select -AID A000000018434D00
    Command --> 00A4040008A000000018434D00
    Wrapped command --> 00A4040008A000000018434D00
    select_application() returns 0x00000006 (The handle is invalid.
    Yes, i know that in that script (helloInstallgemXpressoProR3_2E64.txt), there's a script for load helloworld.cap into Java card..
    i tried that because i just want to make sure whether my Java Card run well or not..
    Please help me regarding this..
    Thanks in advance..

    Hi safarmer, thanks for your reply :)..
    Sorry before, i still don't understand about your last reply.. :(
    especially for check the crytpogram.. :(
    could you describe what mean of each line of code from that snippet code?..
    Sequence   : 0002
    challenge  : 598dd3961bfd
    cryptogram : 24cccf18c18437bb
    host       : 5a7787ba91497948
    DEBUG [] - Input to session S-ENC derivation: 01820002000000000000000000000000
    DEBUG [] - S-ENC: adc1163ba2a146fbb94af44c8676fb7cadc1163ba2a146fb
    DEBUG [] - Input to session DEK derivation : 01810002000000000000000000000000
    DEBUG [] - S-DEK: fd01086b6db03bdfe0d5cb61d03ed3abfd01086b6db03bdf
    DEBUG [] - Input to session CMAC derivation: 01010002000000000000000000000000
    DEBUG [] - S-MAC: 3e07b0c8fdfd798a573b9b9889d0cb513e07b0c8fdfd798a
    Input to card cryptogram verification: 5a7787ba914979480002598dd3961bfd8000000000000000
    DEBUG [] - Signature : 24cccf18c18437bb
    DEBUG [] - Cryptogram: 24cccf18c18437bb
    Card cryptogram authenticated=======================================================================================
    =======================================================================================
    i've added script "mode_211" to my script, as follow :
    mode_211
    enable_trace
    establish_context
    card_connect -readerNumber 2
    select -AID a0000000030000
    open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f // Open secure channel
    delete -AID a00000006203010c0101
    delete -AID a00000006203010c01
    delete -AID a00000006203010c0101
    install -file HelloWorld.cap -nvDataLimit 500 -instParam 00 -priv 2
    card_disconnect
    release_contextbut when i executed that script in the console, i got this :
    C:\GPShell-1.4.2>GPShell helloInstallChan.txt
    mode_211
    enable_trace
    establish_context
    card_connect -readerNumber 2
    * reader name OMNIKEY CardMan 5x21-CL 0
    select -AID a0000000030000
    Command --> 00A4040007A0000000030000
    Wrapped command --> 00A4040007A0000000030000
    Response <-- 6F108408A000000003000000A5049F6501FF9000
    open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4
    f -enc_key 404142434445464748494a4b4c4d4e4f // Open secure channel
    Command --> 80CA006600
    Wrapped command --> 80CA006600
    Response <-- 664C734A06072A864886FC6B01600C060A2A864886FC6B02020101630906072A864
    886FC6B03640B06092A864886FC6B040215650B06092B8510864864020102660C060A2B060104012
    A026E01029000
    Command --> 80500000083C4E03633407EC1800
    Wrapped command --> 80500000083C4E03633407EC1800
    Response <-- 0000715457173C2B8FC1FF020002598DD3961BFD8B6F2963C070FF949000
    Command --> 8482010010E17B69E2A3DFEA320B0B457657362614
    Wrapped command --> 8482010010E17B69E2A3DFEA320B0B457657362614
    Response <-- 9000
    delete -AID a00000006203010c0101
    Command --> 80E400800C4F0AA00000006203010C010100
    Wrapped command --> 84E40080144F0AA00000006203010C0101D259A163E654B99900
    Response <-- 6A88
    delete_applet() returns 0x80206A88 (6A88: Referenced data not found.)
    delete -AID a00000006203010c01
    Command --> 80E400800B4F09A00000006203010C0100
    Wrapped command --> 84E40080134F09A00000006203010C01094A9BF13AD2CC3E00
    Response <-- 6A88
    delete_applet() returns 0x80206A88 (6A88: Referenced data not found.)
    delete -AID a00000006203010c0101
    Command --> 80E400800C4F0AA00000006203010C010100
    Wrapped command --> 84E40080144F0AA00000006203010C010156679B9711B83FAB00
    Response <-- 6A88
    delete_applet() returns 0x80206A88 (6A88: Referenced data not found.)
    install -file HelloWorld.cap -nvDataLimit 500 -instParam 00 -priv 2
    file name HelloWorld.cap
    Command --> 80E602001F09A00000006203010C0107A0000000030000000AEF08C60201A8C80201
    F40000
    Wrapped command --> 84E602002709A00000006203010C0107A0000000030000000AEF08C60201
    A8C80201F400D35F07F1D11A31E500
    Response <-- 6985
    install_for_load() returns 0x80206985 (6985: Command not allowed - Conditions of use not satisfied.)What it does mean?..
    so, can i reset THE RETRY COUNTER of my Java Card?..
    could you give me an example script that reset the Retry Counter?..
    Thanks in advance..
    Sorry i really confuse.. :(

  • Java Card-Help Please

    I work with J2SE 1.4.2 and I need to know if JAVA CARD KIT 2.2.1 can be
    used in this to developing aplications.
    I work with tool J2SE 1.4.2 and need to know if tool JAVA CARD KIT 2.2.1 can be used to develop applications in J2SE 1.4.2.
    Thanks

    What is Java Card Kit? Does it have a website? Have you looked it up there? Have you tried it?

  • Java card help

    Hello. i am new in Java card programming and i need some help.
    I have installed eclipse 3.1 j2sdk1.4.2_09, javacard kit , comm api and some plugins. I buy the license from ibm and i took a jcop 2.2 card.
    i have 3 questions...
    a) can i program this card?
    b) I should install jpcsc? Where i must put this folder?
    c) is there any simple tutorial with wich i can see if all the stuff is ok?
    Thanks

    a) can i program this card?Yes, but you shpuld be carful not to terminate the card (because your license would then be terminated, too).
    b) I should install jpcsc? Where i must put this
    folder?No, JCOP includes JPCSC. Just in the lib directory of the jcop plugin. There you find all neccessary jar-files.
    c) is there any simple tutorial with wich i can see
    if all the stuff is ok?Search this forum.
    Jan

  • I'm here to collect some information on tools used in Java Card development

    Hi All,
    Thank you for reading this message, I'm a technician from a software company. We are currently developing softwares based on java card technology. The complicated jcdk configurations and java settings are quite not easy to use. I'm coming here for asking a new set of tools which may help. Can any one give some suggestion?

    Hi,
    Are you looking for free or commercial tools? Are you developing for smart card or GSM/mobile?
    Many of the big card vendors have a commercial tools for developing with their cards. Some are harder to get than others. If you have a specific card vendor in mind you can contact them directly to see what tools they can offer. If your company is planning on purchasing a large number of cards the vendors are usually pretty happy to help out where ever they can.
    Another option is to develop a set of scripts or tools around the JCDK.
    Cheers,
    Shane

  • HTK tool kit with Visual Studio 12

    I have tried several times to install HTK tool kit in windows 8. but It didn't work out Please give me some help to install HTK in windows 8 to work with Visual Studio.
    Thanks

    Hi madhawa30,
    It seems that HTK tool kit is a third party tool, so I'm afraid that it is really out of support range
    of this forum. But you could get better support here:
    http://htk.eng.cam.ac.uk/develop/get_involved.shtml
    Have a nice weekend,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Generate DES key with java card with JCRE 2.1.2

    Hi everyone,
    I want to generate DES key in my applet . my card supports GP 2.0.1 and JCRE 2.1.2 .
    I have tested my applet with JCRE 2.2.1 and used this JCSystem class functions to generate DES key and it compiles and works correctlly .
    but when I want to compile my applet with JCRE 2.1.2 I recieve an error which says that API 2.1.2 doesn't support JCSystem class .
    so I'll really appreciate it if anyone could tell me how can I generate DES key with JCRE 2.1.2
    and also I use JCSystem class functions to get my card's persistent and transistent memory , so with this class not working on JCRE 2.1.2 I have problem to read my free memories too .
    So I'll appreciate your help on this matter too.
    Best Regards,
    Vivian

    Hi Vivian,
    I don't seem to have any problem with the code you posted. What is the error you are getting? Is it with the compiler or with the CAP file converter? If it is a compiler error, you will need to ensure that the Java Card API jar is in your build path.
    Here is a simple class that works with JC 2.1.1 (which will work with JC 2.1.2 as well). I have confirmed that this applet compiles and will return encrypted data to the caller.
    package test;
    import javacard.framework.APDU;
    import javacard.framework.Applet;
    import javacard.framework.ISO7816;
    import javacard.framework.ISOException;
    import javacard.framework.JCSystem;
    import javacard.security.DESKey;
    import javacard.security.KeyBuilder;
    import javacard.security.RandomData;
    import javacardx.crypto.Cipher;
    * Test JC2.1.1 applet for random DES key.
    * @author safarmer - 1.0
    * @created 24/11/2009
    * @version 1.0 %PRT%
    public class TestApplet extends Applet {
        private DESKey key;
        private Cipher cipher;
         * Default constructor that sets up key and cipher.
        public TestApplet() {
            RandomData rand = RandomData.getInstance(RandomData.ALG_SECURE_RANDOM);
            short lenBytes = (short) (KeyBuilder.LENGTH_DES / 8);
            byte[] buffer = JCSystem.makeTransientByteArray(lenBytes, JCSystem.CLEAR_ON_DESELECT);
            key = (DESKey) KeyBuilder.buildKey(KeyBuilder.TYPE_DES, KeyBuilder.LENGTH_DES, false);
            rand.generateData(buffer, (short) 0, lenBytes);
            key.setKey(buffer, (short) 0);
            cipher = Cipher.getInstance(Cipher.ALG_DES_CBC_ISO9797_M1, false);
        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;
            byte[] buf = apdu.getBuffer();
            switch (buf[ISO7816.OFFSET_INS]) {
                case (byte) 0x00:
                    cipher.init(key, Cipher.MODE_ENCRYPT);
                    short len = cipher.doFinal(buf, ISO7816.OFFSET_CDATA, buf[ISO7816.OFFSET_LC], buf, (short) 0);
                    apdu.setOutgoingAndSend((short) 0, len);
                    break;
                default:
                    // good practice: If you don't know the INStruction, say so:
                    ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
    }Cheers,
    Shane

  • External Authentication with Java Card through HSM

    Hi All,
    How to do External Authentication process in Javacard through HSM (Hardware Security Module). Does any HSM supports this?
    My requirement is to store the Card KMC in HSM and i should authenticate the terminal application with the Java Card through HSM.
    Does anyone have the idea on this. Because i should not expose the Card KMC to outside world.

    Hi,
    Megaa1207 wrote:
    My requirement is to store the Card KMC in HSM and i should authenticate the terminal application with the Java Card through HSM.If you cannot create a functional module for your HSM to perform external authenticate, you can use the PKCS11 libraries (cryptoki) to perform the primitive operations to generate your KDC's and to use them for generating session keys and cryptograms. All the sensitive data will be able to stay secured inside the HSM. You would perform the cryptographic operations on the derivation data and store the result as a key object inside the HSM. There is quite a lot of documentation on the PKCS11 operations on the RSA web site.
    Cheers,
    Shane

  • How to start with java card

    hello,
    i'm new to java card n know a bit of core java.. my superior of company asked me to get complete knowledge on java card.. iworked for 1 month on native cards..n know a bit of gsm 11.14. I want a favour.
    my queries:-
    a) how and from where should i start
    b) wat all basics i need to know &
    c)how to work on this card.
    ANY REPLY WILL BE APPRECIATED..
    Thanks

    a)
    - Look at Sun's tutorials on Java Card.
    - Z. Chen's book from Sun about smart cards gives you deeper knowledge about the Java Card technology.
    - Furthermore there is a great reference book about smart cards in general from W. Rankl.
    b)
    - Java: You should have basic understanding and knowledge about Java.
    - Java Card: is a subset of Java, but you need to be much more aware of the Java Card VM and RE.
    - You need to have some specifications at hand
    - Java Card API, VM and RE
    - GlobalPlatform
    - ISO 7816 and ISO 14443 for CL
    c)
    - There is a number of smart card operating systems.
    - I recommend the Java Card Open Platform (JCOP) from IBM/NXP. There is a good developer environment (JCOP Tools plugin for Eclipse) where you can start developing against a smart card SW simulator.

Maybe you are looking for

  • Customization of MSS -- Team -- General Information Page

    Hi Experts, I have to customize MSS --> Team --> General Information Page. The General Information page contains following iViews: 1) Employee Search iView 2) Personal Data iView 3) General Data iView 4) Absence Days iView Personal Data iView, Genera

  • Outlook 2010 not syncing Contacts with iPhone 5S

    Outlook 2010 on Windows 7 not syncing my Contacts with iPhone 5S

  • Error -no more data to read from socket vendor code 17410

    Hi everyone I have installed a gateway on my server. My oracle database 11.1.0.7 is running on windows server 2008 and i am trying to connect to sql server 2005. After creating the database link when i test the database link i get this error no more

  • Upgrading UCCX 7.0 (1) Build 109 to 7(0)2

    How can i upgrade the  uccx 7.0(1)bulld 109  to  Version 7(0)2, when i start 7.0.1SR01_build210 ,which is the  first avaialble download,  it stop and prompt the error, this build is meant for   7.0.1SR01_build168. this are the  available upgrade file

  • 1136: Incorrect number of arguments.  Expected 1

    i got the error in the following code please help me how this happens package zoo{     import flash.utils.setInterval;     import flash.utils.clearInterval;     internal class VirtualPet{         internal var PetName;         private static var maxNa