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

EidKit is distributed via GitHub Packages.

settings.gradle.kts — add the Maven repository:

dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/eidkit/eidkit-android")
credentials {
username = providers.gradleProperty("gpr.user").orNull
?: System.getenv("GITHUB_ACTOR")
password = providers.gradleProperty("gpr.token").orNull
?: System.getenv("GITHUB_TOKEN")
}
}
}
}

app/build.gradle.kts:

dependencies {
implementation("ro.eidkit:sdk-android:0.1.0")
}

2. NFC setup

Attach NfcManager to your Activity to receive card tap events:

class MyActivity : 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

Call EidKit.configure() once in Application.onCreate():

class MyApp : Application() {
override fun onCreate() {
super.onCreate()
EidKit.configure(this, EidKitConfig {
licenseToken = BuildConfig.EIDKIT_LICENSE_TOKEN // optional
})
}
}

4. Read a card

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.

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