Skip to content

Commit

Permalink
commit: fix removed base64url encoding. (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
dattatrayamote authored Oct 24, 2024
1 parent 640362f commit 9773ce3
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public String generateTrustListVerificationId(SignerInformationEntity signerInfo
}

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

Expand Down Expand Up @@ -266,7 +266,7 @@ public void job() {
() -> signerInformationEntitiesList,
Collections::emptyList,
() -> new ArrayList<>(
signerInformationEntitiesList.stream().map(entity -> encodeKid(entity.getKid()))
signerInformationEntitiesList.stream().map(entity -> entity.getKid())
.collect(Collectors.toSet()))));
})));

Expand All @@ -282,7 +282,7 @@ public void job() {
() -> signerInformationEntitiesList,
Collections::emptyList,
() -> new ArrayList<>(
signerInformationEntitiesList.stream().map(entity -> encodeKid(entity.getKid()))
signerInformationEntitiesList.stream().map(entity -> entity.getKid())
.collect(Collectors.toSet()))));
}));

Expand All @@ -298,7 +298,7 @@ public void job() {
() -> signerInformationEntitiesList,
Collections::emptyList,
() -> new ArrayList<>(
signerInformationEntitiesList.stream().map(entity -> encodeKid(entity.getKid()))
signerInformationEntitiesList.stream().map(entity -> entity.getKid())
.collect(Collectors.toSet()))));

}));
Expand Down Expand Up @@ -332,7 +332,7 @@ public void job() {
Collections::emptyList,
() -> new ArrayList<>(
signerInformationEntitiesList.stream()
.map(entity -> encodeKid(entity.getKid()))
.map(entity -> entity.getKid())
.collect(Collectors.toSet()))));
});

Expand All @@ -359,7 +359,7 @@ public void job() {
signerInformationEntitiesList.forEach(entity -> {
didSpecifications.add(new DidSpecification(
List.of(domain, getParticipantCode(country), getMappedGroupName(group),
encodeKid(entity.getKid())),
entity.getKid()),

() -> signerInformationService.getCertificatesByDomainParticipantGroupKid(
domain, country, group, entity.getKid()),
Expand All @@ -382,7 +382,7 @@ public void job() {

didSpecifications.add(new DidSpecification(
List.of(WILDCARD_CHAR, getParticipantCode(country), getMappedGroupName(group),
encodeKid(entity.getKid())),
entity.getKid()),

() -> signerInformationService.getCertificatesByKidGroupCountry(
country, group, entity.getKid()),
Expand All @@ -402,7 +402,7 @@ public void job() {
signerInformationEntitiesList.forEach(entity -> {
didSpecifications.add(new DidSpecification(
List.of(domain, WILDCARD_CHAR, getMappedGroupName(group),
encodeKid(entity.getKid())),
entity.getKid()),

() -> signerInformationService.getCertificatesByDomainGroupKid(
domain, group, entity.getKid()),
Expand All @@ -421,7 +421,7 @@ public void job() {
signerInformationEntitiesList.forEach(entity -> {
didSpecifications.add(new DidSpecification(
List.of(WILDCARD_CHAR, WILDCARD_CHAR, getMappedGroupName(group),
encodeKid(entity.getKid())),
entity.getKid()),

() -> signerInformationService.getCertificatesByGroupKid(group, entity.getKid()),

Expand Down Expand Up @@ -622,7 +622,7 @@ private void addTrustListEntry(DidTrustList trustList,
trustListEntry.setType("JsonWebKey2020");
trustListEntry.setId(specification.generateTrustListVerificationId(signerInformationEntity));
trustListEntry.setController(specification.getControllerId(false));
publicKeyJwk.setKid(encodeKid(signerInformationEntity.getKid()));
publicKeyJwk.setKid(signerInformationEntity.getKid());
trustListEntry.setPublicKeyJwk(publicKeyJwk);

trustList.getVerificationMethod().add(trustListEntry);
Expand Down Expand Up @@ -703,7 +703,4 @@ private String generateNonce() {
return nonce.toString();
}

private String encodeKid(String kid) {
return Base64URL.encode(kid).toString();
}
}
Loading

0 comments on commit 9773ce3

Please sign in to comment.