applet,smartcard,channel,javacard , Make 2 cardlet Java Card communicate

Make 2 cardlet Java Card communicate


Tag: applet,smartcard,channel,javacard

I have 2 cardlets Java Card on the same smart card that I want to make communicate.

I could select an applet then send the corresponding APDU and then deselect it and select the other one and etc... I am wondering if it is possible to do it more properly with logical channels ? I mean with a method that could allow me to not select/deselect each applet for each APDU command ?

Thank you in advance :)


Yes it's possible.

You need a card that supports additional logical channels.In that case, you can select more than one applet simultaneously.(One applet per each channel) Fortunately current cards support some additional logical channels.

But remember that if you want to select (at least) two applets of a single package simultaneously, you must implement MultiSelectable interface in both applets (and also in all the other applets of that package).

If your applets are not from a single package, you don't need to implement this interface.

After that, you can open 2 logical channel using MANAGE CHANNELS command and select App1 in channel 0, and App2 in channel 1 (For example). For the next commands, you specify which channel (and therefore which applet) is the target of the incoming command using the low nibble in the CLA section of that APDU commands.

Note that SELECT APDU command is an alternative for MANAGE CHANNELS-Open command.(So you actually don't even need to use MANAGE CHANNELS command)


Issue with Linked List (Java applet)

In this code, I am trying to initialize a linked list of ovals that are sent to a class to be drawn. public void actionPerformed(ActionEvent e) { oval p; Graphics g = this.getGraphics(); int x, y, height, width, fill; ListIterator li; LinkedList<oval> list = new LinkedList<oval>(); li = list.listIterator(); x...

Is it possible to program a “Java Card” - enabled smart card in any other language than Java?

I have a Java Card enabled smart card and a card reader that was given by my Lab-instructor. I am supposed to do a project using Java Card 2.1.1 API. I don't like the Java Card API. Is it possible to program my given smart card using any other language...

number value to byte[6] array card reader

What's the best way to convert a number to a byte[6] in C#? I'm using MagTek Card reader and trying to display desired amount on device screen, it should be 6-byte array. The amount needs to be used and authorized, EMV Tag 9F02, format n12. Function: int requestSmartCard(int cardType, int...

Glitch on one type death (but not the other) and winning in java applet game

This is a java Applet game. There are 3 game states, Running, Dead and Win. My question is two part, but I think they are related since they happen at the same point. Question 1: When you die by losing all your health the "Start over" button is displayed once....

How to run a Java applet in the browser: “Class Not Found exception”

I'm trying to get a Java applet to display in the browser - I know this question has been asked a number of times but I can't seem to find the answer that works specifically for this case - over the past few days I've tried everything from moving the...

Angular.js and Java Applet

I'm trying to call a java function via applet using Angular.js with no success. I'm not even getting the Applet loaded (java console is not starting when I load the app). I've used the approaches below without success. Any ideas? Binding applet parameters with angularJS angularjs and closing tags PS:...

Troubles with applets in c# application

I'm trying to run some applets in a web application developed with c# and when I run it, I get this message: ClassNotFoundException .PruebaPulsacion.class I have checked some questions here but they doesn't work for me and I don't know what to do. In my aspx page I have this...

Why isn't this program repainting a certain part of an applet even when repaint() is called

This is a simple rock, paper, scissors appelet. there are 3 variables keeping track of wins, losses, and ties. Then there is a label that is meant to display them. When I used the debugger the repaint method is being called so I don't understand why this portion of the...

Sending signature data in response APDU - Java Card

I would like to sign some data (the MESSAGE byte array) on my Java Card and then return the signature in a response APDU. My code works fine (or at least I think it does and it returns 9000) without the line apdu.sendBytes(BAS, sSignLen), but when I uncomment it I...

Smart Card Reader T0 T1 communication on APDU level

I am struggle to understand what protocol I have to use to communicate with the card T0 or T1? So, correct me if I am wrong, but the reader actually decides by itself what protocol to use to communicate with the card if the card supports both. So my logic...

How to change master key of DESfire cards?What is deciphered key?

I want to change the master key of a DESfire card. I read mifare DESFire datasheet already, but as I am new in this field, I couldn't understand it. It is explained how to Change the Key at page 37 of above document. Can anybody give me an example or...

Why don't these images show up?

I am working on a slot machine in Java and so far I created a button that will randomly generate two pictures. For some reason one of the pictures shows up while the other picture does not. I do not understand the issue as the code for both of these...

Confirm understanding: Tomcat served applet, and app network traffic?

All.. I am hoping someone who can confirm for me, what I read and what I have observed, regarding the Tomcat Java applet server? I have Linux server running Tomcat (I built two new ones, but based the configuration off the previous two that were present when I came on...

Java: Displaying Positions correctly in Tortoise vs. Hare Applet

I'm currently working on a Project that shows a tortoise vs. hare race in real-time as an Applet. A random number is chosen, and the animals either move forward, backward, or not at all based on that number. My problem is getting the animals to be seen in real-time. It...

Send APDU commands to USIM/SIM card in android

I was already worked with smart cards and I am familiar with APDU commands (that are defined in ISO/IEC 7816 and Global Platform specifications). Now I want to know if is there any way to send an APDU command to my USIM/SIM card that is inserted to my mobile phone?...

Sturdiness of an applet in Java Card

I developed an applet in Java Card and it works fine. Now I am working on the sturdiness of this applet and more precisely, what happens if the card is deplugged during the applet execution for example. I am wondering if there is an Exception which handle this kind of...

I can't run my own applets in browser

I can't run my Java applet in any browser - Java blocks it for security reason. I have Java 8, so I can't set security settings to medium. What I have to do? (in my own applets I mean applets that I wrote and it can't harm anything)

ISO7816 - Odd INS codes?

I found these mysterious lines in ISO 7816, ( 5.4.2 Instruction byte The instruction byte INS of a command shall be coded to allow transmission with any of the protocols defined in part 3 of ISO/IEC 7816. Table 10 shows the INS codes that are consequently invalid. Table 10 -...

How can I extract an X509 certificate from a smart card using Java?

I use the OmniKey 3121 reader and can use the javax.smartcardio API to send APDU commands to the card reader. I'm not sure if there is a standard way to access the certificate stored on the card. Pointers to example code to read the certificate data would greatly help. Also,...

Secure Box in JCOP card

JCOP V2.4.2 Revision 3 Security Target: Page 11-12 A Secure Box concept is implemented within JCOP 2.4.2 R3. The Secure Box is a construct which allows to run non certified third party native code and ensures that this code cannot harm, influence or manipulate the JCOP 2.4.2 R3 operating system...

Java applet play multiple .wav files

Hello I am trying to create a simple game, and right now I am trying to add a couple songs to play in the background during the game, which can be stopped and skipped as the player wishes. It seems everywhere I look I can't seem to make the example...

Java - Applet to Executable Jar Wrapping

I have written a Java XML Parser as an Applet. It is looking and functioning well enough in this form. My Question, Is if I want to run this without a browser, how Would I properly wrap it to run as an executable? -------------- import java.applet.*; import java.awt.*; import...

Regarding to use deployjava.js file [closed]

if any problem to use deployjava.js in my applictaion. Is it open Source

Smartcard PKCS11 AES Key Gen Failure

I am attempting to create an AES 256 key on an ACOS5-64 smartcard and OMNIKEY 3121 card reader, using PKCS11 in python (using the PyKCS11 library). So far, all the "standard" operations seem to work with regards to asymmetric crypto. I have run plenty of code samples and pkcs11-tool commands,...

Performance measures : Java vs JavaCard [closed]

I implemented two algorithms in Java. To compare their effectiveness, I call each function 1000 times and compare the execution time (using System.currentTimeMillis()). It needs 2500 ms to execute the first one and 1300 ms for the second one. With these results, I thought have a significative difference (in term...

Alternatives to Java applet to launch Microsoft Office applications

In our web application, we used to use a Java applet to invoke MS. Office applications e.g. Word to open, edit, and save back a file to the server. Google Chrome will no longer support NPAPI, so soon we can not run our applet in Chrome anymore. Plus, it seems...

What is the current behavior of firefox for the ubuntu menu bar?

I'm trying to development an applet ( to be used in the Cinnamon desktop. My intention is not modify or create any other code than not be cjs (javascript code). All that i do is: Connect my applet to the com.canonical.AppMenu.Registrar and the Gtk Dbus API. Get all object path...

how changing master key or other keys can provide security ?how used session key to keep the further communication between DESFire and reader?

I am working on the ticket electronik that tickets are DESFire cards. I want communications be safe . i now trying change PICC key . Before changing DESFire master key Authenticate with master key is necessary. In desfire sheet about Authenticate at page 31 was described: "This procedure not only...

Add a button to Java Applet

Using this code I would like to add a button to the page that displays when the gamestate is either Dead or Win. This button will let the user either start over or go on to the next level. My action listener is not yet fully coded because I can't...

How to change list column text color according to field values in SIEBEL HI?

Is there a way to change the color of the text according to field value ? It will be good if there is a way of doing this without scripting, if it is impossible then how to do it with scripting?

Images do not appear in applet

I am working on a game.I want to add images to the applet but they do not appear there until I resize or minimize the applet.I do not know whether my image observer is wrong or not. The images are in right path.Their in build and class folder with correct...

Java 3D Graphics using Applet and in built libraries only

I want to do Java 3D Graphics without using external libraries to develop a game applet. Sorry I am not that experienced with Graphics and so I am not sure how hard it would be to do it by myself

ADPU Service in iOS

I'm looking for an NFC solution for iOS similar to HostApduService for Android. Can someone tell me how can I exchange APDU commands in iOS. Thank you....

NFC SWP applet selection returns 6999

I have a simple JavaCard applet installed on my SIM card. I try to communicate with my applet using Omnikey 5121 CL reader and NFC-enabled Sony Xperia L through NFC/SWP (single wire protocol). The problem is I cannot select the applet - as a status word I get 6999. The...

Java Swing, application or applet?

If I want to write a GUI program using Swing, my understanding is that I can either write a Swing desktop application, or write a Swing-based applet (which I can run using appletviewer or a browser). But it's not clear to me which one to use. I don't have a...

How do I successfully use the Thread.sleep() method in Graphics?

This is my code so far: // Imported Classes public class Timer extends Applet { public void paint (Graphics page) throws InterruptedException { Thread.sleep(1000); } } I just want to know how I can get this to work. I've used the Thread.sleep() method in other code before, but never with...

Key Listener not working in JApplet

This is a break the brick type of game where the user cannot let the ball fall below the paddle. By the way paddle_x is sets the x coordinate of the paddle. I have a MouseListener that works very well however, the KeyListener does not. I am wondering what I...

Determine Facility Code and Card Number from ATR in C#

I have the following card reader HID Omnikey 5325. I have a contact-less card named HIS Proximity. The number written on this card is 133593 42101044091-3. By reading the card, I get the following ATR hex: 3B050002F10673 Using the folowing applications I have managed to see the following information. I...

How to use panels in applets?

I need to write a strategic game which contains awt panel. Scenario:- Firstly, I need to read from a txt file(my map) and draw my images based on the txt file. (i did it in the code below). public class temp extends JApplet implements Runnable,MouseListener { public void init() {...

access denied (“” “execute”)

I am is first applet that i writing i want run exe application with applet java code package appletexample; import*; import java.awt.*; import java.applet.Applet; public class Welcome extends Applet { public void init() { String execommand = "C:\\windows\\notepad.exe" ; try { Process proc = Runtime.getRuntime().exec(execommand) ; } catch(IOException...

applet don't load on firefox

Hello I am trying to load applet on web browser. I have create html and include applet tag <applet code="com.asprise.imaging.scan.ui.demo.PanelMain.class" codebase="."archive="asprise-imaging-ui.jar,asprise-imaging- scan-core.jar" width="400" height="300"> I have jar file also in same folder where i created my html,it gives me error. This plug-in is not supported Kindly help me to solve...

Embed shared libs in Java Applets

Is it possible to embed linux shared libs (.so) in Java applets? I know that I can call JNI code from applets (privileged only), but is it possible embed these libs inside the applet?...

Two OwnerPIN object in Java Card

I am working on a Java Card application where our requirement is to keep some static data and balance in the card. For security I was thinking to make 2 object of OwnerPIN. One object is for terminal authentication (i.e. the terminal needs to send 8 bytes of data to...

How to send a data array to my Applet and manipulation it by Applet and return new data in response apdu?

I want to send a random byte array including for example 24 elements to my JavaCard applet and then my applet is supposed to change that array using a specific method. For example that method XOR each elements with 0x05 and returns the result array in APDU response. To aim...

UID of a NFC/SWP-accessed SIM card

SIM card is used as a secure element in my project. It is accessed through NFC-SWP contactless interface from a terminal device. I need to identify the SIM card somehow with a unique and permanent identifier and I need to be able to read the identifier through NFC. ICCID seems...

Iterating through a Linked List in another class (Java Applet)

I have this code for when an applet button is pressed: public void actionPerformed(ActionEvent e) { oval p; int x, y, height, width, fill; x = Integer.parseInt(xfield.getText()); y = Integer.parseInt(yfield.getText()); height = Integer.parseInt(heightf.getText()); width = Integer.parseInt(widthf.getText()); list.add(new oval(x,y,height,width)); repaint(); } I need to iterate through the list of ovals and...

Spawning mutiple circles and make them move

I'm trying to teach myself java and I "try" to code a little game. I have a problem and I guess the solution is very simple but I'm struggling. The basic idea is that I am controlling a circle and I want to spawn circles every 5 seconds at random...

C on smartcards [closed]

I have the task to write some crypto stuff in C and make it lightweight. The idea behind making it lightweight is, that it could run on a smartcard which doesn't offer much computational power and memory. It won't come to actually running it on a smartcard and it won't...

Change PIN of a Gemalto Smartcard through a script

We have to use the Gemalto IDPrime .Net card Smartcard. We get these USB Dongles and have to change the PIN. Gemalto says via windows: From the Start menu, choose Run and type PINTool. Insert a IDPrime .Net card in the reader as prompted, and click OK. The change PIN...

how to draw a line graph using java with fixed X-Y axes

There is data which is distributed in two columns. X axis ranges from 0 to 1 with step values as 0.1, 0.2, 0.3.... 0.9,1.0. and Y axis ranges from 0 to 1500 with step value of 100. 0,100,200....1500. Data is in following form: Column 1 Column 2 Column 3 A...