DcApiHolder

class DcApiHolder @JvmOverloads constructor(keyMaterial: KeyMaterial = EphemeralKeyWithoutCert(), holder: Holder = HolderAgent(keyMaterial), openId4VpHolder: OpenId4VpHolder = OpenId4VpHolder(holder = holder), iso180137AnnexCHolder: Iso180137AnnexCHolder = Iso180137AnnexCHolder( keyMaterial = keyMaterial, holder = holder, ), relyingPartyValidator: RelyingPartyValidator = RelyingPartyValidator())(source)

Handles requests received through the W3C Digital Credentials API, similar to DcApiVerifier on the relying party side.

The browser API may transport OpenID4VP or ISO/IEC 18013-7 Annex C requests. This class provides one wallet-facing entry point and delegates the protocol-specific work to OpenId4VpHolder or Iso180137AnnexCHolder.

Constructors

Link copied to clipboard
constructor(keyMaterial: KeyMaterial = EphemeralKeyWithoutCert(), holder: Holder = HolderAgent(keyMaterial), openId4VpHolder: OpenId4VpHolder = OpenId4VpHolder(holder = holder), iso180137AnnexCHolder: Iso180137AnnexCHolder = Iso180137AnnexCHolder( keyMaterial = keyMaterial, holder = holder, ), relyingPartyValidator: RelyingPartyValidator = RelyingPartyValidator())

Functions

Link copied to clipboard
suspend fun finalizeAuthorizationResponse(state: DcApiPreparationState, credentialPresentation: CredentialPresentation? = null): KmmResult<DigitalCredentialInterface>

Creates a protocol-agnostic response to return through the browser's Digital Credentials API.

Link copied to clipboard

Matches wallet credentials using the protocol and platform-selected credential IDs recorded in state.

Link copied to clipboard

Validates the request and prepares credential selection. Clients can inspect the returned state, ask for user consent, and resume with finalizeAuthorizationResponse.

Validates request under policy and prepares credential selection like the overload without a policy, also for a rejected request: check the decision of DcApiRequestValidation.validationReport before presenting. For an ISO/IEC 18013-7 Annex C request, which has no request object, the report is the one of its relying party, reported like a proximity request, see RelyingPartyValidator.validate: a request without reader authentication is rejected as unsigned, and one without registration certificates as ValidationPolicy.registration says.