Class TypeValidator

java.lang.Object
org.jose4j.jwt.consumer.TypeValidator
All Implemented Interfaces:
ErrorCodeValidator

public class TypeValidator extends Object implements ErrorCodeValidator
  • Constructor Details

    • TypeValidator

      public TypeValidator(boolean requireType, String expectedType)
  • Method Details

    • validate

      public ErrorCodeValidator.Error validate(JwtContext jwtContext)
      Description copied from interface: ErrorCodeValidator

      Validate some aspect of the JWT.

      Implementations should use negative values for error codes so as to avoid potential collisions with error code values used by this library, which are defined in ErrorCodes.

      Specified by:
      validate in interface ErrorCodeValidator
      Parameters:
      jwtContext - the JWT context
      Returns:
      a Error object with a stable error code and description of the problem or null, if valid