Quickstart
Get EidKit running in a mobile app in minutes.
Requirements
- Android (Kotlin)
- iOS (Swift)
- Android API 26+ (Android 8.0)
- A device with NFC
- A Romanian CEI card for testing
- iOS 15+
- iPhone 7 or later (NFC required)
- A Romanian CEI card for testing
1. Install
- Android (Kotlin)
- iOS (Swift)
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")
}
In Xcode: File → Add Package Dependencies and enter:
https://github.com/eidkit/eidkit-ios
Or add directly to Package.swift:
dependencies: [
.package(url: "https://github.com/eidkit/eidkit-ios", from: "0.1.0"),
],
targets: [
.target(name: "MyApp", dependencies: ["EidKit"]),
]
2. NFC setup
- Android (Kotlin)
- iOS (Swift)
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)
}
}
Add the Near Field Communication Tag Reading capability in Xcode (Target → Signing & Capabilities).
Also add the NFCReaderUsageDescription key to Info.plist:
<key>NFCReaderUsageDescription</key>
<string>EidKit reads your identity card via NFC.</string>
The SDK presents the system NFC sheet automatically at each session — no additional UI setup needed.
3. Configure the SDK
- Android (Kotlin)
- iOS (Swift)
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
})
}
}
Call EidKit.configure() once at app startup:
@main
struct MyApp: App {
init() {
EidKit.configure(EidKitConfig(
licenseToken: "your-token" // optional
))
}
var body: some Scene {
WindowGroup { ContentView() }
}
}
4. Read a card
- Android (Kotlin)
- iOS (Swift)
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
}
}
import EidKit
func readCard() async throws {
let result = try await EidKit.reader(can: userEnteredCan)
.withPersonalData(pin: userEnteredPin)
.withActiveAuth()
.read()
// result.passiveAuth — always present
// result.identity — name, CNP, DOB
// result.personalData — address, document info
// result.claim — proof material for backend verification
}
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.
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
- KYC — read identity data and photos
- Document Signing — sign PDFs with the card
- Active Authentication — verify chip authenticity
- Android API Reference ↗
- iOS API Reference ↗