Const Credential addition options
ID of the saved mobile credential.
The following sequence of verification steps is performed, as per ISO/IEC 18013-5:2021:
Device Key Validation:
Ensures the device key cryptographic curve is supported by the SDK.
Issuer Data Authentication:
Executes the issuer's data authentication procedure defined in section 9.3.1 of ISO/IEC 18013-5:2021:
DocType-Specific Validation:
Performs additional validation steps specific to the credential's docType.
for mDLs this includes:
Add trusted issuer certificates to storage.
Issuer certificates are used to verify mDocs when they are added to storage. This function validates the issuer certificate as per the IACA profile defined in ISO/IEC 18013-5:2021, applying the additional constraint of requiring the certificate to be self-signed.
The function is idempotent, meaning repeated calls to add the same issuer certificates do not result in duplicates. Instead, it returns the IDs of existing certificates stored by the SDK.
An array of certificates in PEM-encoded string format OR a Base64-encoded DER string.
An array of IDs of successfully added certificates.
Add trusted verifier certificates to storage.
Verifier certificates are used to verify the authorization request object fetched from the request URI as part of an OID4VP mDoc retrieval flow, as per Annex B of ISO/IEC 18013-7:2024.
The function is idempotent, meaning repeated calls to add the same verifier certificates do not result in duplicates. Instead, it returns the IDs of existing certificates stored by the SDK.
A list of certificates in PEM-encoded string format OR as a Base64-encoded DER string.
A list of IDs of successfully added certificates.
Create an online presentation session compliant with ISO 18013-7 and OpenID4VP.
Create a proximity based presentation session with an mDoc verifier using device retrieval as per ISO/IEC 18013-5:2021.
This function requires the calling application to have been granted the following Bluetooth-related permissions:
The integrating application MUST have the "NSBluetoothAlwaysUsageDescription" attribute in its "info.plist" file. Failing to do so might result in a runtime application crash when calling this API.
If the application using this SDK hasn't tried to use Bluetooth before, calling this function will result in a system UI prompt asking the user to grant Bluetooth permissions to the application. If the user has denied a similar previous permission request (either when interacting with another part of the application or through a prior call to this function) the MobileCredentialHolderErrorType.BluetoothPermissionDenied error is thrown until the user explicitly grants Bluetooth permissions to the application in their OS app settings.
For Android versions R/11 (API level 30) and below:
For Android versions S/12 (API level 31) and above:
In the event of an error onRequestReceived action can produce the following:
sessionTerminatedAction is invoked when a session is terminated:
| Termination Cause | Error Passed to onSessionTerminated Callback |
|---|---|
| Incoming message from verifier cannot be processed due to invalid CBOR format or a cryptography-related issue. | ProximityPresentationSessionTerminationErrorType.SessionStatusCodeSent |
| The verifier indicated that they cannot process a message from the holder due to invalid CBOR format or a cryptography-related issue. | ProximityPresentationSessionTerminationErrorType.SessionStatusCodeReceived |
The holder terminates the session by calling terminateSession(). |
null |
| The verifier terminates the session. | null |
| BLE connection lost | ProximityPresentationSessionTerminationErrorType.DataTransportDisconnected |
| Session timeout | ProximityPresentationSessionTerminationErrorType.InactivitySessionTimedOut |
Session creation options
Deinitialize the MobileCredentialHolder SDK.
This function will terminate the current presentation session if it exists and close access to storage. Calling this method when the SDK is already deinitialized will be ignored.
Delete a credential from storage.
This function deletes a credential and its corresponding device key from the storage. It is idempotent, meaning calls to delete credentials that do not exist will not return an error.
The ID of the credential to delete.
Delete a trusted issuer certificate from storage.
This function is idempotent. Deleting a certificate that does not exist will return Ok.
ID of the certificate to be deleted.
Delete a trusted verifier certificate from storage.
This function is idempotent. Deleting a certificate that does not exist will return Ok.
ID of certificate to be deleted.
Gets the path to the Holder SDK log file.
Rest ...args: [] | [{ A Promise resolving to the log file path string, or null if no log is available.
Get the current proximity presentation session.
Retrieve the currently persisted NFC configuration.
If none was previously stored, a default configuration is returned and persisted.
Retrieve all trusted issuer certificates from storage.
Retrieve all trusted verifier certificates from storage.
Removes the current device engagement listener. If no listener is registered, does nothing. NFC is only supported on Android. On any other platform, it will return NfcError.PlatformNotSupported.
Sets Listener to be called when NFC device engagement occurs. If the listener is invoked with error, then NFC engagement encountered an error (and can usually be retried). If error is undefined, then engagement was successful and the device engagement data is buffered in memory. Start a presentation from this engagement using;
createProximityPresentationSession({
// ...other options
engagementFromNfc: true,
});
NFC is only supported on Android. On any other platform, it will return NfcError.PlatformNotSupported.
Persist a new NFC configuration to be applied for subsequent device engagements.
Does not affect any ongoing engagement sessions.
Desired NFC behavior (handover mode, BLE mode, log level).
Terminate the session explicitly, send status code sessionTerminated to the holder, and close data transport.
Generated using TypeDoc
Add a mobile credential to storage.