Package me.mrnavastar.biscuit.api
Class Biscuit.RegisteredCookie
java.lang.Object
me.mrnavastar.biscuit.api.Biscuit.RegisteredCookie
- Enclosing class:
Biscuit
-
Constructor Summary
ConstructorsConstructorDescriptionRegisteredCookie(net.minecraft.util.Identifier identifier, Class<?> cookieType) -
Method Summary
Modifier and TypeMethodDescriptionvoidkickIfMissing(boolean kick) Kick the client if they are missing this cookie or if the cookie is invalid (Bad signature).setCustomMac(Mac mac) Set a custom Mac for cookie singing.setSecret(byte[] secret) Set the secret that should be used to sign this cookie.Set the secret that should be used to sign this cookie.
-
Constructor Details
-
RegisteredCookie
-
-
Method Details
-
setSecret
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
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
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.
-