MobileCredentialHolder

class MobileCredentialHolder : SdkLifecycle

The entry point for the MobileCredentialHolder SDK.

Types

Link copied to clipboard
object Companion
Link copied to clipboard
object Nfc

NFC-related utilities independent of SDK instance lifecycle.

Properties

Link copied to clipboard
val initialized: Boolean

Boolean status indicating whether the SDK instance is currently initialized or not.

Functions

Link copied to clipboard
@Blocking
fun addCredential(credential: String, deviceKeyId: String): String

Add an mDoc to storage.

Link copied to clipboard
@Blocking
fun addTrustedIssuerCertificates(certificates: List<String>): List<String>

Add trusted issuer certificates to storage.

Link copied to clipboard
@Blocking
fun addTrustedVerifierCertificates(certificates: List<String>): List<String>

Add trusted verifier certificates to storage.

Link copied to clipboard
suspend fun clearActivityLog(): Unit?

Clears all stored activity log entries for the current SDK instance.

Link copied to clipboard
suspend fun createAuthorizationSession(credentialOffer: String, clientId: String): AuthorizationSession

The AuthorizationSession object contains the AuthorizationSession.authorizeUrl which can be used to start the credential issuance flow. Use this function in conjunction with retrieveCredentials. This function should only be used for the Authorization Code Flow.

Link copied to clipboard
@Blocking
fun createOnlinePresentationSession(authorizationRequestUri: String, authenticationOption: AuthenticationOption = AuthenticationOption.Signature, requireTrustedVerifier: Boolean = false): OnlinePresentationSession

Create an online presentation session compliant with the ISO 18013-7 and OpenID4VP.

Link copied to clipboard
suspend fun createProximityPresentationSession(activity: Activity, authenticationOption: AuthenticationOption = AuthenticationOption.Signature, bleMode: BleMode = BleMode.MDocClientCentral, onRequestReceived: ProximityPresentationSession.OnRequestReceived, onConnected: ProximityPresentationSession.OnConnected? = null, onSessionTerminated: ProximityPresentationSession.OnSessionTerminated? = null, engagementFromNfc: Boolean = false): ProximityPresentationSession

Create a proximity based presentation session with a mDoc verifier using device retrieval as per ISO/IEC 18013-5:2021.

Link copied to clipboard
suspend fun deinitialize()

Deinitialize the MobileCredentialHolder SDK.

Link copied to clipboard
@Blocking
fun deleteCredential(id: String)

Deletes an mDoc from storage.

Link copied to clipboard
@Blocking
fun deleteTrustedIssuerCertificate(certificateId: String)

Delete a trusted issuer certificate from storage.

Link copied to clipboard
@Blocking
fun deleteTrustedVerifierCertificate(certificateId: String)

Delete a trusted verifier certificate from storage.

Link copied to clipboard
suspend fun destroy(context: Context, instanceId: String = DEFAULT_INSTANCE_ID)

Destroys an instance of the SDK.

Link copied to clipboard
Link copied to clipboard
suspend fun generateDeviceKey(activity: Activity?, popOptions: DeviceKeyPopOptions? = null, deviceKeyPolicy: DeviceKeyPolicy? = null): GeneratedDeviceKeyResult

Generate a device key for provisioning a new mDoc.

Link copied to clipboard
suspend fun getActivityLog(offset: Int = 0, count: Int = 100): List<ActivityLogEntry>

Retrieves activity log entries for the current SDK instance.

Link copied to clipboard
@Blocking
fun getCredential(id: String, fetchUpdatedStatusList: Boolean = true): MobileCredential

Retrieve a specific credential from storage by its ID.

Link copied to clipboard

Retrieve all credentials' metadata from storage.

Link copied to clipboard

Get the current proximity presentation session.

Link copied to clipboard
fun getLog(): String?

Retrieve the path to the Holder SDK log file.

Link copied to clipboard

Retrieve all trusted issuer certificates from storage.

Link copied to clipboard

Retrieve all trusted verifier certificates from storage.

Link copied to clipboard
suspend fun initialize(context: Context, instanceId: String = DEFAULT_INSTANCE_ID, userAuthenticationConfiguration: UserAuthenticationConfiguration = ConfigurationRepository.defaultUserAuthenticationConfiguration, credentialIssuanceConfiguration: CredentialIssuanceConfiguration? = null, dcmConfiguration: DcmConfiguration? = null, loggerConfiguration: Logger.LoggerConfiguration? = null, activityLogConfiguration: ActivityLogConfiguration? = null)

Initialize the MobileCredentialHolder SDK.

Link copied to clipboard

Boolean status indicating whether activity log recording is currently enabled.

Link copied to clipboard
suspend fun retrieveCredentials(activity: Activity?, authorizationSession: AuthorizationSession, authorizationCode: String, deviceKeyPolicy: DeviceKeyPolicy? = null): List<RetrieveCredentialResult>
suspend fun retrieveCredentials(activity: Activity?, credentialOffer: String, clientId: String, transactionCode: String? = null, deviceKeyPolicy: DeviceKeyPolicy? = null): List<RetrieveCredentialResult>
Link copied to clipboard
fun setActivityLogEnabled(enabled: Boolean): Unit?

Enables or disables Activity Log writes for the current SDK instance.