Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolving by kid on upper level did documents #44

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
ascheibal marked this conversation as resolved.
Show resolved Hide resolved
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
Loading