Record Class WorldPacketCrypt.Key
java.lang.Object
java.lang.Record
br.net.dd.netherwingcore.common.cryptography.authentication.WorldPacketCrypt.Key
- Enclosing class:
WorldPacketCrypt
Represents a cryptographic key used for initialization of the encryption
and decryption algorithms. The key must be 32 bytes in length.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]data()Gets the key data as a cloned byte array, ensuring immutability.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Key
public Key(byte[] data) Constructs a newKeyinstance.- Parameters:
data- A byte array representing the key data. Must be exactly 32 bytes long.- Throws:
IllegalArgumentException- If the provided key is not 32 bytes long.
-
-
Method Details
-
data
public byte[] data()Gets the key data as a cloned byte array, ensuring immutability.- Returns:
- A cloned byte array of the key data.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object).
-