Skip to content

Commit

Permalink
fix: added nested entity statements
Browse files Browse the repository at this point in the history
  • Loading branch information
rglauco committed Oct 31, 2023
1 parent 827a61e commit 58e1084
Show file tree
Hide file tree
Showing 3 changed files with 564 additions and 577 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public class EntityConfiguration {
private EntityConfiguration trustAnchor;
//private JSONObject header;
private JSONObject payload;
private String verifiedDescendantStatementJwt;
private String sub;
private String iss;
private long exp;
Expand Down Expand Up @@ -307,7 +308,9 @@ public List<String> getVerifiedDescendantStatement() {

return Collections.unmodifiableList(result);
}

public String getVerifiedDescendantStatementJwt() {
return this.verifiedDescendantStatementJwt;
}
public Set<TrustMark> getVerifiedTrustMarks() {
return Collections.unmodifiableSet(verifiedTrustMarks);
}
Expand Down Expand Up @@ -354,7 +357,9 @@ public boolean isValid() {
public void setAllowedTrustMarks(String[] allowedTrustMarks) {
this.allowedTrustMarks = Arrays.asList(allowedTrustMarks);
}

public void setVerifiedDescendantStatementJwt(String jwt) {
this.verifiedDescendantStatementJwt = jwt;
}
@Override
public String toString() {
return String.format("(%s valid:%b", this.sub, this.valid);
Expand Down Expand Up @@ -514,7 +519,7 @@ public boolean validateBySuperior(String jwt, EntityConfiguration ec)

if (valid) {
ec.addVerifiedDescendantStatement(getSubject(), payload);

ec.setVerifiedDescendantStatementJwt(jwt);
this.verifiedBySuperiors.put(payload.getString("iss"), ec);
this.valid = true;
}
Expand Down
Loading

0 comments on commit 58e1084

Please sign in to comment.