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
4
votes
0 answers

Java Card Export File Dependencies

I wrote three applets in three separate packages ServerApp in packageA ClientApp in packageB CharlieApp in packageC My aim is to see if CharlieApp can access the grantCredit method through the ClientApp. I am able to convert ServerApp and ClientApp…
4
votes
1 answer

Are Util.* functions on JavaCard side channel resistant?

I am wondering if the Util.* functions in a JavaCard are normally side channel resistant. Do there exist some JavaCards, which have side channel resistant Util.* functions? I looked in several public JavaCard Security Targets. But neither one has…
Cryptostasis
  • 1,166
  • 6
  • 15
4
votes
1 answer

How to verify a certificate validity on a Java Card?

I know how to verify certificates with Java, but I am unaware of how to do it on a java card due to the restrictions of the java card APIs (no java.io/ other classes, only javacard APIs + Object + Throwable allowed). I didn't find any javacard…
Kevin Van Ryckegem
  • 1,915
  • 3
  • 28
  • 55
4
votes
2 answers

How to reduce the size of javacard applet

I wrote an applet which has 19 KB size on disk. It has three classes. The first one is extended from Applet, the second one has static functions and third one is a class that i create an instance from it in my applet. I have three questions: Is…
Mohsen Gorgani
  • 420
  • 4
  • 18
4
votes
0 answers

Setting Contactless Historic Bytes in GlobalPlatform 2.3

In GlobalPlatform 2.2 and earlier, the API method GPSystem.setATRHistBytes allowed me to change the Historic Bytes for both contact and contactless interfaces. However, in GlobalPlatform 2.3 that method has been altered, and now only changes the…
4
votes
1 answer

SIM card and JCRE confusion

As far as I know, the SIM card is a Java Card and it shall implement the ETSI/3GPP specifications and the UICC configurations. If the SIM is a Java Card - does it contains a JCRE from the Suns JCRE specification? If the SIM card has a JCRE - is it…
Bluestar
  • 79
  • 1
  • 7
4
votes
1 answer

How to get further data from JavaCard after 0x6310 status?

I'm trying to list applets/packages on a Java Card. I use the following APDU command to get the list: 80 F2 E0 00 02 4F 00 00 That command returns the status word 0x61xx, so I send a GET RESPONSE command for xx bytes: 00 C0 00 00 xx This gives…
4
votes
0 answers

CCID IccPowerOn Status 00h and Error 80h

I send PowerOn CCID command on card insertion to receive ATR. But instead I always get this error: PC_to_RDR_IccPowerOn (00h Automatic): bStatus: 0x0 bError: 0x80 Error 80h according to CCID spec "Reserved for future use". But same code working…
dasar
  • 5,321
  • 4
  • 24
  • 36
4
votes
1 answer

Global platform lockCard() always return false

I made a test applet and install it with card lock priv. Jcop plugin is returning like - Card Manager AID : A000000151000000 Card Manager state : INITIALIZED Application: SELECTABLE (---L----) A0A1A2A3A4A5A6 i.e. application have card…
Arjun
  • 3,491
  • 4
  • 25
  • 47
4
votes
2 answers

difference between APDU command between contact and contactless Interface

I have a question about APDU format in contact and contactless Interface. I have an ACR122U contactless card reader and i studied it's API (v2.1). According to the document, apdu format in contactless mode is different from contact mode. for example…
Mohsen Gorgani
  • 420
  • 4
  • 18
4
votes
0 answers

usage of the Global Platform Secure channel functionality

Can the the GP Secure Channel functionality be used for communications other than the ones for applet personalization or applet management? For instance, can it be the case that a financial transaction is secured (authentication, integrity or…
engy
  • 41
  • 1
4
votes
1 answer

Fast way to convert byte[] to short[] on Java Card

I want to optimize SHA-3 algorithm on a Java Card. I need a fast algorithm consuming less memory which allows to easy convert byte[] to short[] (or short[] to byte[]). My current implementation looks like this: private short[] byteToShort(byte[]…
user4272649
4
votes
1 answer

Does NFC SIM Cards have an internal antenna? How to install applets on SIM cards?

I was searched about NFC SIM cards and found such explanations about them here and there: For those who want to use near field communication technology but don’t currently have an NFC compatible smartphone, there are other ways to enable NFC…
Ebrahim Ghasemi
  • 5,850
  • 10
  • 52
  • 113
4
votes
2 answers

No padding for AES cipher in Java Card

In JavaCard 2.2.2 API, I can see that some symmetric ciphers are implemented with a padding mode, for example: Cipher algorithm ALG_DES_CBC_ISO9797_M1 provides a cipher using DES in CBC mode or triple DES in outer CBC mode, and pads input data …
Raoul722
  • 1,222
  • 13
  • 30
4
votes
0 answers

How to enable Visa2 key diversification on GP compliant card?

I have developed a Java Card applet for a customer, and now he wants me to enable Visa2 Key Diversification algorithm on his cards. I have never been involved in deploying applets to cards, so this is a new concept for me. The tool I occasionally…
iMan Biglari
  • 4,674
  • 1
  • 38
  • 83