java.lang.Object
com.irurueta.authserver.authorization.api.web.clients.ClientJwksParser

@Component public class ClientJwksParser extends Object
Parses and validates the public JWK set a client registers for private_key_jwt and self-signed mutual TLS authentication, and converts it between the JSON object of the contract and the JSON text the domain keeps.
  • Constructor Details

    • ClientJwksParser

      public ClientJwksParser()
  • Method Details

    • toJson

      public String toJson(Map<String,Object> jwks)
      Validates a JWK set sent by an administrator and returns its JSON text. Only public keys are accepted: a key with private material (including a symmetric key) is refused.
      Parameters:
      jwks - the JWK set as a JSON object, or null.
      Returns:
      the JWK set as JSON text, or null when none was given.
      Throws:
      InvalidClientJwksException - if the object is not a JWK set, has no keys or has a private key.
    • toObject

      public Map<String,Object> toObject(String json)
      Converts the JSON text of a registered JWK set to the JSON object of the contract.
      Parameters:
      json - the JWK set as JSON text, or null.
      Returns:
      the JWK set as an object, or null when there is none.
      Throws:
      InvalidClientJwksException - if the stored text is not a JWK set.