Skip to content

Commit 0849f34

Browse files
committed
Update the credential format and encryption parameters
1 parent b5b6080 commit 0849f34

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

app/src/main/assets/pnv.wasm

16 Bytes
Binary file not shown.

app/src/main/java/com/credman/cmwallet/Utils.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ fun jweSerialization(recipientKeyJwk: JSONObject, plainText: String): String {
214214
header.put("apu", partyUInfo.toBase64UrlNoPadding())
215215
header.put("apv", partyVInfo.toBase64UrlNoPadding())
216216
header.put("alg", "ECDH-ES")
217+
header.put("kid", kid)
217218
header.put("enc", "A128GCM")
218219
header.put("epk", JSONObject(kp.public.toJWK().toString()))
219220
val headerEncoded = header.toString().toByteArray().toBase64UrlNoPadding()

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ data class PnvTokenRegistry(
9090
companion object {
9191
const val VCT_GET_PHONE_NUMBER = "number-verification/device-phone-number/ts43"
9292
const val VCT_VERIFY_PHONE_NUMBER = "number-verification/verify/ts43"
93-
const val PNV_CRED_FORMAT = "dc+sd-jwt-pnv"
93+
const val PNV_CRED_FORMAT = "dc-authorization+sd-jwt"
9494

9595
internal const val CREDENTIALS = "credentials"
9696
internal const val ID = "id"
@@ -334,7 +334,7 @@ fun maybeHandlePnv(
334334
val deviceTelModuleJwt = createJWTES256(
335335
header = buildJsonObject {
336336
put("alg", "ES256")
337-
put("typ", "dc+sd-jwt-pnv")
337+
put("typ", "dc-authorization+sd-jwt")
338338
put("x5c", buildJsonArray {
339339
add("MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE+TdTS2XLm+GzoFnwcBfDBzxpHyfA5t9NHIqGravV6L2i4BttORRF1DrjTBDELi265/KIjgtJ05zSFZ/jrUpkmw==")
340340
})

matcher/pnv/dcql.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cJSON* MatchCredential(cJSON* credential, cJSON* credential_store) {
3939
cJSON* aggregator_policy_url = NULL;
4040
cJSON* aggregator_policy_text = NULL;
4141
if (meta != NULL) {
42-
if (strcmp(format, "dc+sd-jwt-pnv") == 0) {
42+
if (strcmp(format, "dc-authorization+sd-jwt") == 0) {
4343
cJSON* vct_values_obj = cJSON_GetObjectItemCaseSensitive(meta, "vct_values");
4444
cJSON* cred_candidates = candidates;
4545
candidates = cJSON_CreateArray();

0 commit comments

Comments
 (0)