SampleMdl

data class SampleMdl(val givenName: String? = null, val familyName: String? = null, val birthDate: String? = null, val documentNumber: String? = null, val issuingAuthority: String? = null, val issuingCountry: String? = null, val portrait: ByteArray? = null, val values: Map<String, String> = emptyMap(), val signature: ByteArray? = null)

The holder of a sample mobile driving licence (see com.wallet.clients.WalletClient.addSampleMdl).

Every field is optional: null keeps the built-in sample value for that ISO 18013-5 data element, so SampleMdl() is a complete licence with a fictional holder, photo and driving privileges. The names in national characters (given_name_national_character, family_name_national_character) have no built-in value: they are only on the licence when values sets them.

Parameters

givenName

the holder's given names (given_name).

familyName

the holder's family name (family_name).

birthDate

date of birth as YYYY-MM-DD (birth_date); the age elements follow it.

documentNumber

the licence number printed on the card (document_number).

issuingAuthority

who issued it, e.g. a licensing authority's name (issuing_authority).

issuingCountry

ISO 3166-1 alpha-2 code, e.g. "SG" (issuing_country).

portrait

the holder's photo as JPEG bytes (portrait).

values

any other org.iso.18013.5.1 element by its ISO name, as text, e.g. "nationality", "resident_city", "sex" ("1" male, "2" female), "given_name_national_character" (the name in the holder's own script, e.g. Arabic). Each is stored as the element's kind, like addSampleCredential values; an unknown element or a value that doesn't parse fails with PARSE. Applied last, so they also override the fields above and the age elements.

signature

the holder's signature image as PNG or JPEG bytes (signature_usual_mark).

Constructors

Link copied to clipboard
constructor(givenName: String?, familyName: String?, birthDate: String?, documentNumber: String?, issuingAuthority: String?, issuingCountry: String?, portrait: ByteArray?)

The holder's main fields only (Swift: SampleMdl(givenName:familyName:birthDate:documentNumber:issuingAuthority:issuingCountry:portrait:)).

constructor(givenName: String? = null, familyName: String? = null, birthDate: String? = null, documentNumber: String? = null, issuingAuthority: String? = null, issuingCountry: String? = null, portrait: ByteArray? = null, values: Map<String, String> = emptyMap(), signature: ByteArray? = null)

Properties

Link copied to clipboard
val birthDate: String? = null
Link copied to clipboard
val documentNumber: String? = null
Link copied to clipboard
val familyName: String? = null
Link copied to clipboard
val givenName: String? = null
Link copied to clipboard
Link copied to clipboard
val issuingCountry: String? = null
Link copied to clipboard
val portrait: ByteArray? = null
Link copied to clipboard
val signature: ByteArray? = null
Link copied to clipboard