2

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 like C?

user366312
  • 16,949
  • 65
  • 235
  • 452

1 Answers1

3

The general answer :

Unfortunately no, currently there is no other way than using Java Card API to program a Java Card compatible card.

The detailed answer:

Some kind of cards have a mechanism named "Secure Box". As mentioned in the JCOP v2.4.2 r3 card Security target :

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 or any of the applets executed by the operating system.The separation of the native code in the Secure Box from other code and/or data residing on the hardware is ensured by the Hardware MMU which has been certified in the hardware evaluation.

Here and here you can see some information about Secure Box. As far as I know, you can write applications in C or Assembly language and upload them on the Secure Box. But it is really really tricky and I think finally you will change your opinion about the Java Card API and you will make a decision to try to not only like it, but also love it! ;)

Note that, in comparison with Java Cards, there are some other kind of cards named "Native Cards". The operation system in this cards is not Java Card Runtime Environment/Virtual Machine. These cards have a proprietary/manufacturer-specific way and language (Normally C or Assembly) to develop applications. But it is not as easy as Java Card applet development. And you will make a decision to try to ....love it again :D

Update : (Thanks to dear Vojta)

Sorry, I was forgot that. As Vojta mentioned in his comment, one of most known native card types is MULTOS. You can write programs in C, Java, Assembly and some other language for these cards and after that you must convert them to MELL (MULTOS card's language) using SwiftCard tool (consist of SwiftC and SwiftJ and ...). Some good documents here and here.

Community
  • 1
  • 1
Ebrahim Ghasemi
  • 5,850
  • 10
  • 52
  • 113
  • Is Java Card technology still commercially used today? I mean, I am learning this as part of my graduate program. Is this technology still valid? – user366312 May 10 '15 at 06:21
  • 1
    @BROY Oh yes, It is going to be bigger and bigger. New versions of specifications are released recently (the last version is 3.0.4. and 3.0.2 is released in 2009) and new features are introduced (such as HTTP/HTTPS communication and acting as a web-server) for future compatible cards. Don't worry, go deep inside it :) it is useful. New versions (> 3.0) of specifications are divided to CONNECTED Edition and CLASSIC edition. As far as I know the CONNECTED edition compatible cards are not publicly available yet. – Ebrahim Ghasemi May 10 '15 at 06:36
  • 2
    @Broy: All SIM cards are JavaCard or OpenPlattform, I guess this counts as *commercially used* and *valid*. – guidot May 10 '15 at 17:07
  • 1
    Abraham probably means the MULTOS platform by the term "Native Cards". I would add that you can write for MULTOS platform even in Java. However, Abraham is right that writing such an applet is very frustrating (low-level language, almost no documentation, bugs, no community, mysterious unstable IDE...) – vojta May 11 '15 at 07:16
  • 3
    Bear in mind that Java is not the only front end language for the JVM. – Chris Stratton May 11 '15 at 08:10
  • @ChrisStratton Any other front end language for JVM need a converter tool to convert it to JVM byte-codes. Am I right? – Ebrahim Ghasemi May 11 '15 at 08:12
  • Java and C are like old cousins. Java's reputation have been tarnished by the monster that J2EE is. – daparic Oct 16 '19 at 22:47