This discussion is archived
1 2 Previous Next 17 Replies Latest reply: Mar 12, 2012 6:21 AM by 801926 RSS

NFC for Java Card

867670 Newbie
Currently Being Moderated
Hi guys

I'm a new one with NFC, especially for the field that I'm investigating right now, Java Cards. Hence, would you mind to help me with the initialization? I mean what am I supposed to begin with (name of documents, materials,...)?

Any of your help would be appreciated.

Thanks in advance

Jason
  • 1. Re: NFC for Java Card
    Umer Journeyer
    Currently Being Moderated
    Jason Gosling wrote:
    Hi guys

    I'm a new one with NFC, especially for the field that I'm investigating right now, Java Cards. Hence, would you mind to help me with the initialization? I mean what am I supposed to begin with (name of documents, materials,...)?
    I myself have nott work with NFC yet. But there is a document from GP for contactless cards in which you might find something useful. And also GP API for contactless is also available.

    Regards
  • 2. Re: NFC for Java Card
    Adriaan Explorer
    Currently Being Moderated
    Hi,

    Here are sources for NFC background:
    http://www.nfc-world.com/en/about/index.html
    http://www.wima-nfc.com/pics/Image/Pele.pdf
    http://www.developer.nokia.com/Community/Blogs/resources/300066/Philips-NFC-vs-ISO14443-vs-Felica-SLIDES.pdf

    For Java Card, search this forum - there are several related threads.

    Adriaan
  • 3. Re: NFC for Java Card
    867670 Newbie
    Currently Being Moderated
    Dear Umer and Adriaan

    First and foremost, thank you so much for your help.

    I went to Global Platform site, and I found a kind of useful material. It is the API specification for NFC integrated Java Card. The downloaded package also contains class files of those API. However, is there any place that I can find the architecture or the model of NFC integrated Java Card? I really want to know the way they construct those API

    Thanks Adriaan for your useful links. I check all of them. Nevertheless, they are all about the NFC background while I'm more interested in NFC integrated Java Card. But definitely, they are truly useful for me.

    Also, I concern about if there is a GSM standard for NFC integrated Java Card or NFC technology in general. Does anybody know it?

    Regards,

    Jason
  • 4. Re: NFC for Java Card
    Umer Journeyer
    Currently Being Moderated
    Below link is not exactly the same as you are looking for but it will help you getting the overall idea:
    http://java.sun.com/developer/technicalArticles/javame/nfc/
    Also for GSM:
    http://developer.gemalto.com/home/technology/nfc/nfc-applet-development/nfc-java-card-contactless-applets.html
  • 5. Re: NFC for Java Card
    Adriaan Explorer
    Currently Being Moderated
    Jason,

    I'm not sure what you mean by NFC integrated Java Card. Could you give me the name of the document you downloaded from Global Platform?

    Java Card knows about the transport type between itself and the reader: contact (T=0, T=1 : ISO/IEC 7816) or contactless (T=CL : ISO/IEC 14443). But that is all; a Java Card applet should not know or care about the lower transport layers.

    As for the relationship between GSM, UICC and NFC, have a look at the document "NFC Stepping Stones" from SIMAlliance: http://www.simalliance.org/en?t=/documentManager/sfdoc.file.supply&fileID=1308660607647

    EDIT:
    For more on STK applets (GSM), read the Gemalto introduction to the SIM Toolkit: http://developer.gemalto.com/home/technology/sim-toolkit.html
    The best standard for you to start with is probably 3GPP 43.019.

    As reference, here is a partial list of (I hope) relevant standards. If you find more, please post them here!

    ISO/IEC:
    ISO/IEC 7816-1
    ISO/IEC 7816-2
    ISO/IEC 7816-3 (T=0)
    ISO/IEC 7816-4 (Limited to command set required for GSM compliance.)

    Java Card:
    Runtime Environment Specification Java Card Platform, Version 2.2.1 V2.2.1
    Virtual Machine Specification Java Card Platform, Version 2.2.1 V2.2.1
    Application Programming Interface Java Card Platform, Version 2.2.1 V2.2.1

    Global Platform:
    Global Platform Card Specification 2.1.1 V2.1.1

    GSM:
    GSM 11.11 version 8.3.0
    GSM 11.12 version 4.3.1
    GSM 11.14 version 8.3.0
    GSM 11.17 version 7.0.2
    GSM 11.18 version 7.0.1
    GSM Comp128-1, 2, 3

    SIM:
    TS 23.040 V.6 Technical realization of the Short Message Service (SMS)
    TS 43.019 V.6 Subscriber Identity Module Application Programming Interface (SIM API) for Java Card; Stage 2
    TS 51.011 V.5 Specification of the Subscriber Identity Module - Mobile Equipment (SIM-ME) interface
    TS 51.014 V.4 Specification of the SIM Application Toolkit for the Subscriber Identity Module - Mobile Equipment (SIM - ME) interface

    USIM:
    TS 31.102 V.6 Characteristics of the Universal Subscriber Identity Module (USIM) application
    TS 31.111 V.6 Universal Subscriber Identity Module (USIM) Application Toolkit (USAT)
    TS 31.115 V.6 Secured packet structure for (Universal) Subscriber Identity Module (U)SIM Toolkit applications
    TS 31.116 V.6 Remote APDU Structure for (Universal) Subscriber Identity Module (U)SIM Toolkit applications
    TS 31.124 V.6 Mobile Equipment (ME) conformance test specification; Universal Subscriber Identity Module Application Toolkit (USAT) conformance test specification

    TS 31.900 V.6 SIM/USIM internal and external interworking aspects
    TR 31.919 V.6 2G/3G Java Card™ Application Programming Interface (API) based applet interworking
    ETSI TS 135.208 Technical Specification Universal Mobile Telecommunications System (UMTS); 3G Security; Specification of the MILENAGE algorithm set

    UICC:
    TS 31.101 V.6 UICC-terminal interface; Physical and logical characteristics
    TS 31.121 V.6 UICC-terminal interface; Universal Subscriber Identity Module (USIM) application test specification
    ETSI TS 102.220 ETSI numbering system for telecommunication application providers
    ETSI TS 102.221 Smart cards; UICC-Terminal interface; Physical and logical characteristics
    ETSI TS 102.222 IC Cards Admin Commands for Telecom
    ETSI TS 102.223 Card Application Toolkit
    ETSI TS 102 241 "Technical Specification Smart Cards; UICC Application Programming Interface (UICC API) for Java Card"

    OTA:
    ETSI TS 102.224 Security mechanisms for UICC based Applications -Functional requirements
    ETSI TS 102.225 Secured packet structure for UICC based applications
    ETSI TS 102.226 Remote APDU structure for UICC based applications
    TS 23.040 V.6 Technical realization of the Short Message Service (SMS) Point-to-Point (PP)
    TS 23.041 V.6 Technical realization of Cell Broadcast Service (CBS)

    (U)SAT:
    TS 23.048 V.5 Security Mechanisms for the (U)SIM application toolkit
    TS 31.111 V.6 Specification of the USIM Application Toolkit
    TS 31.112 V.6 Universal Subscriber Identity Module Application Toolkit (USAT) interpreter architecture description
    TS 31.113 V.6 Universal Subscriber Identity Module Application Toolkit (USAT) interpreter byte codes
    TS 31.114 V.6 Universal Subscriber Identity Module Application Toolkit (USAT) interpreter protocol and administration
    TS 51.014 V.4 Specification of the SIM Application Toolkit for the Subscriber Identity Module - Mobile Equipment (SIM-ME) interface
    ETSI TS 102 223 Card Application Toolkit (CAT)

    SIM Alliance:
    S@T 01.00 Specification 2009 SIMalliance S@T Byte Code
    S@T 01.10 Specification 2009 SIMalliance S@T Markup Language
    S@T 01.20 Specification 2009 SIMalliance S@T Session Protocol
    S@T 01.21 Specification 2009 SIMalliance S@T Administrative Commands
    S@T 01.22 Specification 2009 SIMalliance S@T Operational Commands
    S@T 01.23 Specification 2009 SIMalliance S@T Push Commands
    S@T 01.30 Specification 2007 SIMalliance S@T Validation Test Plan System Functional Tests
    S@T 01.50 Specification 2009 SIMalliance S@T Browser Behaviour Guidelines
    S@T 01.60 Gateway Implement 2009 SIMalliance S@T Gateway Implement

    Security & Algorithm
    TS 33.102 V.6 3G security; Security architecture
    TS 33.105 V.6 Cryptographic algorithm requirements
    TS 35.205 V.6 3G Security; Specification of the MILENAGE algorithm set: An example algorithm set for the 3GPP authentication and key generation functions f1, f1*, f2, f3, f4, f5 and f5*; Document 1: General
    TS 35.206 V.6 3G Security; Specification of the MILENAGE algorithm set: An example algorithm set for the 3GPP authentication and key generation functions f1, f1*, f2, f3, f4, f5 and f5*; Document 2: Algorithm specification
    TS 55.205 V.6 Specification of the GSM-MILENAGE algorithms: An example algorithm set for the GSM Authentication and Key Generation Functions A3 and A8

    Test specification
    TS 31.048 V.5 Security mechanisms for the (U)SIM application toolkit; Test specification
    TS 31.120 V.6 UICC-terminal interface; Physical, electrical and logical test specification
    TS 31.121 V.6 UICC-terminal interface; Universal Subscriber Identity Module (USIM) application test specification
    TS 31.122 V.6 Universal Subscriber Identity Module (USIM) conformance test specification
    TS 31.130 V.6 (U)SIM Application Programming Interface (API); (U)SIM API for Java Card
    TS 31.213 V.6 Test specification for subscriber (U)SIM; Application Programming Interface (API) for Java Card™
    TS 35.203 V.6 Specification of the 3GPP confidentiality and integrity algorithms; Document 3: Implementors' test data
    TS 35.207 V.6 3G Security; Specification of the MILENAGE algorithm set: An example algorithm set for the 3GPP authentication and key generation functions f1, f1*, f2, f3, f4, f5 and f5*; Document 3: Implementors’ test data
    TS 35.208 V.6 3G Security; Specification of the MILENAGE algorithm set: An example algorithm set for the 3GPP authentication and key generation functions f1, f1*, f2, f3, f4, f5 and f5*; Document 4: Design conformance test data
    TR 35.909 V.6 3G Security; Specification of the MILENAGE algorithm set: an example algorithm set for the 3GPP authentication and key generation functions f1, f1*, f2, f3, f4, f5 and f5*; Document 5: Summary and results of design and evaluation
    TS 51.013 V.5 Test specification for Subscriber Identity Module (SIM) Application Programming Interface (API) for Java Card
    TS 51.017 V.4 Subscriber Identity Module (SIM) test specification

    Adriaan

    Edited by: Adriaan on Feb 14, 2012 1:34 AM
  • 6. Re: NFC for Java Card
    867670 Newbie
    Currently Being Moderated
    Umer wrote:
    Also for GSM:
    http://developer.gemalto.com/home/technology/nfc/nfc-applet-development/nfc-java-card-contactless-applets.html
    This is not GSM standard for NFC, Umer. This is Gemalto's introduction of NFC technology for Java Cards. But anyway, thanks for your support. I can see the modelling in the first link
  • 7. Re: NFC for Java Card
    867670 Newbie
    Currently Being Moderated
    Thanks Adriaan

    Because I don't know whether a GSM standard for NFC integrated Java Cards may exist or not, then I ask the question above. You listed a lot of standards but they are only used for SIM, not for NFC. Anyway, thanks for your help

    About the material that I downloaded from Global Platform site, it is GP Card API for contactless. I have just overlooked at it and it is about API that we need to develop an applet which can be used in NFC transaction. The name of that GP API package is +"org.globalplatform.contactless"+ You can download it from here
    http://www.globalplatform.org/specificationdownload.asp?id=7516
    Furthermore, from Oracle's Java Cards site, I presumably know that there are five fundamental packages (API) which can be used to develop contactless-based applets. They are
    javax.microedition.contactless 
    javax.microedition.contactless.ndef
    javax.microedition.contactless.rf
    javax.microedition.contactless.sc
    javax.microedition.contactless.visual
    This is from the site
    http://java.sun.com/developer/technicalArticles/javame/nfc/
    Fortunately, I found another site which provides the whole specifications of those 5 packages
    http://library.developer.nokia.com/index.jsp?topic=/Java_Developers_Library/GUID-1580EF38-3A61-4C80-B818-4957861EEABF/javax/microedition/contactless/package-summary.html
    Now what I am confused is which package is necessary to develop contactless-based applets. Having both from java sun site and GP site, I see the incompatibility here. Perhaps, I need to read those materials thoroughly. You know, I now just have an overlook :)

    Jason

    Edited by: Jason Gosling on Feb 14, 2012 5:46 PM
  • 8. Re: NFC for Java Card
    Umer Journeyer
    Currently Being Moderated
    Hi,

    It is good that you get basic stuff (APIs etc) for development. Please keep sharing your knowledge...

    Regards
    Umer
  • 9. Re: NFC for Java Card
    Adriaan Explorer
    Currently Being Moderated
    Jason,

    Thanks for the info.
    Jason Gosling wrote:
    Furthermore, from Oracle's Java Cards site, I presumably know that there are five fundamental packages (API) which can be used to develop contactless-based applets. They are
    javax.microedition.contactless 
    javax.microedition.contactless.ndef
    javax.microedition.contactless.rf
    javax.microedition.contactless.sc
    javax.microedition.contactless.visual
    Those packages are for the mobile reader device only - they are not used in the applets. I think the phrase you are looking for is not "NFC enabled Java Card" but rather "mobile NFC" :)

    Note that these packages will only work on JME or other JSR-257 compliant devices. The most prominent JSR-257 device - Nokia 3220, 6131 and 6212 - have been discontinued and only the Nokia C7 and a few other devices support it right now. I am not convinced that JSR-257 is the way to go because (in my opinion) it's too strongly tied to the Symbian OS.

    Device NFC APIs and other info here:
    http://www.nfc.cc/nfc-phones/

    It may be easier from a development perspective to get an Android smartphone and combine it with a microSD NFC controller+secure element (for example, DeviceFidelity). Unfortunately the Android NFC API is not complete yet - for example, the Google Samsung Nexus S has full hardware NFC capability (reader, peer-to-peer, embedded secure element, SWP to UICC secure element) but only the API for reader and peer-to-peer modes is available right now.

    However, I am confident that the Android NFC API will grow more mature and complete in the near future, and regardless of whether 3d party drivers are needed for the NFC controller, it is the best (convenient and future-proof) way to implement mobile NFC apps.

    Android NFC info:
    http://developer.android.com/reference/android/nfc/package-summary.html
    http://developer.android.com/resources/samples/NFCDemo/index.html
    http://developer.android.com/sdk/android-2.3.3.html

    Jason Gosling wrote:
    Now what I am confused is which package is necessary to develop contactless-based applets. Having both from java sun site and GP site, I see the incompatibility here. Perhaps, I need to read those materials thoroughly. You know, I now just have an overlook :)
    Yes indeed, reading standards is a boring way to pass time but unfortunately unavoidable.

    Adriaan
  • 10. Re: NFC for Java Card
    Umer Journeyer
    Currently Being Moderated
    Really rare information you have shared Adriaan. Thanks.
    Well, it is off the topic but I want to know is that really NFC has as much use cases as contact based chips ? Because I could not see the use case of NFC cards except in access control and POS application.
  • 11. Re: NFC for Java Card
    867670 Newbie
    Currently Being Moderated
    Personally I think the number of realistically operable use cases in both fields (contact and contactless) is tremendous and it's difficult to make comparison. However, according to my knowledge so far, NFC can be implemented in those following fields:

    1. Reader/Writer case: information access, content distribution, smart advertising,...
    2. Peer-to-peer communication: data transfer, conference,...
    3. Card Emulation: Mobile payment, ticketing, access control,...

    Hope it helps,

    Jason
  • 12. Re: NFC for Java Card
    safarmer Expert
    Currently Being Moderated
    Hi,

    It may be worth noting (not sure if I missed these points being mentioned already).

    NFC is the way in which a device (a phone or key fob) allows you to communicate with another device. There are several NFC communication standards. NFC forum defines different tag types such as MiFARE tags, Felica cards for payment in Japan, card emulation in a handset that has an embedded secure element (SE) or a UICC connected to the antena with a connection such as SWP.

    A phone handset can communicate with an SE (either embedded o SIM) over a contact interface. If the SE is a SIM then this will be through the baseband of the phone as the modem is also accessing the SIM. There are different physical wiring paths for each of these but once you have access to the SE you simply sed ISO7816-4 APDU's. This is either directly through the NFC controller of possibly through AT commands to the baseband. This can vary quite a lot but is the underlying implementations issue and you may not have to deal with this.

    When you have the NFC controller running in card emulation mode you can communicate with the SE over ISO14443 with a contactless reader. In this case it is no different to a contactless smart card.

    For the code running on your smartcard in an NFC environment, it is not actually aware that this is the case. The ISO7816-4 APDU command interface isolates the java card enough that your applet code should be the same regardless of where it executes.

    Cheers,
    Shane
  • 13. Re: NFC for Java Card
    801926 Explorer
    Currently Being Moderated
    safarmer wrote:
    .. TNFC forum defines different tag types such as MiFARE tags, Felica cards for payment in Japan, card emulation in a handset that has an embedded secure element (SE) or a UICC connected to the antena with a connection such as SWP.
    Actually NFC Forum does not reference proprietary technologies such as MIFARE. That's the reason MIFARE Classic is not a standard tag (1-4).
  • 14. Re: NFC for Java Card
    safarmer Expert
    Currently Being Moderated
    That comment was based on the following:
    NFC Forum Type 1 Tag Operation Specification
    Type 1 Tag is based on ISO/IEC 14443A. Tags are read and re-write capable; users can configure the tag to become read-only. Memory availability is 96 bytes and expandable to 2 kbyte.

    NFC Forum Type 2 Tag Operation Specification
    Type 2 Tag is based on ISO/IEC 14443A. Tags are read and re-write capable; users can configure the tag to become read-only. Memory availability is 48 bytes and expandable to 2 kbyte.

    NFC Forum Type 3 Tag Operation Specification
    Type 3 Tag is based on the Japanese Industrial Standard (JIS) X 6319-4, also known as FeliCa. Tags are pre-configured at manufacture to be either read and re-writable, or read-only. Memory availability is variable, theoretical memory limit is 1MByte per service.

    NFC Forum Type 4 Tag Operation Specification 2.0 (November 2010)
    Type 4 Tag is fully compatible with the ISO/IEC 14443 standard series. Tags are pre-configured at manufacture to be either read and re-writable, or read-only. The memory availability is variable, up to 32 KBytes per service; the communication interface is either Type A or Type B compliant.
    I assumed MIFARE was covered by these. I guess MIFARE just uses the same communication channel over 14443?

    Cheers,
    Shane
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points