defaultClassifySimpleConsent
Default ClassifySimpleConsentFn implementation that checks whether a credential presentment request qualifies as a simple, well-defined non-PII request (such as age verification) that can be combined with biometric authentication.
Qualification Rules
A request qualifies as a SimpleConsent if and only if all of the following hold:
Single use-case and single credential match:
presentmentData contains a single PresentmentUseCase with a single selected solution index in selections, resolving to a single org.multipaz.presentment.PresentmentCredentialMatch.
The use-case classifies to
setOf(PresentmentPurpose.AGE_VERIFICATION)via PresentmentUseCase.classifyPurposes (which also validates compatibility with any protocol-level PresentmentUseCase.purposeHints).No retention, transaction data, or claim-level encryption:
No requested mdoc claim has MdocRequestedClaim.intentToRetain set to
true.The match has no
transactionData.The match does not request claim-level encryption (
encryptionRequested == false).Allowed claims:
Every requested claim in the match is defined in the credential schema (
attribute != null).Portrait claims (DocumentAttributeSensitivity.PORTRAIT_IMAGE,
portrait,picture,resident_image) andfaceMatchNeededare permitted only for proximity requests (Requester.isProximity istrue); they disqualify over-the-Internet or app-to-app requests.Validity and issuer metadata claims (DocumentAttributeSensitivity.VALIDITY and DocumentAttributeSensitivity.ISSUER) are permitted alongside the age claim.
Exactly one age claim is requested:
An age threshold claim (
age_over_NN,age_aboveNN,age_equal_or_over.NN, or a numeric identifier with DocumentAttributeSensitivity.AGE_INFORMATION) whose value in the credential istrue, mapping to SimpleConsentClaim.AgeOver (or SimpleConsentClaim.AgeOverAndPortrait when a portrait claim is also requested), or whose value in the credential isfalse, mapping to SimpleConsentClaim.NotAgeOver (or SimpleConsentClaim.NotAgeOverAndPortrait when a portrait claim is also requested).age_in_years, mapping to SimpleConsentClaim.AgeInYears (or SimpleConsentClaim.AgeInYearsAndPortrait when a portrait claim is also requested).age_birth_year, mapping to SimpleConsentClaim.AgeBirthYear (or SimpleConsentClaim.AgeBirthYearAndPortrait when a portrait claim is also requested).Any other claim (or more than one age claim) disqualifies the request and returns
null.
Return
a SimpleConsent if the request qualifies as simple, or null otherwise.
Parameters
the relying party which is requesting the data.
trust information for the requester, or null if untrusted.
the combinations of credentials and claims that the user can select.
the selected solution indices for each PresentmentUseCase in PresentmentData.useCases, or an empty list for an omitted optional use-case. Defaults to PresentmentData.defaultSelections.