Class Biscuit.RegisteredCookie

java.lang.Object
me.mrnavastar.biscuit.api.Biscuit.RegisteredCookie
Enclosing class:
Biscuit

public static class Biscuit.RegisteredCookie extends Object
  • Constructor Details

    • RegisteredCookie

      public RegisteredCookie(net.minecraft.util.Identifier identifier, Class<?> cookieType)
  • Method Details

    • setSecret

      public Biscuit.RegisteredCookie setSecret(byte[] secret)
      Set the secret that should be used to sign this cookie.

      NOTE: Do note hard code this value! It should be something that can be changed in a config in case it is ever compromised.
      Parameters:
      secret - The secret to be set for this cookie.
    • setSecret

      public Biscuit.RegisteredCookie setSecret(String secret)
      Set the secret that should be used to sign this cookie.

      NOTE: Do note hard code this value! It should be something that can be changed in a config in case it is ever compromised.
      Parameters:
      secret - The secret to be set for this cookie.
    • setCustomMac

      public Biscuit.RegisteredCookie setCustomMac(Mac mac)
      Set a custom Mac for cookie singing. By default, biscuit uses a generic "HmacSHA256" algorithm.
      Parameters:
      mac - The mac to be used for cookie signing.
    • kickIfMissing

      public void kickIfMissing(boolean kick)
      Kick the client if they are missing this cookie or if the cookie is invalid (Bad signature).
      Parameters:
      kick - Whether the client should be kicked. Defaults to false.