Enum Class ValueTransformation

Object
Enum<ValueTransformation>
se.curity.identityserver.sdk.web.cookie.ValueTransformation
All Implemented Interfaces:
Serializable, Comparable<ValueTransformation>, Constable

public enum ValueTransformation extends Enum<ValueTransformation>
The type of transformation to be applied to a cookie's value(s) when reading or writing it.

To write a cookie with a transformation applied to its value, use ResponseCookies.add(StandardResponseCookie, ValueTransformation).

To read a cookie with a transformation applied to its raw value, use RequestCookies.getFirst(String, ValueTransformation) or RequestCookies.getSingleOrError(String, ValueTransformation).

Since:
2.1.0
  • Enum Constant Details

    • NONE

      public static final ValueTransformation NONE
      The cookie value is not transformed in any way. This is appropriate only for non-sensitive cookies which the client can set and modify.
    • ENCRYPT

      public static final ValueTransformation ENCRYPT
      The cookie value is encrypted by the server. The client cannot read the value of such cookies, or change that in any way.

      If an encrypted cookie's value is tampered with or an ExpirableResponseCookie expires, the RequestCookies container methods to access the cookie will return null as if the cookie did not exist.

    • SIGN

      public static final ValueTransformation SIGN
      The cookie value is signed by the server. The client cannot read the value of such cookies, or change that in any way unless it is also capable of signing the cookie using the same key and algorithm as the server.

      If a signed cookie's value is tampered with, the RequestCookies container methods to access the cookie will return null as if the cookie did not exist.

  • Method Details

    • values

      public static ValueTransformation[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ValueTransformation valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null