Skip to content

Commit 65470f2

Browse files
committed
Add the optional state parameter for the pnv flow
1 parent ee220a4 commit 65470f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,10 @@ fun maybeHandlePnv(
311311
val aggregatorCertChain = credAuthJwtHeader.getJSONArray("x5c") // See the x5c cert chain defined at https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.6
312312
// TODO: validate the aggregator cert is allowed to request phone number verification for the given carrier
313313

314+
val state = credAuthJwtpayload.optString("state")
315+
314316
val consentData = credAuthJwtpayload.optString("consent_data")
317+
315318
val md = MessageDigest.getInstance("SHA-256")
316319
val consentDataHash: String? =
317320
if (consentData.isEmpty()) { null }
@@ -396,6 +399,7 @@ fun maybeHandlePnv(
396399
put("nonce", openId4VPRequest.nonce)
397400
put("encrypted_credential", encryptedTempTokenJwe)
398401
put("consent_data_hash", consentDataHash)
402+
put("state", state)
399403
put("sd_hash", digest)
400404
put("subscription_hint", selectedCred.subscriptionHint)
401405
put("carrier_hint", selectedCred.carrierHint)

0 commit comments

Comments
 (0)