Class ClaimsPathPointer

java.lang.Object
org.keycloak.protocol.oid4vc.utils.ClaimsPathPointer

public class ClaimsPathPointer extends Object
Utility class for handling claims path pointers. A claims path pointer is a pointer into the Verifiable Credential, identifying one or more claims.
Author:
Forkim Akwichek
  • Constructor Details

    • ClaimsPathPointer

      public ClaimsPathPointer()
  • Method Details

    • isValidPath

      public static boolean isValidPath(List<Object> path)
      Validates a claims path pointer.
      Parameters:
      path - the claims path pointer to validate
      Returns:
      true if valid, false otherwise
    • validateClaimsDescriptions

      public static boolean validateClaimsDescriptions(List<ClaimsDescription> claims)
      Validates a list of claims descriptions for conflicts and contradictions.
      Parameters:
      claims - the list of claims descriptions to validate
      Returns:
      true if valid, false if conflicts are found
    • filterClaimsByAuthorizationDetails

      public static Map<String,Object> filterClaimsByAuthorizationDetails(Map<String,Object> allClaims, List<ClaimsDescription> requestedClaims)
      Filters a map of claims based on authorization details claims descriptions. Only claims that match the requested paths will be included in the result.
      Parameters:
      allClaims - the complete map of claims to filter
      requestedClaims - the list of claims descriptions from authorization details
      Returns:
      filtered map containing only the requested claims
      Throws:
      IllegalArgumentException - if mandatory claims are missing
    • processClaimsPathPointer

      public static List<Object> processClaimsPathPointer(Map<String,Object> claims, List<Object> path)
      Processes a claims path pointer according to OID4VCI specification.
      Parameters:
      claims - the claims map to search in
      path - the claims path pointer
      Returns:
      the set of selected JSON elements, or empty list if none found
      Throws:
      IllegalArgumentException - if processing fails according to spec rules