Package org.jose4j.jwt.consumer
Class NumericDateValidator
java.lang.Object
org.jose4j.jwt.consumer.NumericDateValidator
- All Implemented Interfaces:
ErrorCodeValidator
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jose4j.jwt.consumer.ErrorCodeValidator
ErrorCodeValidator.Error -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetAllowedClockSkewSeconds(int allowedClockSkewSeconds) voidsetEvaluationTime(NumericDate evaluationTime) voidsetIatAllowedSecondsInTheFuture(int iatAllowedSecondsInTheFuture) voidsetIatAllowedSecondsInThePast(int iatAllowedSecondsInThePast) voidsetMaxFutureValidityInMinutes(int maxFutureValidityInMinutes) voidsetRequireExp(boolean requireExp) voidsetRequireIat(boolean requireIat) voidsetRequireNbf(boolean requireNbf) validate(JwtContext jwtContext) Validate some aspect of the JWT.
-
Constructor Details
-
NumericDateValidator
public NumericDateValidator()
-
-
Method Details
-
setRequireExp
public void setRequireExp(boolean requireExp) -
setRequireIat
public void setRequireIat(boolean requireIat) -
setRequireNbf
public void setRequireNbf(boolean requireNbf) -
setEvaluationTime
-
setAllowedClockSkewSeconds
public void setAllowedClockSkewSeconds(int allowedClockSkewSeconds) -
setMaxFutureValidityInMinutes
public void setMaxFutureValidityInMinutes(int maxFutureValidityInMinutes) -
setIatAllowedSecondsInTheFuture
public void setIatAllowedSecondsInTheFuture(int iatAllowedSecondsInTheFuture) -
setIatAllowedSecondsInThePast
public void setIatAllowedSecondsInThePast(int iatAllowedSecondsInThePast) -
validate
Description copied from interface:ErrorCodeValidatorValidate 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:
validatein interfaceErrorCodeValidator- Parameters:
jwtContext- the JWT context- Returns:
- a Error object with a stable error code and description of the problem or null, if valid
- Throws:
MalformedClaimException- if a malformed claim is encountered
-