Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

Mobile driving licenses and mdoc

At a shop counter, Riley proves they are over 21 with the driving license on their phone, without showing their birth date. This lesson explains the mdoc format behind mobile driving licenses, the two separate checks a reader makes, what an offline reader cannot know, and why a convincing picture of a license is not evidence.

A document format with a presentation protocol

The Northwind project launch is on Friday, and Riley stops at a wine shop on the way. At the counter, the cashier asks for ID. Riley's driving license is on their phone, and the shop has a small reader beside the register. They hold their phone near it, their wallet asks whether to share one fact, that they are over 21, and they approve. The reader shows a green check mark.

The cashier could have looked at a picture of a license on Riley's screen, but a picture proves nothing. Anyone can edit a screenshot, and an animation that looks live can be recorded. What the reader needs is data signed by the authority that issued the license, together with proof that the phone in front of it is taking part in this exchange now.

A mobile driving license (mDL) provides both. Most mDLs follow the international standard ISO/IEC 18013-5, which defines a document format called mdoc and the protocol for presenting it in person. An mdoc is not a JWT with a different label. It is encoded in CBOR, a compact binary cousin of JSON, and protected with COSE, the CBOR counterpart of the JOSE signatures used by JWTs. Its contents are organized by document type, namespace and data element, so the same name always means the same thing: age_over_21 in the mDL namespace is a defined element, not a label a reader has to interpret. What actually crosses from the phone to the reader is a DeviceResponse, a CBOR structure holding the issuer-signed elements and the device's own proof; the decoded record below is one document from inside it.

Document type:  org.iso.18013.5.1.mDL
Namespace:      org.iso.18013.5.1

Issuer-signed data elements (each stored with a digest ID and a random value)
  0  given_name        "Riley"
  1  birth_date        1996-03-14
  2  document_number   "D0482-1196"
  3  portrait          (image)
  4  age_over_18       true
  5  age_over_21       true

Mobile Security Object (MSO)
  digestAlgorithm:  SHA-256
  valueDigests:     org.iso.18013.5.1 -> { 0: <SHA-256 of element 0>, ... 5: <SHA-256 of element 5> }
  deviceKeyInfo:    public key of a key pair generated and kept on Riley's phone
  docType:          org.iso.18013.5.1.mDL
  validityInfo:     signed 2026-10-01, validFrom 2026-10-01, validUntil 2026-12-30

MSO signature:      COSE_Sign1 by the issuing authority's document signer certificate

The Mobile Security Object (MSO) is the part the issuing authority signs. It does not contain Riley's data. It contains a digest of each data element, a validity period, and the public half of a key that lives on Riley's phone. Each element is stored with a random value before it is hashed, which will be familiar from Selective disclosure with SD-JWT: the phone can send any subset of elements, the reader can check each one it receives against the signed digests, and the digests of the rest reveal nothing.

That is how Riley shared only one fact. The issuing authority computed age_over_18 and age_over_21 when it issued the license, so the reader could ask for the threshold the shop needs and never see the birth date, the document number or the address. A reader can only ask for thresholds the issuer chose to include, and a shop that also needed to compare the person at the counter with the license holder would ask for the portrait as well: a second element, with its own purpose.

Check issuer data and device presentation separately

The reader makes two checks that answer different questions, and passing one never stands in for the other.

Issuer data authentication asks whether the license data is genuine and unchanged. The MSO arrives with the issuing authority's document signer certificate, which the reader validates up to the issuing authority's root certificate, as Validating a certificate describes. That root must already be in the reader's list of trusted issuing authorities; a certificate chain that arrives in the response cannot add a new authority to the list. The reader then checks the MSO signature and its validity period, hashes the age_over_21 element it received, and compares the result with digest 5.

All of that could be satisfied by a recording. If someone captured the data Riley's phone sent at a different counter last week, the issuer data would still be genuine. Device authentication asks the second question: is the phone holding this license taking part in this exchange? When the phone and reader connect, the phone shares its engagement data, the DeviceEngagement, by QR code or NFC, and the reader generates a fresh key for the session. Those values and the details of the handover make up the session transcript, which both sides compute and which is different every time. The phone then proves it holds the device key whose public half is in the MSO, either by signing the transcript with it or by computing a message authentication code (MAC) over the transcript with a key derived from the device key and the reader's session key.

Illustrative checks the shop's reader makes on Riley's presentation
AspectIssuer data authenticationDevice authentication
QuestionIs this the data the issuing authority signed?Is the phone holding the license taking part in this session?
CoversThe MSO, and through its digests each released elementThe current session transcript and the document type
KeyThe document signer certificate, trusted through the issuing authority's rootThe device key whose public half is in the MSO
Fails whenThe authority is not trusted, an element was changed, or the MSO has expiredThe proof is missing, made with another key, or made for another session transcript

Now suppose a reader passes the issuer check and skips the device check when the proof does not match. A response recorded at another counter, with a device proof made for that session's transcript, would sail through: genuine data, a genuine device signature, and the wrong session. The reader computes its own transcript for the current session and refuses any device proof made over a different one.

The two checks together still leave questions open. They show that a genuine license was presented from the phone it was issued to. They do not show that the shop is allowed to rely on an mDL for an alcohol sale, which depends on the law where the shop is, and they do not make the reader trustworthy with what it receives. Releasing one element limits what the shop learns; what the shop then keeps is up to the shop.

Offline presentation has explicit limits

The reader at the wine shop never contacted the issuing authority. The phone and reader found each other by NFC, the short-range radio phones use for tap-to-pay, exchanged data over a short-range connection, and the reader checked everything with what it already had. That works in a basement shop with no signal, and it means the issuing authority does not learn where Riley showed their license. It also means the reader knows only what it knew before Riley walked in.

Illustrative view of what the offline reader can establish
QuestionWhat the reader hasWhat it cannot know offline
Which issuing authorities to trustThe trust list from its last update, three days agoAn authority removed from the list since then
Whether the license data is currentThe MSO's validity period, ending 2026-12-30A suspension decided after the MSO was signed
Whether this phone is presenting nowThe session transcript and device proofNothing missing: this check works fully offline

Issuing authorities narrow the gap by signing MSOs for weeks or months rather than for the license's whole life, and by having the wallet fetch a fresh MSO when it has a connection. A license suspended today can then be presented offline only until its current MSO expires. The reader needs its own policy for the rest: how old its trust list may be, and what to do when the MSO is close to expiry or the reader has been offline too long. When a check could not be made, the reader should say so rather than show the same green check mark. The cashier can then ask for another form of ID.

Trust also runs the other way. The reader can authenticate itself to the wallet with a reader certificate, so Riley's wallet can show which organization is asking before they approve. A wallet that cannot identify the reader can still show exactly which elements are requested.

The same mdoc can also be presented online, to a website rather than a shop counter, and a separate standard governs that case: ISO/IEC 18013-7, which profiles online mDL presentation. It builds on the OpenID4VP flow from Presenting from a wallet, carrying the mdoc with the format identifier mso_mdoc in place of the SD-JWT format, and it also profiles the browser's Digital Credentials API, through which a web page asks the operating system for a credential and the wallet answers. That browser-mediated path changes the session binding: the reader's identity the device proof covers is the requesting web origin, which is what makes the request hard to relay to a different site. The format, the standard and the transport are separate choices, and a reader or wallet that supports one combination does not necessarily support another.

Inspect real evidence, not a convincing picture

The green check mark at the wine shop means something only because the reader checked evidence it could verify. A screenshot of a license, however convincing, contains no signature the reader can check and no proof tied to this session. The decoded record above is no better as evidence: it shows the structure, but no CBOR was parsed and no COSE signature was verified to produce it.

When the evidence is wrong, the reader should say how. A license from an authority missing from its trust list, an element changed after signing, an MSO past its validUntil date and a device signature made for another session transcript are four different refusals, and a cashier who sees which one it was knows whether to ask for a plastic card or to stop the sale. Whether the shop may lawfully accept a phone's answer at all is a separate question for the jurisdiction, and no cryptographic check settles it.

Check your understanding

Try these questions before moving on. If an answer isn't right, use the feedback and try again.

The shop's reader finds the issuer signature and element digests valid, but the device proof was made over a different session transcript. What should the reader do? 1 of 3

Choose one answer.

The reader is offline. Riley's MSO is valid until 30 December and the reader's trust list is three days old. What can the reader not know? 2 of 3

Choose one answer.

Someone shows the cashier a sharp screenshot of Riley's license with the age_over_21 field reading true. What can the reader conclude from it? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity