Class JWT.Builder

Enclosing class:
JWT

public static final class JWT.Builder extends CustomizableBuilder<JWT>
A simple JWT builder.
  • Constructor Details

    • Builder

      public Builder()
    • Builder

      public Builder(String rawString)
  • Method Details

    • setHeaderType

      public JWT.Builder setHeaderType(String headerType)
      Sets the JWT Header typ.
      Parameters:
      headerType - the JWT Header typ.
      Returns:
      this builder instance.
    • setHeaderAlgorithm

      public JWT.Builder setHeaderAlgorithm(String headerAlgorithm)
      Sets the JWT Header alg.
      Parameters:
      headerAlgorithm - the JWT Header alg.
      Returns:
      this builder instance.
    • setHeaderContentType

      public JWT.Builder setHeaderContentType(String headerContentType)
      Sets the JWT Header cty.
      Parameters:
      headerContentType - the JWT Header cty.
      Returns:
      this builder instance.
    • setHeaderCustomField

      public JWT.Builder setHeaderCustomField(String key, Object value)
      Set the JWT Header custom field.
      Parameters:
      key - the custom field name.
      value - value the custom field value.
      Returns:
      this builder instance.
    • setClaimsSetIssuer

      public JWT.Builder setClaimsSetIssuer(String claimsSetIssuer)
      Sets the JWT Claims Set iss.
      Parameters:
      claimsSetIssuer - the JWT Claims Set iss.
      Returns:
      this builder instance.
    • setClaimsSetSubject

      public JWT.Builder setClaimsSetSubject(String claimsSetSubject)
      Sets the JWT Claims Set sub.
      Parameters:
      claimsSetSubject - the JWT Claims Set sub.
      Returns:
      this builder instance.
    • setClaimsSetAudience

      public JWT.Builder setClaimsSetAudience(String claimsSetAudience)
      Sets the JWT Claims Set aud for a single audience.
      Parameters:
      claimsSetAudience - the JWT Claims Set aud.
      Returns:
      this builder instance.
    • setClaimsSetAudiences

      public JWT.Builder setClaimsSetAudiences(List<String> claimsSetAudiences)
      Sets the JWT Claims Set aud.
      Parameters:
      claimsSetAudiences - the JWT Claims Set aud.
      Returns:
      this builder instance.
    • setClaimsSetExpirationTime

      public JWT.Builder setClaimsSetExpirationTime(long claimsSetExpirationTime)
      Sets the JWT Claims Set exp.
      Parameters:
      claimsSetExpirationTime - the JWT Claims Set exp.
      Returns:
      this builder instance.
    • setClaimsSetNotBefore

      public JWT.Builder setClaimsSetNotBefore(String claimsSetNotBefore)
      Sets the JWT Claims Set nbf.
      Parameters:
      claimsSetNotBefore - the JWT Claims Set nbf.
      Returns:
      this builder instance.
    • setClaimsSetIssuedAt

      public JWT.Builder setClaimsSetIssuedAt(long claimsSetIssuedAt)
      Sets the JWT Claims Set issuedAt.
      Parameters:
      claimsSetIssuedAt - the JWT Claims Set issuedAt.
      Returns:
      this builder instance.
    • setClaimsSetJwdId

      public JWT.Builder setClaimsSetJwdId(String claimsSetJwdId)
      Sets the JWT Claims Set jti.
      Parameters:
      claimsSetJwdId - the JWT Claims Set jti.
      Returns:
      this builder instance.
    • setClaimsSetType

      public JWT.Builder setClaimsSetType(String claimsSetType)
      Sets the JWT Claims Set typ.
      Parameters:
      claimsSetType - the JWT Claims Set typ.
      Returns:
      this builder instance.
    • setClaimsSetCustomField

      public JWT.Builder setClaimsSetCustomField(String key, Object value)
      Set the JWT Claims Set custom field.
      Parameters:
      key - the custom field name.
      value - value the custom field value.
      Returns:
      this builder instance.
    • setSignature

      public JWT.Builder setSignature(String signature)
      Sets the JWT signature.
      Parameters:
      signature -
      Returns:
      this builder instance.
    • build

      public JWT build()
      Creates a new JWT instance.
      Specified by:
      build in class CustomizableBuilder<JWT>
      Returns:
      a new JWT instance.