Java Card Startup
I have downloaded JavaCard JDK 2.1.2,
I have a smartcard reader-writer
I have a smart card which I do not know if it works with Java.
I need to know what tools, hardware, what kind of smart card do I need to develop a project using Java Card.
Do I need a special kind of smart card, if so where can I buy it?
Thanks for your time and consideration.
Hi,
I was in this position a few short weeks ago... here's what you'll need:
First of all, you'll need to know whether or not your smartcard supports java. That's VERY important! Some cards do not include a processor, yours has to. Some cards only provide a sort of primitive "file system" for storing information. Yours has to have an operating system that implements the Java Card Runtime Environment. I guess that whoever you bought the smart card from would be the best person to ask about that stuff.
If you've already got the JavaCard Development Kit, you pretty much need only a couple more pieces of software. You need an application (hopefully included with the reader) to transfer your applets to the card, and you need an API for your host-side application that will communicate with the card. Opencard, at www.opencard.org, is a good API for this.
Hope this helps! Good Luck!
Russ
Similar Messages
-
Auto start Java Card application
Hello,
is it possible to start a Java Card application from the SIM card right after the mobile is switched on?
I talked to a guy from a SIM card manufacturer and he told me it's possible since the device checks on start if a Java Card application is present to display it in the phone's menu, but it's device dependant how it's done and if the application really will be started (which sounds kind of strange).
Can someone give me more details if it's possible to auto start a application and how it's done ( code snippet would be great ; )?
Thanks in advance,
tericThe first event after ME startup, which STK applet could catch is Terminal Profile.
So, in applet class constructor should be smthng like
ToolkitRegistry reg = ToolkitRegistry.getEntry();
reg.setEvent(EVENT_PROFILE_DOWNLOAD);
and applet will trigger on Terminal Profile arrival. -
Need suggestion regarding simulation of Java Card using a floppy
Hi All,
I am working on a project wherein I have to simulate a Java Card application using a floppy. I am writing my own Card Terminal and CardTerminalFactory. Thats what I have started working on. Will that serve the purpose or do I have to think about some other approach like just overriding the cardInserted method of CTListener class? I want to achieve communication between the host application and the floppy(which is my java card) Please advise.
I would like to thank DurangoVa and Nilesh for helping me out sorting out the error in running the converter.
Thanks in advanceAre you referring to a Floppy diskette drive ?
-
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 helpThe 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. -
J2me and java card, need help to communicate
we are trying to put together a reader to read smartcards using j2me and we figure that it would be easiest if we could develop it to work with java cards rather than standard smart cards, the problem is we get garbage when we communicate to it, the chip sends us crap, any suggestions what might be wrong, any calls we might be missing, has anyone worked with j2me and java cards or smart cards, any help would be appreciated.
einar.... reader app and the ME behind it .... smells like mobile ....
First of all - if you want to have one mobile application running on this just make sure that whatever is written in ME can use drivers from the reader chip ....
Workin on the PC is something completely different. There was one good example how to develop one host application in Java provided with the JCOP tools long ago ... I don't know if this is now in the new Eclipse tools.
But - there was a small API provided that can give you good hints what to do - and - once you have it on the reader side - you can easily integrate ME methods with this ... -
How to check the output of a java card program ?
Hi,
I am new to java card technology.I am trying to run a simple helloworld program given in the java development kit2.2 -windows samples in eclipse3.5.
For running I followed the following steps:-
1) Firstly,I went to JCWDE->start
2) then on Project->java tools->deploy
It shows me following output :-
Java Card 2.2.2 APDU Tool, Version 1.3
Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
Opening connection to localhost on port 9025.
Connected.
Received ATR = 0x3b 0xf0 0x11 0x00 0xff 0x00
CLA: 00, INS: a4, P1: 04, P2: 00, Lc: 09, a0, 00, 00, 00, 62, 03, 01, 08, 01, Le: 00, SW1: 90, SW2: 00
CLA: 80, INS: b0, P1: 00, P2: 00, Lc: 00, Le: 00, SW1: 90, SW2: 00
CLA: 80, INS: b2, P1: 01, P2: 00, Lc: 00, Le: 00, SW1: 90, SW2: 00
CLA: 80, INS: b4, P1: 01, P2: 00, Lc: 18, 01, 00, 15, de, ca, ff, ed, 01, 02, 04, 00, 01, 0b, 01, 02, 03, 04, 05, 06, 07, 08, 09, 00, 01, Le: 00, SW1: 64, SW2: 3a
CLA: 80, INS: bc, P1: 01, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b2, P1: 02, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b4, P1: 02, P2: 00, Lc: 20, 02, 00, 1f, 00, 15, 00, 1f, 00, 0f, 00, 15, 00, 36, 00, 0c, 00, 69, 00, 0a, 00, 14, 00, 00, 00, 6c, 00, 00, 00, 00, 00, 00, 02, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b4, P1: 02, P2: 00, Lc: 02, 01, 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: bc, P1: 02, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b2, P1: 04, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b4, P1: 04, P2: 00, Lc: 18, 04, 00, 15, 02, 03, 01, 07, a0, 00, 00, 00, 62, 01, 01, 00, 01, 07, a0, 00, 00, 00, 62, 00, 01, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: bc, P1: 04, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b2, P1: 03, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b4, P1: 03, P2: 00, Lc: 12, 03, 00, 0f, 01, 0b, 01, 02, 03, 04, 05, 06, 07, 08, 09, 00, 00, 00, 14, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: bc, P1: 03, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b2, P1: 06, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b4, P1: 06, P2: 00, Lc: 0f, 06, 00, 0c, 00, 80, 03, 01, 00, 01, 07, 01, 00, 00, 00, 21, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: bc, P1: 06, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b2, P1: 07, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 07, 00, 69, 00, 02, 10, 18, 8c, 00, 01, 18, 11, 01, 00, 90, 0b, 87, 00, 18, 8b, 00, 02, 7a, 02, 30, 8f, 00, 03, 3d, 8c, 00, 04, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 8b, 00, 02, 7a, 05, 23, 19, 8b, 00, 05, 2d, 19, 8b, 00, 06, 32, 03, 29, 04, 70, 19, 1a, 08, ad, 00, 16, 04, 1f, 8d, 00, 0b, 3b, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 20, 16, 04, 1f, 41, 29, 04, 19, 08, 8b, 00, 0c, 32, 1f, 64, e8, 19, 8b, 00, 07, 3b, 19, 16, 04, 08, 41, 8b, 00, 08, 19, 03, 08, 8b, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b4, P1: 07, P2: 00, Lc: 0c, 00, 09, 19, ad, 00, 03, 16, 04, 8b, 00, 0a, 7a, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: bc, P1: 07, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b2, P1: 08, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b4, P1: 08, P2: 00, Lc: 0d, 08, 00, 0a, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: bc, P1: 08, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b2, P1: 05, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b4, P1: 05, P2: 00, Lc: 20, 05, 00, 36, 00, 0d, 02, 00, 00, 00, 06, 80, 03, 00, 03, 80, 03, 01, 01, 00, 00, 00, 06, 00, 00, 01, 03, 80, 0a, 01, 03, 80, 0a, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b4, P1: 05, P2: 00, Lc: 19, 06, 03, 80, 0a, 07, 03, 80, 0a, 09, 03, 80, 0a, 04, 03, 80, 0a, 05, 06, 80, 10, 02, 03, 80, 0a, 03, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: bc, P1: 05, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b2, P1: 09, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: b4, P1: 09, P2: 00, Lc: 17, 09, 00, 14, 00, 03, 0e, 27, 2c, 00, 0d, 05, 0c, 06, 04, 03, 07, 05, 10, 0c, 08, 09, 06, 09, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: bc, P1: 09, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
CLA: 80, INS: ba, P1: 00, P2: 00, Lc: 00, Le: 00, SW1: 64, SW2: 21
Can anyone tell me what is this output? And Am i deplyoing in the right way?Hi,
You might want to check the JCDK user guide (cJDK_Users_Guide_bin_do.pdf) for details of using an emulated card environment. It outlines how to use the simulators provided with the JCDK. This should tell you how the deploy process works and will give you some insight into what this script is doing.
Cheers,
Shane -
How do I test a Java card applet with different AIDs on the fly?
... Like sweeping cards from employees in a queue of people lining up in the morning?
When I created my applet, the aid is a fixed value inside the class.
Whenever I wanted to test it with another value, I changed that AID and rerun the applet.
I find it very cumbersome that needs to be rerun and rerun, over and over again.
How do I test the applet easily with any values of AIDs that I'd like to put in, on the fly.
I know I can't simulate the sweeps of card in the applet because I can't have a main method with a signature
of Strings[] args or String[] args. I can only have JUnit to help me out, but still java card doesn't allow either
main(Strings[] args) or TestCase to inherit from.
Thanks
Jackyour question is hard to understand but:
an applet always has one definite AID and you cant change it after install as far as i know
a) you want to test many cards with diffrent AIDs?
->send a list of select commands and check the return values
b)you want one card with the same applet to be available for many AIDs?
->install many dummy applets forwarding the commands to one core applet
c)i think i didnt get your point :/ -
How to Install .CAP file in the Java Card?
Hi Friends..
How to install *.CAP* file in the Java Card?..
I've GPShell script as follows :
mode_211
enable_trace
establish_context
card_connect -readerNumber 2
open_sc -security 1 -keyind 0 -keyver 0 -mac_key 404142434445464748494a4b4c4d4e4f -enc_key 404142434445464748494a4b4c4d4e4f
install_for_load -pkgAID a00000006203010c01 -nvCodeLimit 500 -sdAID A000000003000000
load -file HelloWorld.cap
card_disconnect
release_contextwith that script i can load HelloWorld.cap file successfully..
Now, how to install the HelloWorld.cap file?..
if i add script : load -file HelloWorld.cap i got this error :
install -file HelloWorld.cap
file name HelloWorld.cap
Command --> 80E602001B09A00000006203010C0107A00000015100000006EF04C60201A80000
Wrapped command --> 84E602002309A00000006203010C0107A00000015100000006EF04C60201
A80030C859793049B85300
Response <-- 6985
install_for_load() returns 0x80206985 (6985: Command not allowed - Conditions of
use not satisfied.)i ask this question because when i tried to select the applet through its AID, by this script :
establish_context
card_connect -readerNumber 2
select -AID a00000006203010c0101i got this message error : select_application() returns 0x80216A82 (6A82: The application to be selected could not be found.)
but there's exactly any that AID in my Java Card..
here's is the list of AID from My Java Card :
C:\GPShell-1.4.2>GPShell listgp211.txt
mode_211
enable_trace
establish_context
card_connect -readerNumber 3
* reader name OMNIKEY CardMan 5x21-CL 0
select -AID a000000003000000
Command --> 00A4040008A000000003000000
Wrapped command --> 00A4040008A000000003000000
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 --> 8050000008AAF7A87C6013BC0300
Wrapped command --> 8050000008AAF7A87C6013BC0300
Response <-- 0000715457173C2A8FC1FF0200937A55C288805D8F2A04CCD43FA7E69000
Command --> 848201001023CA18742D36165ED992CFF2146C3D51
Wrapped command --> 848201001023CA18742D36165ED992CFF2146C3D51
Response <-- 9000
get_status -element 10
Command --> 80F21000024F0000
Wrapped command --> 84F210000A4F004FF8BE1492F7275400
Response <-- 0CF0544C00004D4F44554C415201000009A00000006203010C010100010AA000000
06203010C01019000
GP211_get_status() returned 2 items
List of Ex. Load File (AID state Ex. Module AIDs)
f0544c00004d4f44554c4152 1
a00000006203010c01 1
a00000006203010c0101
card_disconnect
release_contextPlease help me..
And please correct me if i'm wrong,,
Thanks in advance..Any suggestions for my question?..
Please help me..
Thanks in advance.. -
Where can i find a complete course and some samples about using java card !
hello !
i am new to java card and i am seeking for complet course and samples of how i can use this new developement kit and to get familiarized with it !
any help will be very appreciated
thanksi have got t JCDevKit_User_Guide.pdf this file describes the using of jav card ! but when i tried to execute what it said on dos i did it succifully but i could not see the result? i mean is there an applet to se or to integrate in an html file or to use elswhere?
i mean , how nomalaly can i use the files generated in the sample �? where to integrate them and where to use them?
please help me and excuse my exhaustive questions!
thanks -
How to load a java card applet into a java card
Dear All,
I am a novice to java card technology..
I have done some search on how to load a java card applet into a smart card but haven't found a satisfactory answer. I have read about installer.jar and scriptgen tool but I want to load the applet from a java program and not from command line. It would be of great help if somebody can help me out.
If somebody can share a sample program which load a javacard applet(.CAP file) into a smart card, I will be very thankful.
I am able to find some client applications which help us send APDU commands and recieve response APDU's to interact with an applet loaded on to the smart card but not application which actually load the applet.
I have heard of OCF and GP.. some say that OCF technology is outdated and no longer in use.. can somebosy throw some light on this too..
cheers,
ganeshhi siavash,
thanks for the quick response.. i checked out GPShell as suggested, it looked like a tool by which one can load an applet on to card and send some sample apdu commands... but I want to load the applet from the code.
My application should look something like this.. it will be a swing applicaton where I have a drop down with a list of readers, I select the one desired and then click on "LOAD" after inserting a blank java card, at this point my applet which is stored in my DB should get loaded on to the java card. The next step should be to personalize it where I enter the values for the static variables of my applet and click "PERSONALIZE", at this point all these values should be embedded into APDU commands and sent to the java card for processing.
For achieving this I am yet to find a comprehensive sample or documentation on the net.
Please help...
regards,
ganesh -
How to create a java card library (jar file to be used in other programs)
Hi all,
I am working on JCOP and writing quite a bit of applets for the java card . Now i have lots of code that could be reusable for example sending SMS, encryption routine, etc.. So this part of the code i want to put into a utility class and create a package out of it. This utility package i must be able to import into my programs what i write.
I tried the normal way of creating the jar by renaming the CAP file of the utility class, also tried including the /javacard/* files also into the jar file as indicated by sfarmer(active forum member here). But none seems to work. I tried contacting NXP folks and they indicated that it may be possible only by way of Sharable Objects.
But some how i am not convinced why i should use Sharable object for this. So if any one can throw some light into this regard it will be immensely helpful to me and my project.
Regards
PrakashHi,
Well the variable defined are as below
public static byte[] msgdata = new byte[255];
private static final byte[] HEADER_TEMPLATE = {
(byte) 0x81, (byte) 0x03, (byte) 0x01, (byte) 0x21, (byte) 0x00, // Command details tag
(byte) 0x82, (byte) 0x02, (byte) 0x81, (byte) 0x02, // Device Identities tag
(byte) 0x8D, // Text String tag
(byte) 0x00, // length
(byte) 0x04, // Text String tag
the msgdata is declared public so that i can access this as a Class member in my other program doing Utilities.msgdata. But the problem is now that if i dont declare it as final then the compiler gives me the below error
"library has initialized array for non-final, non-static field Utilities, msgdata, [B, attr jc-field: tok 0, public static"
If i make it final then i cannot change it... So now i am stuck..
Any help will be highly appreciated...
Regards
Prakash -
How to find out memory of a java card
is there anyone could tell me that how can we check the size of the memory of a card? thank you in advance:D
If the card is a Java Card 2.2.1, create an applet that returns
JCSystem.getAvailableMemory(), install and queryit.
Some other ideas for getting the free memory on card were presented in the thread "Java Forums - Free memory on card"
http://forum.java.sun.com/thread.jspa?threadID=647894&tstart=30
Jan -
The version number of export file in Java Card 2.2 is not correct
Hi all,
I used jdk1.3.1 and java card 2.2's exp2text tool to see the content of an export file. The value of minor_version is 1. But the JCVM 2.2 spec. says it should be 2. So which one is correct?
JoeyRead my post again....indicate binary compatibility or incompatibility between successive implementations of a package.
I can gerenate CAP files generated with JC 2.2., and load onto my JC 2.1.1 cards. AS LONG as I'm not using JC 2.2 implementation.
Run the exp2Text on javacard.framework.service and notice that it should read minor = 2. That's because to use that export, JC 2.2 is minimal required implementation. -
I am a student in my final year of university and im looking into using the java card as part of my final project. could somebody clarify for me some things i am unsure of. Am i able to use any smart card reader or do i need one specific for a java card, if so which one. If i can use any im ok as i can get hold of some. Also, am i correct in that i would write my java code as normal then use a program to write it to the card? any help would be much appreciated. Thanks
Hi,
you can use any reader.
the java code has to be compiled , then converted using the sun-provided JCDK tool "converter" then loaded in the card using globalplatform, with the gpshell tool.
beware, there are some restrictions to what can be written in the code. specifically, there is no "int" "float" "java.lang.String" and the memory is very small.
and yes, objects are allocated in non volatile memory. So the "new" keyword must not be used too often, except in the initialization methods.
why? because the JC virtual machine is always live. it does not stop. When you tear the card, the VM is suspended, then resumed when you reinsert the card, but the objects are still here.
when an apdu is sent to the card, the JCVM calls a callback in your code. But your Applet object still exists.
regards
sebastien. -
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.Hi,
I found the following resources helpful when starting out in JavaCard.
JavaCard documentation:
Java Card Technology for Smart Cards: Architecture and Programmer's Guide (Book)
http://java.sun.com/docs/books/javacard/index.html
JavaCard specifications:
http://java.sun.com/products/javacard/specs.html
Global Platform specifications:
http://www.globalplatform.org/specificationview.asp?id=card
Communication between SmartCards and terminals is based on ISO 7816 part 3 and 4 so if you�re completely new to the SmartCard environment it may be helpful getting an overview regarding these specifications. Unfortunately these specifications are not free, they�re available from.
http://www.iso.org/iso/en/ISOOnline.frontpage
Software:
The basis for all development is the JavaCard and Java Development kits.
Java Development Kit
http://java.sun.com/j2se/1.4.2/download.html
JavaCard Development Kit
http://java.sun.com/products/javacard/dev_kit.html
Full installation instructions can be found in JCDevKit_User_Guide.pdf which is contained in the JavaCard Development Kit distribution.
Several companies provide IDE�s that will aid you in developing and deploying applets to JavaCard.
For example:
Aspects Developer
http://www.aspectssoftware.com/devtools/index.html
There are others out there as well. You may need to also buy physical sample cards; however, the IDE�s usually have simulators built in.
Hardware:
To interact with physical cards you�ll require a PCSC compatible card reader.
Omnikey
http://www.omnikey.com/
GemPlus
http://support.gemplus.com/gemdownload/readers/index.aspx
Hope this helps.
Cheers,
Alasdair
Maybe you are looking for
-
Can i have two different face time accounts on one apple id
Would like to have two different face time accounts, one on mac book pro and one on ipad. Can I have two different face time accounts on one apple id?
-
Problems found during the EXPORT to specified keyin table.
Hi I am getting this error in sending iDOC system( We have iDOC-XI-iDOC Scenario.) I tried to reregister the queues but still nothing is passing thru XI. Thanks, Manish
-
Best Practise for Data Refresh & Hierarchy
Hi, During a recent discussion with one of our BI user groups, the questions were raised as what the best practice are to handle the following two issues. Issue 1: If entries are posted to the prior periods in SAP R/3 (outside of the daily auto-refre
-
Personnel number in Ad Hoc query
Hi, The personnel number in the Ad Hoc query is not coming up. I mean the field is selected for Output but 000000 is seen for al employees. Can anyone please guide as to what needs to be done in order for the Personnel number to show. Thanks in advan
-
Need to disable delete icon in over view screen (table maintainance)
In the overview screen (transaction se 54 -> generated object -> overview screen) in table maintainance i need to disable the delete icon. Anyone can please help me in it.