Skip to content

Commit

Permalink
commit: DDCCGW - resolving by kid on upper level did documents
Browse files Browse the repository at this point in the history
  • Loading branch information
dattatrayamote committed Aug 29, 2024
1 parent e640777 commit dd5317b
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,23 @@ private String getListPathElement(boolean ref) {
return "";
}
}

public String generateTrustListVerificationId(SignerInformationEntity signerInformationEntity) {

String defaultPath = signerInformationEntity.getDomain()
+ SEPARATOR_DID_PATH + getParticipantCode(signerInformationEntity.getCountry())
+ SEPARATOR_DID_PATH + getMappedGroupName(signerInformationEntity.getGroup())
+ SEPARATOR_DID_PATH + encodeKid(signerInformationEntity.getKid());

StringBuffer buf = new StringBuffer();
String[] pathArray = defaultPath.split(SEPARATOR_DID_PATH);

for (int i = path.size(); i <= pathArray.length - 1; i++) {
buf.append(SEPARATOR_DID_PATH + pathArray[i]);
}

return getDocumentId(false) + buf + SEPARATOR_DID_ID + encodeKid(signerInformationEntity.getKid());
}
}

/**
Expand Down Expand Up @@ -555,7 +572,7 @@ private void addTrustListEntry(DidTrustList trustList,

DidTrustListEntry trustListEntry = new DidTrustListEntry();
trustListEntry.setType("JsonWebKey2020");
trustListEntry.setId(specification.getEntryId(encodeKid(signerInformationEntity.getKid())));
trustListEntry.setId(specification.generateTrustListVerificationId(signerInformationEntity));
trustListEntry.setController(specification.getDocumentId(false));
publicKeyJwk.setKid(encodeKid(signerInformationEntity.getKid()));
trustListEntry.setPublicKeyJwk(publicKeyJwk);
Expand Down
Loading

0 comments on commit dd5317b

Please sign in to comment.