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 TypeMethodDescriptionvoid
setAllowedClockSkewSeconds
(int allowedClockSkewSeconds) void
setEvaluationTime
(NumericDate evaluationTime) void
setIatAllowedSecondsInTheFuture
(int iatAllowedSecondsInTheFuture) void
setIatAllowedSecondsInThePast
(int iatAllowedSecondsInThePast) void
setMaxFutureValidityInMinutes
(int maxFutureValidityInMinutes) void
setRequireExp
(boolean requireExp) void
setRequireIat
(boolean requireIat) void
setRequireNbf
(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: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 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
-