Skip to content

Sample credentials

A wallet with no issuer yet has nothing to show. Sample credentials fill it: a driving licence with a fictional holder, or a card of one of your own document types with values you choose. They are real credentials in every other way: signed, bound to a key in the phone’s secure hardware, presentable in person and to websites. The signature is the SDK’s sample issuer’s, which the demo verifiers and the Verify API accept, so a sample card verifies green against anything in The demos. It is the demo issuer of Trust: your own verifier accepts sample cards once its issuer list includes it, and a production verifier’s list should never.

Three calls on the holder API, sdk.wallet. Each one adds one card and returns its summary; call it once, for example when credentials() is empty.

Call Adds
addSampleMdl() the built-in driving licence: fictional holder, photo, driving privileges
addSampleMdl(SampleMdl(givenName, familyName, birthDate, documentNumber, issuingAuthority, issuingCountry, portrait, values, signature)) the same licence with your holder; anything left null keeps the built-in value. values sets any other org.iso.18013.5.1 element by its ISO name as text (nationality, resident_city, sex, …), applied last; signature is the holder’s signature image (signature_usual_mark)
addSampleCredential(type, values, portrait) a card of one of your own document types (SdkConfig.credentialTypes): values maps element id to value as text; portrait is the holder’s photo as JPEG bytes, stored in the type’s picture element, or null

The complete code, Kotlin and Swift, is step 4 of Build wallet into your existing app.

A holder with a name in their own script, a nationality and an address, and the signature printed on the card. Anything not set keeps the built-in value; the names in national characters are only on the licence when you set them.

sdk.wallet.addSampleMdl(
SampleMdl(
givenName = "Alex", familyName = "Tan", birthDate = "1991-05-13",
documentNumber = "987654321", issuingAuthority = "Roads and Transport Authority",
issuingCountry = "AE", portrait = portrait, // JPEG bytes, or null
values = mapOf(
"given_name_national_character" to "أليكس",
"family_name_national_character" to "تان",
"nationality" to "Singaporean",
"sex" to "1",
"resident_city" to "Dubai",
"resident_country" to "AE",
"un_distinguishing_sign" to "UAE",
),
signature = signature, // PNG or JPEG bytes, or null
),
)
try await sdk.wallet.addSampleMdl(sample: SampleMdl(
givenName: "Alex", familyName: "Tan", birthDate: "1991-05-13",
documentNumber: "987654321", issuingAuthority: "Roads and Transport Authority",
issuingCountry: "AE", portrait: portrait, // KotlinByteArray, or nil
values: [
"given_name_national_character": "أليكس",
"family_name_national_character": "تان",
"nationality": "Singaporean",
"sex": "1",
"resident_city": "Dubai",
"resident_country": "AE",
"un_distinguishing_sign": "UAE",
],
signature: signature)) // KotlinByteArray, or nil

Every value is text. It is stored as the element’s kind in the document type:

Kind Format Example
Text as given Alex
Date YYYY-MM-DD 1991-05-13
DateTime ISO 8601 2026-10-01T09:30:00Z
Number digits 3
Sex the ISO code, as digits 1 (male), 2 (female)
Boolean true or false true
Picture not in values: pass the bytes as portrait

Elements you leave out are left out of the card. In the sample driving licence the age elements (age_over_18, age_over_21, age_in_years, age_birth_year) follow the date of birth, and the names in national characters (given_name_national_character, family_name_national_character) are only there when values sets them.

Error Meaning
PARSE an id the type doesn’t declare, or a value that doesn’t parse as its kind. Nothing is added

Nothing changes in your app’s screens. Credentials then arrive through the wallet’s Scan button or a link, as credential offers, and sit next to the sample cards. Take the sample cards out with removeCredential(id), or empty the wallet with removeAllCredentials() (a sign-out, a demo reset; native 0.8.15); the list updates by itself.