generateDcRequestMdoc
Utility function to generate a W3C Digital Credentials API request for requesting a single ISO mdoc credential.
The request can expressed for multiple exchange protocols simultaneously, for example OpenID4VP 1.0 and ISO/IEC 18013:2025 Annex C.
The following exchange protocols are supported by this function
org-iso-mdoc
openid4vp
openid4vp-v1-signed
openid4v4-v1-unsigned
This can be used on the server-side to generate the request. The resulting JsonObject can be serialized to a string using Json.encodeToString and sent to the browser or requesting app which can pass it to navigator.credentials.get() or its native Credential Manager implementation.
Return
a JsonObject with the request.
Parameters
a list of W3C Exchange Protocol strings to generate requests for. The order of requests in the resulting JSON will match the order in this list.
the ISO mdoc document type, e.g. "org.iso.18013.5.1.mDL".
the namespaces and data elements to request.
the nonce to use. For OpenID4VP, this will be base64url-encoded without padding. For mdoc-api this will be used as is.
the origin to use.
the client id to use, must be non-null for signed requests.
the key to encrypt the response against or null to not encrypt the response. Note that in some protocols encryption of the response is mandatory and this will throw IllegalArgumentException if this is null for such protocols
an optional key to use for reader authentication and its certificate chain.
if non-empty, request a ZK proof using these systems.