Skip to content

Commit c72d975

Browse files
committed
Updated provider consent message for pnv
1 parent 0536123 commit c72d975

File tree

4 files changed

+128
-78
lines changed

4 files changed

+128
-78
lines changed

app/src/main/assets/pnv.wasm

653 Bytes
Binary file not shown.

app/src/main/java/com/credman/cmwallet/pnv/PnvTokenRegistry.kt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ data class PnvTokenRegistry(
6969
val icon: String? = null,
7070
val phoneNumberAttributeDisplayName: String, // Should be localized
7171
val supportedAggregatorIssNames: Set<String>?, // If null, allow all and do not perform filtering
72+
val verifierTermsPrefix: String?,
7273
) {
7374
/** Converts this TS43 entry to the more generic SD-JWT registry item(s). */
7475
private fun toSdJwtRegistryItems(): SdJwtRegistryItem {
@@ -82,7 +83,7 @@ data class PnvTokenRegistry(
8283
RegistryClaim("android_carrier_hint", null, androidCarrierHint),
8384
RegistryClaim("phone_number_hint", null, phoneNumberHint),
8485
),
85-
displayData = ItemDisplayData(title = title, subtitle = subtitle, description = providerConsent),
86+
displayData = ItemDisplayData(title = title, subtitle = subtitle, description = providerConsent, verifierTermsPrefix = verifierTermsPrefix),
8687
)
8788
}
8889

@@ -96,6 +97,7 @@ data class PnvTokenRegistry(
9697
internal const val TITLE = "title"
9798
internal const val SUBTITLE = "subtitle"
9899
internal const val DISCLAIMER = "disclaimer"
100+
internal const val VERIFIER_TERMS_PREFIX = "verifier_terms_prefix"
99101
internal const val PATHS = "paths"
100102
internal const val VALUE = "value"
101103
internal const val DISPLAY = "display"
@@ -107,15 +109,17 @@ data class PnvTokenRegistry(
107109
vct = VCT_GET_PHONE_NUMBER,
108110
title = "Terrific Telecom",
109111
subtitle = "+1 (650) 215-4321",
110-
providerConsent = "CMWallet will enable your carrier (Terrific Telecom) to share your phone number",
112+
providerConsent = "CMWallet will enable your carrier (Terrific Telecom) to share your phone number with \${CALLER_DISPLAY_NAME}",
111113
subscriptionHint = 1,
112114
carrierHint = "310250",
113115
androidCarrierHint = 3,
114116
phoneNumberHint = "+16502154321",
115117
iss = "https://example.terrific-telecom.dev",
116118
icon = "iVBORw0KGgoAAAANSUhEUgAAAA4AAAAWCAYAAADwza0nAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACBSURBVHgB7ZTBDUVQEEXvff8VoITfC0YZatABHWiH6IUOaICHBCuReXbEWd1kcmZmMRmGIinhSpABFBDoJpqccSKtA/7wY7C71FQ1NUaUyKIg4Ba8MbiJ3YPnqvcnfuI7xAfdqr0qXjU9FTXTGUnca//NIYGdoflla1BbDsPIqZgBHcEomi+uUHMAAAAASUVORK5CYII=",
117119
phoneNumberAttributeDisplayName = "Phone number",
118-
supportedAggregatorIssNames = null
120+
supportedAggregatorIssNames = null,
121+
verifierTermsPrefix = "Provider Terms:\n",
122+
// verifierTermsPrefix = null,
119123
)
120124
val TEST_PNV_1_VERIFY_PHONE_NUMBER = TEST_PNV_1_GET_PHONE_NUMBER.copy(
121125
vct = VCT_VERIFY_PHONE_NUMBER,
@@ -125,15 +129,16 @@ data class PnvTokenRegistry(
125129
vct = VCT_VERIFY_PHONE_NUMBER,
126130
title = "Work Number",
127131
subtitle = "Timely Telecom",
128-
providerConsent = "CMWallet will enable your carrier (Timely Telecom) to share your phone number",
132+
providerConsent = "CMWallet will enable your carrier (Timely Telecom) to share your phone number with \${CALLER_DISPLAY_NAME}",
129133
subscriptionHint = 2,
130134
carrierHint = "380250",
131135
androidCarrierHint = 3,
132136
phoneNumberHint = "+16502157890",
133137
iss = "https://example.timely-telecom.dev",
134138
icon = "iVBORw0KGgoAAAANSUhEUgAAAA4AAAAWCAYAAADwza0nAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACBSURBVHgB7ZTBDUVQEEXvff8VoITfC0YZatABHWiH6IUOaICHBCuReXbEWd1kcmZmMRmGIinhSpABFBDoJpqccSKtA/7wY7C71FQ1NUaUyKIg4Ba8MbiJ3YPnqvcnfuI7xAfdqr0qXjU9FTXTGUnca//NIYGdoflla1BbDsPIqZgBHcEomi+uUHMAAAAASUVORK5CYII=",
135139
phoneNumberAttributeDisplayName = "Phone number",
136-
supportedAggregatorIssNames = null
140+
supportedAggregatorIssNames = null,
141+
verifierTermsPrefix = "Provider Terms:\n"
137142
)
138143

139144
fun buildRegistryDatabase(items: List<PnvTokenRegistry>): ByteArray {
@@ -177,6 +182,7 @@ data class PnvTokenRegistry(
177182
credJson.put(TITLE, sdJwtRegistryItem.displayData.title)
178183
credJson.putOpt(SUBTITLE, sdJwtRegistryItem.displayData.subtitle)
179184
credJson.putOpt(DISCLAIMER, sdJwtRegistryItem.displayData.description)
185+
credJson.putOpt(VERIFIER_TERMS_PREFIX, sdJwtRegistryItem.displayData.verifierTermsPrefix)
180186
val iconJson = JSONObject().apply {
181187
put(START, iconMap[sdJwtRegistryItem.id]!!.iconOffset)
182188
put(LENGTH, iconMap[sdJwtRegistryItem.id]!!.iconValue.size)
@@ -215,6 +221,7 @@ private class ItemDisplayData(
215221
val title: String,
216222
val subtitle: String?,
217223
val description: String?,
224+
val verifierTermsPrefix: String?,
218225
)
219226

220227
private class SdJwtRegistryItem(

matcher/pnv/dcql.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ cJSON *MatchCredential(cJSON *credential, cJSON *credential_store)
140140
cJSON_AddItemReferenceToObject(matched_credential, "id", cJSON_GetObjectItemCaseSensitive(candidate, "id"));
141141
cJSON_AddItemReferenceToObject(matched_credential, "title", cJSON_GetObjectItemCaseSensitive(candidate, "title"));
142142
cJSON_AddItemReferenceToObject(matched_credential, "subtitle", cJSON_GetObjectItemCaseSensitive(candidate, "subtitle"));
143+
cJSON_AddItemReferenceToObject(matched_credential, "verifier_terms_prefix", cJSON_GetObjectItemCaseSensitive(candidate, "verifier_terms_prefix"));
143144
cJSON_AddItemReferenceToObject(matched_credential, "disclaimer", cJSON_GetObjectItemCaseSensitive(candidate, "disclaimer"));
144145
cJSON_AddItemReferenceToObject(matched_credential, "icon", cJSON_GetObjectItemCaseSensitive(candidate, "icon"));
145146
cJSON_AddItemReferenceToObject(matched_credential, "aggregator_consent", aggregator_consent);
@@ -164,6 +165,7 @@ cJSON *MatchCredential(cJSON *credential, cJSON *credential_store)
164165
cJSON_AddItemReferenceToObject(matched_credential, "id", cJSON_GetObjectItemCaseSensitive(candidate, "id"));
165166
cJSON_AddItemReferenceToObject(matched_credential, "title", cJSON_GetObjectItemCaseSensitive(candidate, "title"));
166167
cJSON_AddItemReferenceToObject(matched_credential, "subtitle", cJSON_GetObjectItemCaseSensitive(candidate, "subtitle"));
168+
cJSON_AddItemReferenceToObject(matched_credential, "verifier_terms_prefix", cJSON_GetObjectItemCaseSensitive(candidate, "verifier_terms_prefix"));
167169
cJSON_AddItemReferenceToObject(matched_credential, "disclaimer", cJSON_GetObjectItemCaseSensitive(candidate, "disclaimer"));
168170
cJSON_AddItemReferenceToObject(matched_credential, "icon", cJSON_GetObjectItemCaseSensitive(candidate, "icon"));
169171
cJSON_AddItemReferenceToObject(matched_credential, "aggregator_consent", aggregator_consent);
@@ -243,6 +245,7 @@ cJSON *MatchCredential(cJSON *credential, cJSON *credential_store)
243245
cJSON_AddItemReferenceToObject(matched_credential, "id", cJSON_GetObjectItemCaseSensitive(candidate, "id"));
244246
cJSON_AddItemReferenceToObject(matched_credential, "title", cJSON_GetObjectItemCaseSensitive(candidate, "title"));
245247
cJSON_AddItemReferenceToObject(matched_credential, "subtitle", cJSON_GetObjectItemCaseSensitive(candidate, "subtitle"));
248+
cJSON_AddItemReferenceToObject(matched_credential, "verifier_terms_prefix", cJSON_GetObjectItemCaseSensitive(candidate, "verifier_terms_prefix"));
246249
cJSON_AddItemReferenceToObject(matched_credential, "disclaimer", cJSON_GetObjectItemCaseSensitive(candidate, "disclaimer"));
247250
cJSON_AddItemReferenceToObject(matched_credential, "icon", cJSON_GetObjectItemCaseSensitive(candidate, "icon"));
248251
cJSON_AddItemReferenceToObject(matched_credential, "aggregator_consent", aggregator_consent);

0 commit comments

Comments
 (0)