Questions tagged [javacard]

Java Card refers to a technology that allows Java-dd applications (applets) to be run securely on smart cards and similar small memory footprint devices.

Java Card is the tiniest of Java targeted for embedded devices, typically smart cards. Java Card gives developers the ability to program the device and make them application specific. It is widely used in SIM cards (used in GSM mobile phones) and/or NFC secure elements, ATM cards (containing an EMV chip), and machine readable travel documents.

The first Java Card was introduced in 1996 by Schlumberger's card division which later merged with Gemplus to form Gemalto. Java Card products are based on the Java Card specifications developed by Sun Microsystems (which is now Oracle Corporation). Many Java Card products rely on the GlobalPlatform specifications for the secure management of applications on the card (download, installation, personalization, deletion). GlobalPlatform was created to manage OpenPlatform, which was an initiative of Visa Inc.

The main design goals of Java Card are portability and security. Although the Java classes are initially compiled using the Java SE compiler there are many restrictions on Java Card. For instance, Java Card Classic does not support String and integer support is optional; object instances are created in persistent memory instead of RAM by default. Java Card has some features that are not present in J2SE as well: application isolation through the so-called applet firewall and a transaction mechanism.

991 questions
6
votes
3 answers

How to get JavaCard version on card

How to get java card version from card? Is there any way how to get version of JC from the card. Or should I try to install applets with specific for each JC version options.
hunterra
  • 95
  • 1
  • 6
6
votes
1 answer

Secure Com SCP02 Session : What is the role of "Key Diversification data" returned in response of Initialized Update command

In response field of Initialized Update command, Key Diversification data (which contains manufacture ID and last two bytes of security domain AID) is returned to Off Card entity. I would like to know for what purpose this data is used ? I read…
Bhanu
  • 663
  • 5
  • 13
6
votes
2 answers

How to send response APDU containing return data AND status word other than 0x9000?

I would like to send a response APDU containing a response data field as well as a status word that is not 0x9000. Considering my understanding of ISO 7816-4 this should be possible in general. However, whenever I specify return data and try to send…
Thomas Lieven
  • 371
  • 4
  • 14
6
votes
1 answer

Max length of ISO7816 APDU and addressing offsets?

I'm interested in ISO7816-4 compliant first interindustry APDUs. What is the maximum length such an APDU can/is allowed to have? The longest APDU I can think of should be an extended length ISO case 4 APDU. This means we have 4 Bytes of header, 3…
Thomas Lieven
  • 371
  • 4
  • 14
5
votes
1 answer

How to install applet on smart card using java

Is there any way to load .cap(converted applet) design in java card in to java and then install applet from that .cap(converted applet) file into smart card? I am having .cap file that is converted applet file and i want to install applet present in…
Sachin D
  • 1,370
  • 7
  • 29
  • 42
5
votes
1 answer

Delete APDU command with SSD AID in its data field, returns 6985

I have a Javacard which contains a SSD (Supplementary Security Domain) and I want to delete it. Normally when I want to delete an applet or a package from my card, I send the following DELETE APDU command after a successful Mutual Authentication…
Ebrahim Ghasemi
  • 5,850
  • 10
  • 52
  • 113
5
votes
1 answer

Can I program eSIM/eUICC devices with Java Applets

From my research on embedded SIM (eSIM) technology, it's a SIM card that the consumer owns and is capable of downloading and switching between 3rd party subscriptions. I've also read it's expected that most eSIMs will run a Java Runtime and support…
Conor Patrick
  • 2,879
  • 5
  • 22
  • 33
5
votes
1 answer

C# PCSC-sharp Send / Receive Custom Commands with Data

I'm working on a C# Java Card (Smart Card) program, and I am trying to utilize the PCSC-sharp library on github. Here's the "short / tl;dr" version of my request: The PCSC-sharp example covers Iso7816 Case2Short. Can someone either correct my…
Blue Smoke
  • 83
  • 1
  • 5
5
votes
1 answer

Does `Signature.init()` rewrite persistent memory?

A few quotes from Java Card API 2.2.1: Signature class description: A tear or card reset event resets an initialized Signature object to the state it was in when previously initialized via a call to init(). For algorithms which support keys…
vojta
  • 5,591
  • 2
  • 24
  • 64
5
votes
1 answer

Verify Java Card signature

I am writing a Java Card 3.0.2 application on a NXP J3D081 card. I have it both signing and verifying a signature using ALG_ECDSA_SHA_256. The keys have been written to the card by my test app. If I sign 32 bytes of data and pass the signature back…
cifs
  • 51
  • 1
5
votes
2 answers

Can a JavaCard emulate a MIFARE Ultralight or NTAG NFC tag?

I would like to write a Java Card applet that responds to an NFC reader as if it was a regular MIFARE Ultralight or NTAG NFC tag. I am aware the MIFARE protocol is proprietary and may be a little more difficult but surely I should be able to achieve…
jim
  • 8,670
  • 15
  • 78
  • 149
5
votes
1 answer

Access an applet directly without AID selection

Usually, when you power up a JavaCard smartcard and want to communicate with an applet, you must select the applet using its AID first. Is there any way to have a "default applet" that is selected when the card is powered up? What I really want to…
jim
  • 8,670
  • 15
  • 78
  • 149
5
votes
0 answers

Error 0x643A when installing applet on Java Card

After the successful installation (and deletion) of the same applet twice, I can't manage to install an applet anymore on my Java Card. The setup involved: Smart card: ACS ACOSJ 40KB Java Card 3.0.4 (dual interface) Card reader: Cherry TC 1300…
Ayell
  • 560
  • 2
  • 12
5
votes
1 answer

update EF under ADF in USIM in java card

I am working on applet and I want to update a FIle (a LOCI file for example : 0x6f7e ) under USIM using SIM/UICC applet. The first question is: can I read/update EF under the ADF using SIM JAVA API (using STK applet) ? According to my reads…
forest forest
  • 101
  • 1
  • 6
5
votes
1 answer

Global Platform Java Card Secure Channel Example

I'm struggling for a long time. I need to create secure channel from Desktop App to JavaCard. I found GlobalPlatform http://www.win.tue.nl/pinpasjc/docs/apis/gp22/ but I can't get it working. I know how to react when I have a secure channel ( use it…
Petr Skyva
  • 71
  • 2
  • 5