RemotePresentation

class RemotePresentation(wallet: WalletHandle, context: Context, apiClient: VpApiClient)

High–level helper for handling remote OpenID4VP presentations using the EUDI wallet.

This class takes care of the entire remote presentation flow:

  1. Parse and resolve an OpenID4VP request from a scanned QR code.

  2. Extract the PresentationDefinition and requested claims.

  3. Match requested claims against credentials stored in the wallet.

  4. Ask the user for consent (askConsent) for the exact attributes that will be shared.

  5. Trigger device / biometric authentication (authenticate) using a BiometricPrompt.CryptoObject.

  6. Build an SD-JWT based VerifiablePresentation.

  7. Dispatch the VP back to the verifier and report success or failure.

Design goals:

Typical usage:

val walletHandle = WalletSdk.createWallet(context, options)
val remotePresentation = RemotePresentation(walletHandle, context)

remotePresentation.handle(
qrCodeData = scannedQrString,
askConsent = { consentPrompt ->
// Show your own dialog / screen using consentPrompt
// Return true if user approves, false otherwise
},
authenticate = { cryptoObject, onAuthenticated ->
// Wrap BiometricPrompt usage and call onAuthenticated(cryptoObject) on success
// Return true if auth finished successfully, false if cancelled/failed
},
onSuccess = {
// Called when the verifier accepts the authorization response
}
)

Parameters

context

Android Context, used for localization and string resources.

apiClient

VpApiClient, used for handling calls for localized consent text.

Constructors

Link copied to clipboard
constructor(wallet: WalletHandle, context: Context, apiClient: VpApiClient)

Properties

Link copied to clipboard

DID resolver used to obtain EC P-256 public keys for DID-based client IDs.

Link copied to clipboard
val tag: String

Log tag for this component.

Link copied to clipboard
val walletConfig: SiopOpenId4VPConfig

SIOP + OpenID4VP configuration used when resolving and responding to presentation requests.

Functions

Link copied to clipboard
suspend fun handle(qrCodeData: String, askConsent: suspend (ConsentPromptData) -> Boolean, authenticate: suspend (cryptoObject: BiometricPrompt.CryptoObject, onAuthenticated: suspend (BiometricPrompt.CryptoObject) -> Unit) -> Boolean, onSuccess: () -> Unit)

Main entry point for handling a remote OpenID4VP presentation from a QR code.