Skip to content

Define your checks

Checks.kt
package samples
import com.wallet.model.DocTypes
import com.wallet.model.PresentationRequest
import com.wallet.model.PresetAnswer
import com.wallet.model.RequestPreset
/** The checks an operator can pick. A preset is a title, the document, the fields, and how to show the answer. */
object Checks {
private const val EID = "org.iso.23220.1"
private const val EID_PHOTO_ID = "org.iso.23220.photoid.1"
val AGE_18 = RequestPreset(
id = "eid-age-over-18",
section = "Emirates ID", // group in the picker
title = "Age check",
subtitle = "Photo and over 18",
request = PresentationRequest(
docType = DocTypes.PHOTO_ID,
namespaces = mapOf(EID to setOf("portrait", "age_over_18", "issuing_authority")),
),
answer = PresetAnswer.YesNo("age_over_18", "Over 18"), // one big Yes / No
symbol = "18+",
)
val IDENTITY = RequestPreset(
id = "eid-identity",
section = "Emirates ID",
title = "Identity check",
subtitle = "Photo, name, ID number, validity",
request = PresentationRequest(
docType = DocTypes.PHOTO_ID,
namespaces = mapOf(
EID to setOf("portrait", "given_name", "family_name", "birth_date", "expiry_date", "issuing_authority"),
EID_PHOTO_ID to setOf("person_id"),
),
),
answer = PresetAnswer.Details, // photo, name and every field returned
symbol = "ID",
)
val emiratesId = listOf(AGE_18, IDENTITY)
}

Pass presets to the screen in the order you want them; they are grouped by section (RequestPresets.mdl + Checks.emiratesId, as in the Quickstart).

The result lists the fields straight from the preset’s request, with the values the holder shared. It uses the order of your request and the field names from the credential type. The holder’s wallet shows the same list, in the same order, when it asks to share. A field the holder did not share shows “Not provided”. Nothing else is listed.

answer The result screen shows
PresetAnswer.Details every requested field, the photo large enough for a face check
PresetAnswer.YesNo(element, label) one large Yes / No from a boolean field (age_over_21), then every requested field
PresetAnswer.ValidUntil(element, label) one large Valid / Expired from a date field (a medical, a permit), then every requested field

The wallet shows the list to the holder, and a short list is approved more often.

You need to know Ask for
Is this person over 21? portrait, age_over_21
Who is this person? portrait, given_name, family_name, birth_date, and the ID number
Is the licence valid? portrait, document_number, expiry_date, driving_privileges

issuing_authority is not personal data and lets the result say who issued the document.

Document Presets
Driving licence RequestPresets.MDL_AGE_OVER_18, RequestPresets.MDL_DRIVER_CHECK (built in)
Emirates ID age 18+ and identity (the sample above; the demo verifier has the same)
Competition licence valid medical, licence check (in the demo verifier)

Field names per document are in Credentials.

Next: Read the result.