Skip to main content

Quickstart

Get EidKit running in a mobile app in minutes.

Requirements

  • Android API 26+ (Android 8.0)
  • A device with NFC
  • A Romanian CEI card for testing

1. Install

// app/build.gradle.kts
dependencies {
implementation("ro.eidkit:sdk-android:0.1.7")
}

2. NFC setup

Add the NFC permission, intent filter, and tech filter to AndroidManifest.xml:

<!-- AndroidManifest.xml -->
<uses-permission android:name="android.permission.NFC" />

<application ...>
<activity
android:name=".MainActivity"
android:launchMode="singleTop"> <!-- required for onNewIntent -->

<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
</intent-filter>
<meta-data
android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="@xml/nfc_tech_filter" />
</activity>
</application>

Create res/xml/nfc_tech_filter.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<tech-list>
<tech>android.nfc.tech.IsoDep</tech>
</tech-list>
</resources>

Attach NfcManager to your Activity to receive card tap events:

class MainActivity : ComponentActivity() {
private val nfcManager = EidKit.nfcManager()

override fun onResume() {
super.onResume()
nfcManager.enableForegroundDispatch(this)
}

override fun onPause() {
super.onPause()
nfcManager.disableForegroundDispatch(this)
}
}

3. Configure the SDK

Create an Application class and register it in the manifest:

class MyApp : Application() {
override fun onCreate() {
super.onCreate()
EidKit.configure(this, EidKitConfig {})
}
}
<!-- AndroidManifest.xml -->
<application android:name=".MyApp" ...>
Demo mode

The SDK runs in demo mode by default — data read from the card is automatically masked. Ideal for development and testing without exposing real personal data. A licenseToken is reserved for future licensing enforcement — you can configure it early and your integration will not need to change.

4. Read a card

onNewIntent is called when an NFC card is detected. Requires android:launchMode="singleTop" on the Activity (configured in step 2).

override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
val isoDep = nfcManager.handleIntent(intent) ?: return

lifecycleScope.launch {
val result = EidKit.reader(can = userEnteredCan)
.withPersonalData(pin = userEnteredPin)
.withActiveAuth()
.read(isoDep)

// result.passiveAuth — always present
// result.identity — name, CNP, DOB
// result.personalData — address, document info
// result.claim — proof material for backend verification
}
}
CAN

The CAN is the 6-digit number printed on the front of the card. The user must enter it in your app UI — never hardcode or store it.

Location of the CAN code on the Electronic Identity Card

PIN attempts

The Romanian CEI allows only 3 incorrect PIN attempts before the PIN is blocked. A blocked PIN requires an in-person visit to an MAI service point to unblock. Always let the user enter their PIN themselves.

Next steps