Interface JWTClaimsSetValidator

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface JWTClaimsSetValidator

A JWT claims set validator used to validate a JWTClaimsSet.

Since:
1.5
Author:
Jeremy Kuhn
  • Method Details

    • validate

      void validate(JWTClaimsSet claims) throws InvalidJWTException

      Determines wether the specified claims set is valid.

      Parameters:
      claims - a JWT claims set
      Throws:
      InvalidJWTException - if the specified claims set was invalid
    • issuer

      static JWTClaimsSetValidator issuer(String iss)

      Returns a JWT claims set validator that validates that the JWT issuer corresponds to the specified trusted issuer.

      Parameters:
      iss - the trusted issuer
      Returns:
      a JWT claims set validator
    • audience

      static JWTClaimsSetValidator audience(Set<String> aud)

      Returns a JWT claims set validator that validates that the JWT audience corresponds to trusted audiences.

      Parameters:
      aud - a set of trusted audience
      Returns:
      a JWT claims set validator
    • subject

      static JWTClaimsSetValidator subject(String sub)

      Returns a JWT claims set validator that validates that the JWT subject corresponds to the specified trusted subject.

      Parameters:
      sub - the trusted subject
      Returns:
      a JWT claims set validator
    • expiration

      static JWTClaimsSetValidator expiration()

      Returns a JWT claims set validator that validates that the JWT expiration time is after current date time.

      Returns:
      a JWT claims set validator
    • expiration

      static JWTClaimsSetValidator expiration(ZonedDateTime time)

      Returns a JWT claims set validator that validates that the JWT expiration time is after the specified expiration time.

      Parameters:
      time - the expiration time reference
      Returns:
      a JWT claims set validator
    • notBefore

      static JWTClaimsSetValidator notBefore()

      Returns a JWT claims set validator that validates that the JWT not before time is after the current date time.

      Returns:
      a JWT claims set validator
    • notBefore

      static JWTClaimsSetValidator notBefore(ZonedDateTime time)

      Returns a JWT claims set validator that validates that the JWT not before time is after the specified activation time.

      Parameters:
      time - the activtion time reference
      Returns:
      a JWT claims set validator