Class AuthDefines.SessionKey

java.lang.Object
br.net.dd.netherwingcore.common.cryptography.authentication.AuthDefines.SessionKey
Enclosing class:
AuthDefines

public static class AuthDefines.SessionKey extends Object
Represents a session key with a fixed length of 40 bytes. Provides methods to create, retrieve, and update the session key while ensuring its validity.
  • Constructor Details

  • Method Details

    • getKey

      public byte[] getKey()
      Retrieves a copy of the session key. Protects the internal representation of the key by returning a copy.
      Returns:
      A copy of the session key as a byte array.
    • setKey

      public void setKey(byte[] newKey)
      Updates the current session key with a new byte array. The new byte array must have a length of AuthDefines.SESSION_KEY_LENGTH.
      Parameters:
      newKey - The new byte array representing the session key.
      Throws:
      IllegalArgumentException - If the length of the byte array does not match AuthDefines.SESSION_KEY_LENGTH.