Automatic recognition of Java Card by Android - android

I am trying to develop applet on Java Card that is going to be recognizable for Android. I know there is IsoDep class that allows to communicate with ADPU protocol. However I want it to be recognizable without installing any app on device and without flashing Android system.
With NFC tag using NDEF is quite easy to write into tag that is later automatically recognizable as contact, link etc, without installing any app on device. Is it possible to do the same using contactless Java Card with NDEF or in other way?

The only way to trigger specific actions through NFC on an Android system (e.g. open URL, transfer a contact, etc.) without the need for a custom app is to use NDEF formatted data.
You would therefore need to create an applet on the card that implements the NFC Forum Type 4 Tag Operation specification (you can get the specification from the NFC Forum website). You can then embed an NDEF message into that applet.
You can find an implementation of the NFC Forum Type 4 Tag application in Java Card here: https://github.com/slomo/ndef-javacard (I have not tested this implementation yet, so I cannot comment on how well this implementation works.)

Related

Android HCE with secure element source code example

Hy... I'm trying to find a source code that implementing android HCE with secure element. I have read these two articles right here :
http://developer.android.com/samples/CardEmulation/index.html
http://blog.opendatalab.de/hack/2013/11/07/android-host-card-emulation-with-acr122/
But those just shows an Android HCE without secure element. I have read another blogs too, but none of them shows me the source code example. Just some explanations about Secure elements or else....
Can someone help me with this...?? I need an android source code example with secure element included...And ooowh.. I dont need third party librari, for example from SEEK FOR ANDROID/SIM ALLIANCE or usmile project...
Thanks in adnvace.... :-)
Your question doesn't make sense. You can't have HCE (Host Based Card Emulation) using a secure element. The sole purpose of HCE is, that you don't have to access the secure element.
What you'll probably want is to put a card emulation application into the secure element.
Bad news first: You will very likely not be able to do this because you need to authenticate with the secure element to install any applications. It is highly unlikely that you'll ever get the keys.
Anyway:
To get access to the secure element you have to use a non public API. The relevant files are available in the android source tree at:
<android-sdk-base>frameworks/base/nfc-extras
With a bit of luck you can access the classes provided using java reflection. Once you have access to the classes you'll need an instance of the class NfcExecutionEnvironment. This class provides the function:
byte[] transceive(byte[] in)
This is the communication channel to the secure element. The function expects ISO7816-4 commands, and you can expect it to behave like a JavaCard SmartCard with NFC extensions. Given that you have the keys to authenticate to the SE you should be able to upload and install ordinary JavaCard .cap files directly to the SE.
Using the SEEK API is probably easier and more flexible as it may allow you to install applets to a NFC-SIM card as well.

NFC Card/Tag with RSA/ECC

I'm looking for a type (model) of NFC tag/card that would be capable of communicating with Android device and do the following:
Receive a data message
Sign or encrypt it with a secret key stored on the card
Send the signed/encrypted data back to the device.
In addition, the card should be able to return the open key by a
request
Is there any NXP or other chip capable of doing the task?
The NXP chips J3A041, J3A081, J3D081 etc. will probably fit your requirements. As well as chips from other vendors like AT90SC20818RCFV, SLE77CLFX2400PM, S3CT9KA, SA23YR18, M7794  etc.
Will you develop your own OS for this? Looks more practical to use a solutions like JCOP, CONVEGO Join, JK21 etc. to use Java Card for card side development.
If you would like to concentrate efforts just on Android side - a ready tag like NFCCipher may work for you.
The NXP SmartMX line of chips that sport an asymmetric co-processor should be able to do that. If you want to design your own protocol then a Java Card solution (like JCOP on NXP) should do the trick. Signature generation is generally available on higher end processor models, but there should be plenty choice between those.

Writing data into New NFC Tag not works?

I am Newbie to NFC Android App Development. I am done with the App development and everything worked fine. As part of my testing I used MifareClassic as well MifareDesfire tags to write and read. I am storing data in Ndef format. Initially I used the above testing tags with other apps like Nxp tagwriter and Tagstand Tagwriter and then I used with My app. So everything worked fine. Even later I used my app to write and read data from Sony Felica tags(new tags) which also worked fine. So I passed app to client for review but I came to know that app is not writing on New Tags. If they are reset from other apps then It works fine. So I done the same test here and found the same issue as client reported. What might be the issue? Has someone come across same kind of issue? Is it required to format before using? if so how to do that? Someone Help to solve the issue.
Thanks in Advance.
Some tags are not formatted by the manufacturer, but can be formatted for NDEF storage. Typical examples are MIFARE Classic, Ultralight and DESFire tags, while FeliCa Type 3 Tags will be formatted already by the manufacturer (and cannot be formatted by the user).
Android provides the class NdefFormatable for NDEF formatting. Whenever a tag does not support the Ndef class, but supports the NdefFormatable class, you can try to format the tag by calling the format() method. There is no guarantee this will work, though. In general, completely empty tags, right from the supplier, will give the best results.

NFC Android: Decode an Mifare tag written with NXP NFC Writer

i`m messing around with some nfc tags, I have written plain text to them with the application 'TagWriter' made by the company nxp. Is it possible to make an application that can read this plain text? or is this impossible due certain authorizations keys of the nxp app? or has someone done this before?
any suggestion is appreciated
The complete documentation on how NDEF messages are written to and read from MIFARE CLassic tags is publicly available, see http://www.nxp.com/documents/application_note/AN1304.pdf and http://www.nxp.com/documents/application_note/AN1305.pdf. The first document lists the authentication keys that are used on page 11 and 12. For the MAD sectors for key A the value 0xA0A1A2A3A4A5 is used and the NDEF data sectors use for key A the value 0xD3F7D3F7D3F7.
NFC does not by default need any special NXP authentication. See the StickyNotes app at http://nfc.android.com .
Which MIFARE tag you have used? There is more then one type... Not that here is also "NXP TagInfo" application - it gives you detailed information about the tag.
Also there are pretty good desktop softwares for USB readers.
Please note that the Ultralight C provides authentication based on 3DES, which might be required for specified memory blocks. I have doubts the NFC Writer supports that - this is probably disabled, so the saved text is plain Text RTD NDEF message in TLV.
BR
STeN

Reading writing nfc tags

I have just start reading and writing nfc tags using google nexus one . I have gone through several site like this. They have mostly given for a single string writing. Is that possible to write more data . For example in my case i have to write person id , place and timings .Is there any example like this ? Thanks in advance
You can put whatever information you want - there are no limits for that. The only limitation is a space available on particular tag type which is different for different tag types. For the tag compatibility check the documentation, e.g. Nokia supports all NFC forun tags 1-4 + Mifare classic, while Nexus S might have some limitations here (http://developer.android.com/sdk/android-2.3.3.html).
You are free to use whatever data format you like to save on the NFC tag - but there are certain standards pushed by NFC Forum - just search internet for for NDEF/RTD terms.
The most widely used NFC tag is currently MIFARE Ultralight, but Broadcom BCM20203 NFC Tag might be option as well, but I am not sure if it is distributed or not.
BR
STeN
www.mautilus.com
I have created an Eclipse plugin for creating NDEF types of NFC payloads you might be interested in.
Also see the NDEF Tools for Java project for an Android boilerplate project for detecting, reading and writing NFC tags.

Categories

Resources