@sphereon/ssi-sdk.siopv2-oid4vp-op-auth 0.36.1-feature.vdx24.einvoice.inbox.127 → 0.36.1-feature.vdx24.einvoice.inbox.141

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/dist/index.js CHANGED
@@ -646,11 +646,14 @@ async function createVerifiablePresentationForFormat(credential, identifier, con
646
646
  nonce,
647
647
  aud: audience
648
648
  };
649
+ const holder = getIdentifierString(identifier);
650
+ logger.debug(`Creating SD-JWT presentation with holder: ${holder}`);
649
651
  const presentationResult = await agent.createSdJwtPresentation({
650
652
  presentation: decodedSdJwt.compactSdJwtVc,
651
653
  kb: {
652
654
  payload: kbJwtPayload
653
- }
655
+ },
656
+ holder
654
657
  });
655
658
  return presentationResult.presentation;
656
659
  }
@@ -1454,7 +1457,15 @@ var siopSendAuthorizationResponse = /* @__PURE__ */ __name(async (connectionType
1454
1457
  const firstVC = firstUniqueDC.uniformVerifiableCredential;
1455
1458
  let holder;
1456
1459
  if (CredentialMapper4.isSdJwtDecodedCredential(firstVC)) {
1457
- holder = firstVC.decodedPayload.cnf?.jwk ? `did:jwk:${encodeJoseBlob(firstVC.decodedPayload.cnf?.jwk)}#0` : firstVC.decodedPayload.sub;
1460
+ const cnf = firstVC.decodedPayload.cnf;
1461
+ if (cnf?.jwk) {
1462
+ holder = `did:jwk:${encodeJoseBlob(cnf.jwk)}#0`;
1463
+ } else if (cnf?.kid) {
1464
+ const kid = cnf.kid;
1465
+ holder = kid.includes("#") ? kid.split("#")[0] : kid;
1466
+ } else {
1467
+ holder = firstVC.decodedPayload.sub;
1468
+ }
1458
1469
  } else {
1459
1470
  holder = Array.isArray(firstVC.credentialSubject) ? firstVC.credentialSubject[0].id : firstVC.credentialSubject.id;
1460
1471
  }