retrieveCredentials
Retrieves credentials from the issuer, as defined by OpenID4VCI specification.
Validates the retrieved credentials as per ISO/IEC 18013-5:2021, using the same set of validations, as described in addCredential.
Securely stores the credentials on the device.
A failure to retrieve, validate, or save a credential will NOT automatically cause a failure of other credential requests.
If an issue, related to the whole offer, occurs, the function will throw an exception.
If an issue, related to downloading, validating, or saving a single credential occurs, this will be reflected in the returned list of RetrieveCredentialResult objects.
Return
A list of RetrieveCredentialResult objects. Each result contains a doctype, and either a local ID of a retrieved credential, or an error, associated with the retrieval.
Parameters
Optional. An Activity is required to launch the embedded browser with the user consent form, if the Authorization Code Flow is used or UserAuthenticationBehavior.OnDeviceKeyAccess is set on initialize. The SDK does not store the activity after this function returns.
URL-encoded credential offer. It is received from the issuer, e.g., using the QR code. Currently only offer by value is supported.
The identifier that is registered with the issuer as a trusted wallet application.
Transaction code for the Pre-Authorized Code Flow. Based on the offer, a transaction code can be required to prove the user's identity. If you don't know if the issuer requires a transaction code, you can check it using discoverCredentialOffer function to adjust your UI accordingly.
Throws
If an Activity is not supplied when required.
If the SDK is not initialized before calling this function. See: initialize.
If the credentialOffer is invalid or malformed.
If there was a network connection issue during any network call in this function.
If the credential offer discovery process fails for any reason, other than those listed above. For instance, if there was an unexpected response from the server when requesting the issuer's metadata.
If the transaction code is invalid or malformed.
If the offer can be used only with Authorization Code Flow, but the redirect URI was not specified during the SDK initialization.
If the web authentication fails during the Authorization Code Flow.
If there was an issue, other than those listed above, that caused a failure of the whole retrieval process.