Wallet
A holder's wallet: OID4VCgo's walletflow over the app's key store, credential store and Wallet Provider. Creating it makes no network calls; provider is needed to receive credentials, not to present them.
Constructors
Types
What refreshCredential obtained.
Functions
Gives up on a deferred credential — its access token has expired, say, or the holder no longer wants it — deleting it and its keys.
Fetches the issuer's status list for a credential, checks its signature, and returns the credential with its revocation status recorded. The list covers many credentials, so fetching it doesn't tell the issuer which one is checked. A credential without a status list is returned as it is.
One credential with its claims.
Every credential the wallet holds.
The credentials issuers have deferred and not yet settled, oldest first — including ones from before the app last quit. Makes no network calls: poll each at its interval.
Deletes a credential and its holder keys, and its refresh grant once no other credential uses it, first revoking the refresh token at the Authorization Server, best effort.
The held mdocs, each with whether the page at origin has been shown it and whether presenting it there now would be linkable (shownToVerifier, linkableHere): for a consent screen shown before the platform releases the request itself. MdocPresentation.request says the same once it has.
Asks the issuer once about a deferred credential. A refused one throws WalletException.Code.credentialDenied, and is then no longer pending.
Replaces a refreshable credential's copies with a fresh batch, each bound to a new attested key, without the holder (OpenID4VCI 1.0 §13.5). Use it when copiesLeft runs low. Throws WalletException.Code.reissueRequired when it can't be refreshed: receive it again from a new offer.
Completes an authorization begun before the app was killed: redirect is the issuer's redirect back to the redirect URI, delivered to the app. Returns the issuance ready for Issuance.requestCredentials. A redirect matching no authorization in progress — not this wallet's, already completed, or expired — throws WalletException.Code.notFound.
Parses an OpenID4VP request delivered through the Digital Credentials API (OpenID4VP 1.0 Appendix A), as Credential Manager hands it over: protocol (openid4vp-v1-unsigned, -signed or -multisigned), its requestData (the request's data object, as JSON) and the calling page's or app's origin. It's answered as a presentation from startPresentation, but Presentation.respond and Presentation.decline send nothing: each returns, in Presentation.Presented.dcapiResponse, the response's data for the platform to hand back.
Resolves a Credential Offer (openid-credential-offer://…) and the issuer's metadata.
Parses an org-iso-mdoc request — an mdoc asked for over the Digital Credentials API — and finds the held mdocs that can answer it. origin is the requesting page's origin, as MdocPresentation.origin serializes it.
Fetches and verifies an OpenID4VP request (openid4vp://…), and finds the credentials that can answer it.
Starts an ISO/IEC 18013-5 in-person presentation over BLE: show its ProximityPresentation.qrCode. In modes, both by default, it advertises for a reader (peripheral server mode) and scans for one (central client mode) until a reader connects either way; a reader offered both should choose central client mode. It needs Bluetooth on and ProximityPermissions.holder for modes granted (ProximityException otherwise).
Deletes every key in keyStore that none of the wallet's credentials is bound to — left by an issuance the app quit or crashed in the middle of, or one dropped without Issuance.close — and returns how many. Call it at launch, before any issuance or refresh: one in progress holds keys of its own.
Where the Verifier asked to take the holder after the wallet refused its request: when startPresentation throws WalletException.Code.requestRefused, open this URL, if any, as OpenID4VP §8.2 has a wallet do. It's returned once.