isValidDeviceEngagementString

fun isValidDeviceEngagementString(data: String): Boolean

Validates the supplied string is a valid QR code based on device engagement structure (as per section 8.2.2.3 of ISO 18013-5).

This function will:

  • Check the supplied string is prefixed with mdoc:.

  • Decode the trailing portion of the string as Base64 into a CBOR structure and validate it against the expected data structure as per the CDDL of section 8.2.2.3 in ISO/IEC 18013-5:2021.

Return

Boolean indicating whether the provided string is a valid device engagement structure.