Class ClaimsPathPointer
java.lang.Object
org.keycloak.protocol.oid4vc.utils.ClaimsPathPointer
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfilterClaimsByAuthorizationDetails
(Map<String, Object> allClaims, List<ClaimsDescription> requestedClaims) Filters a map of claims based on authorization details claims descriptions.static boolean
isValidPath
(List<Object> path) Validates a claims path pointer.Processes a claims path pointer according to OID4VCI specification.static boolean
Validates a list of claims descriptions for conflicts and contradictions.
-
Constructor Details
-
ClaimsPathPointer
public ClaimsPathPointer()
-
-
Method Details
-
isValidPath
Validates a claims path pointer.- Parameters:
path
- the claims path pointer to validate- Returns:
- true if valid, false otherwise
-
validateClaimsDescriptions
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 filterrequestedClaims
- the list of claims descriptions from authorization details- Returns:
- filtered map containing only the requested claims
- Throws:
IllegalArgumentException
- if mandatory claims are missing
-
processClaimsPathPointer
Processes a claims path pointer according to OID4VCI specification.- Parameters:
claims
- the claims map to search inpath
- 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
-