External secure element¶
Various kind of secure elements can be found on Famoco devices :
Secure Element name | Purpose |
---|---|
SIM1 | First SIM usually used for telephony |
SIM2 | Second SIM usually used for telephony |
eSE1 | Embedded Secure Element |
SAMTerminal1 | External Secure Element (Device with TDA8029) |
AT901 | External Secure Element (Device with one AT90) |
AT902 | External Secure Element (Device with two AT90) |
The SmartCard API is a reference implementation of the SIMalliance Open Mobile API specification that enables Android applications to communicate with secure elements, e.g. SIM card, embedded secure elements, Mobile Security Card or others.
The interface of the library is kept platform independent whereas the SmartcardService implementation is Android-specific.
The SmartCard API provides features to list and select the supported secure elements, open a communication channel to a dedicated secure element application and transfer APDUs to such. No applet selection or channel management APDU functions are allowed as this might cause security problems. Also, no card on/off functions are available in contrast to PC/SC.
Even if the information is a bit outdated, you can find additionnal details on this website.
Prerequisites¶
- A device supporting external secure element, either on SAM or SIM lot, or both.
- Android Studio development IDE
- Basic understanding of the Android development platform.
- Basic knowledge of smart card communication
How to use it¶
Android 10+¶
The OPEN Mobile API is natively integrated in Android since Android 9 so you just have to use the official APIs documented here.
Android 8.1 and below¶
org.simalliance.openmobileapi.jar has to be integrated in your app.
Setting up the Environment¶
The Android Studio development environment needs to be configured in order to use the official SDK from Google as described in the Google documentation.
Steps to create a new Project¶
- Use the AndroidStudio wizard to created a new basic app:
File > new > newProject
- Copy the
org.simalliance.openmobileapi
library into the libs folder of your project - Ensure your build.gradle file contains the following dependency
dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') }
- Add the following permission in your AndroidManifest file
<uses-permission android:name="org.simalliance.openmobileapi.SMARTCARD" />
- Declare the following library dependency in your AndroidManifest file
<uses-library android:name="org.simalliance.openmobileapi" android:required="true"/>
Javadoc¶
The SmartcardAPI documentation can be found here