Class JWTEncoder

java.lang.Object
io.fusionauth.jwt.JWTEncoder

public class JWTEncoder extends Object
Author:
Daniel DeGroff
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    encode(JWT jwt, Signer signer)
    Encode the JWT to produce a dot separated encoded string that can be sent in an HTTP request header.
    encode(JWT jwt, Signer signer, java.util.function.Consumer<Header> consumer)
    Encode the JWT to produce a dot separated encoded string that can be sent in an HTTP request header.
    encode(JWT jwt, Signer signer, java.util.function.Supplier<Header> supplier)
    Encode the JWT to produce a dot separated encoded string that can be sent in an HTTP request header.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JWTEncoder

      public JWTEncoder()
  • Method Details

    • encode

      public String encode(JWT jwt, Signer signer)
      Encode the JWT to produce a dot separated encoded string that can be sent in an HTTP request header.
      Parameters:
      jwt - The JWT.
      signer - The signer used to add a signature to the JWT.
      Returns:
      the encoded JWT string.
    • encode

      public String encode(JWT jwt, Signer signer, java.util.function.Supplier<Header> supplier)
      Encode the JWT to produce a dot separated encoded string that can be sent in an HTTP request header.
      Parameters:
      jwt - The JWT.
      signer - The signer used to add a signature to the JWT.
      supplier - A header supplier to optionally add header values to the encoded JWT. May be null.
      Returns:
      the encoded JWT string.
    • encode

      public String encode(JWT jwt, Signer signer, java.util.function.Consumer<Header> consumer)
      Encode the JWT to produce a dot separated encoded string that can be sent in an HTTP request header.
      Parameters:
      jwt - The JWT.
      signer - The signer used to add a signature to the JWT.
      consumer - A header consumer to optionally add header values to the encoded JWT. May be null.
      Returns:
      the encoded JWT string.