@bedrock/vc-delivery 7.17.1 → 7.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/oid4/http.js +7 -0
- package/package.json +1 -1
package/lib/oid4/http.js
CHANGED
|
@@ -439,6 +439,13 @@ function _normalizeCredentials({verifiablePresentation}) {
|
|
|
439
439
|
vc.id?.startsWith('data:application/jwt,')) {
|
|
440
440
|
return vc.id.slice('data:application/jwt,'.length);
|
|
441
441
|
}
|
|
442
|
+
// parse any mdoc mDL into its non-VC format (includes base64 => base64url)
|
|
443
|
+
if(vc.type === 'EnvelopedVerifiableCredential' &&
|
|
444
|
+
vc.id?.startsWith('data:application/mdl;base64,')) {
|
|
445
|
+
const buffer = Buffer.from(
|
|
446
|
+
vc.id.slice('data:application/mdl;base64,'.length), 'base64');
|
|
447
|
+
return buffer.toString('base64url');
|
|
448
|
+
}
|
|
442
449
|
return vc;
|
|
443
450
|
});
|
|
444
451
|
}
|