generateResponse

suspend fun generateResponse(version: OpenID4VP.Version, document: Document?, source: PresentmentSource, showDocumentPicker: suspend (documents: List<Document>) -> Document??, showConsentPrompt: suspend (document: Document, request: Request, trustPoint: TrustPoint?) -> Boolean, origin: String?, request: JsonObject, requesterCertChain: X509CertChain?): JsonObject

Generates an OpenID4VP response.

Return

the generated response according to OpenID4VP Section 8 Response.

Parameters

version

the version of OpenID4VP to generate a response for.

document

the document chosen by the user or null if not using the W3C DC API.

source

an object for application to provide data and policy.

showDocumentPicker

a function which will ask the user to select a document, only used if document is null.

showConsentPrompt

a function to show a consent-prompt to the user.

origin

the origin of the requester or null if not known. This must be set if using the W3C Digital Credentials API.

request

the authorization request object according to OpenID4VP Section 5 Authorization Request.

requesterCertChain

the X.509 certificate chain if the request is signed or null if the request is not signed.