Remote presentation mDocs Holder SDK Cheatsheet
This guide provides a quick overview of how to use the MATTR mDocs Holder SDKs to present a claimed mDoc for verification via an online presentation workflow as per ISO/IEC 18013-7:2025 and OID4VP.
Use these guides as a quick reference to get started. For detailed information, explore the linked tutorials and reference documentation tailored for each platform.
Core usage
Initialize the SDK
mobileCredentialHolder.initialize(userAuthRequiredOnInitialize: false)
mobileCredentialHolder.initialize(activity, userAuthRequiredOnInitialize = false)
const initialiseResult = await mobileCredentialHolder.initialise();
if (initialiseResult.isErr()) {
const { error } = initialiseResult;
// handle error scenarios
return;
}
Register the verifier's Authorization URL
Ensure that your application is registered to
handle the verifier's authorization URL.
This is typically done in the app's Info.plist
file. The URL scheme should match the one used by
the verifier.
Ensure that your application is registered to handle the verifier's authorization URL. This is typically done in the AndroidManifest.xml file. The URL scheme should match the one used by the verifier.
Create an online presentation session
let onlinePresentationSession = try await mobileCredentialHolder.createOnlinePresentationSession(authorizationRequestUri: authorizationRequestURI, requireTrustedVerifier: false)
authorizationRequestURI
: Pass the OID4VP authorization request URI as a string.requireTrustedVerifier
: Set totrue
if you want to ensure that the verifier exists on the app's trusted verifier's list.
The
createOnlinePresentationSession
method returns an instance of
OnlinePresentationSession
containing requested and matching credentials.
val onlinePresentationSession = mobileCredentialHolder.createOnlinePresentationSession(
authorisationRequestUri = authorizationRequestUri,
requireTrustedVerifier = false
)
authorisationRequestURI
: Pass the OID4VP authorization request URI as a string.requireTrustedVerifier
: Set totrue
if you want to ensure that the verifier exists on the app's trusted verifier's list.
The
createOnlinePresentationSession
method returns an instance of
OnlinePresentationSession
containing requested and matching credentials.
const createSessionResult =
await mobileCredentialHolder.createOnlinePresentationSession({
authorisationRequestUri: authorizationRequestURI,
requireTrustedVerifier: false,
});
if (createSessionResult.isErr()) {
const { error } = createSessionResult;
// handle error scenarios
return;
}
const onlinePresentationSession = createSessionResult.value;
authorizationRequestUri
: Pass the OID4VP authorization request URI as a string.requireTrustedVerifier
: Set totrue
if you want to ensure that the verifier exists on the app's trusted verifier's list.
The createOnlinePresentationSession
method returns an instance of OnlinePresentationSession
containing requested and matching credentials.
Present matching credentials to holder
let credential = try await mobileCredentialHolder.getCredential(credentialId: id)
id
: Pass the identifier of the credential you want to present, as a string. This information can be retrieved from theOnlinePresentationSession
object returned by thecreateOnlinePresentationSession
method.
Your application must then gather the user's consent to share the matching credential with the verifier.
val credential = mobileCredentialHolder.getCredential(credentialId)
credentialId
: Pass the identifier of the credential you want to present, as a string. This information can be retrieved from theOnlinePresentationSession
object returned by thecreateOnlinePresentationSession
method.
Your application must then gather the user's consent to share the matching credential with the verifier.
const credentialResult = await mobileCredentialHolder.getCredential(
credentialId,
);
if (credentialResult.isErr()) {
const { error } = credentialResult;
// handle error scenarios
return;
}
const credential = credentialResult.value;
credentialId
: Pass the identifier of the credential you want to present, as a string. This information can be retrieved from theOnlinePresentationSession
object returned by the method.
Your application must then gather the user's consent to share the matching credential with the verifier.
Send a response to the verifier
try await onlinePresentationSession.sendResponse(credentialIds: [id])
id
: Pass the identifier of the credential you want to send, as a string.
onlinePresentationSession.sendResponse(
credentialIds = listOf(credentialId),
activity = activity
)
credentialId
: Pass the identifier of the credential you want to send, as a string.
const sendResponseResult = await onlinePresentationSession.sendResponse({
credentialIds: [credentialId],
});
if (sendResponseResult.isErr()) {
const { error } = sendResponseResult;
// handle error scenarios
return;
}
credentialId
: Pass the identifier of the credential you want to send, as a string.
How would you rate this page?