@sphereon/ssi-sdk.oid4vci-holder 0.34.1-feature.SSISDK.17.bitstring.sl.8 → 0.34.1-feature.SSISDK.26.48

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.cjs CHANGED
@@ -1617,7 +1617,7 @@ var getCredentialBranding = /* @__PURE__ */ __name(async (args) => {
1617
1617
  const credentialBranding = {};
1618
1618
  await Promise.all(Object.entries(credentialsSupported).map(async ([configId, credentialsConfigSupported]) => {
1619
1619
  let sdJwtTypeMetadata;
1620
- if (credentialsConfigSupported.format === "vc+sd-jwt") {
1620
+ if (credentialsConfigSupported.format === "dc+sd-jwt") {
1621
1621
  const vct = credentialsConfigSupported.vct;
1622
1622
  if (vct.startsWith("http")) {
1623
1623
  try {
@@ -2073,7 +2073,7 @@ var getIssuanceCryptoSuite = /* @__PURE__ */ __name(async (opts) => {
2073
2073
  case "jwt":
2074
2074
  case "jwt_vc_json":
2075
2075
  case "jwt_vc":
2076
- case "vc+sd-jwt":
2076
+ case "dc+sd-jwt":
2077
2077
  case "mso_mdoc": {
2078
2078
  const supportedPreferences = jwtCryptographicSuitePreferences.filter((suite) => signing_algs_supported.includes(suite));
2079
2079
  if (supportedPreferences.length > 0) {
@@ -2211,7 +2211,7 @@ var OID4VCIHolder = class _OID4VCIHolder {
2211
2211
  oid4vciHolderStoreIssuerBranding: this.oid4vciHolderStoreIssuerBranding.bind(this)
2212
2212
  };
2213
2213
  vcFormatPreferences = [
2214
- "vc+sd-jwt",
2214
+ "dc+sd-jwt",
2215
2215
  "mso_mdoc",
2216
2216
  "jwt_vc_json",
2217
2217
  "jwt_vc",
@@ -2737,9 +2737,19 @@ var OID4VCIHolder = class _OID4VCIHolder {
2737
2737
  }
2738
2738
  let counter = 0;
2739
2739
  for (const credentialId of selectedCredentials) {
2740
- const localeBranding = credentialBranding?.[credentialId];
2740
+ const configId = credentialId;
2741
+ const types = credentialsToAccept.find((ac) => ac.correlationId === configId || ac.credentialToAccept.id === configId || ac.types.includes(configId))?.types?.filter((type) => type != "VerifiableCredential") ?? [];
2742
+ const localeBranding = credentialBranding?.[configId] ?? [];
2743
+ if (localeBranding.length === 0) {
2744
+ for (const type of types) {
2745
+ const branding = credentialBranding?.[type] ?? [];
2746
+ if (branding.length > 0) {
2747
+ localeBranding.push(...branding);
2748
+ }
2749
+ }
2750
+ }
2741
2751
  if (localeBranding && localeBranding.length > 0) {
2742
- const credential = credentialsToAccept.find((credAccept) => credAccept.credentialToAccept.id === credentialId || JSON.stringify(credAccept.types) === credentialId || credentialsToAccept[counter]);
2752
+ const credential = credentialsToAccept.find((credAccept) => credAccept.credentialToAccept.id === credentialId || JSON.stringify(credAccept.types) === credentialId || JSON.stringify(credAccept.types.filter((cred) => cred !== "VerifiableCredential")) === JSON.stringify(types) || credentialsToAccept[counter]);
2743
2753
  counter++;
2744
2754
  await context.agent.ibAddCredentialBranding({
2745
2755
  vcHash: (0, import_utils2.computeEntryHash)(credential.rawVerifiableCredential),