Package net.minecraft.network.encryption
Record Class ChatMessageSignature
java.lang.Object
java.lang.Record
net.minecraft.network.encryption.ChatMessageSignature
- Record Components:
sender
-timestamp
-saltSignature
-
public record ChatMessageSignature(UUID sender, Instant timestamp, NetworkEncryptionUtils.SignatureData saltSignature)
extends Record
A signature for chat messages, consisting of the sender, the timestamp, and the signature data.
- Mappings:
Namespace Name official rr
intermediary net/minecraft/class_7469
named net/minecraft/network/encryption/ChatMessageSignature
official a
intermediary comp_798
named sender
official b
intermediary comp_799
named timestamp
official c
intermediary comp_800
named saltSignature
-
Field Summary
Modifier and TypeFieldDescriptionprivate final NetworkEncryptionUtils.SignatureData
The field for thesaltSignature
record component.private final UUID
The field for thesender
record component.private final Instant
The field for thetimestamp
record component. -
Constructor Summary
ConstructorDescriptionChatMessageSignature
(UUID uUID, Instant instant, NetworkEncryptionUtils.SignatureData signatureData) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether the signature can be verified.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
method_44336
(UUID uUID) static ChatMessageSignature
none()
Returns the value of thesaltSignature
record component.sender()
Returns the value of thesender
record component.Returns the value of thetimestamp
record component.private static byte[]
toByteArray
(Text message) final String
toString()
Returns a string representation of this record class.static void
updateSignature
(SignatureUpdatable.SignatureUpdater updater, Text message, UUID sender, Instant time, long salt) Updatesupdater
with the passed parameters.boolean
verify
(SignatureVerifier verifier, String message) Returns whethermessage
can be verified with this signature.boolean
verify
(SignatureVerifier verifier, Text message) Returns whethermessage
can be verified with this signature.
-
Field Details
-
sender
The field for thesender
record component. -
timestamp
The field for thetimestamp
record component. -
saltSignature
The field for thesaltSignature
record component.
-
-
Constructor Details
-
ChatMessageSignature
public ChatMessageSignature(UUID uUID, Instant instant, NetworkEncryptionUtils.SignatureData signatureData)
-
-
Method Details
-
none
- Mappings:
Namespace Name Mixin selector official a
Lrr;a()Lrr;
intermediary method_43859
Lnet/minecraft/class_7469;method_43859()Lnet/minecraft/class_7469;
named none
Lnet/minecraft/network/encryption/ChatMessageSignature;none()Lnet/minecraft/network/encryption/ChatMessageSignature;
-
verify
Returns whethermessage
can be verified with this signature.- Returns:
- whether
message
can be verified with this signature - Mappings:
Namespace Name Mixin selector official a
Lrr;a(Lalw;Lrm;)Z
intermediary method_43861
Lnet/minecraft/class_7469;method_43861(Lnet/minecraft/class_7500;Lnet/minecraft/class_2561;)Z
named verify
Lnet/minecraft/network/encryption/ChatMessageSignature;verify(Lnet/minecraft/network/encryption/SignatureVerifier;Lnet/minecraft/text/Text;)Z
-
verify
Returns whethermessage
can be verified with this signature.- Parameters:
message
- the message to verify- Returns:
- whether
message
can be verified with this signature - Throws:
SignatureException
- when verifying fails- Mappings:
Namespace Name Mixin selector official a
Lrr;a(Lalw;Ljava/lang/String;)Z
intermediary method_43860
Lnet/minecraft/class_7469;method_43860(Lnet/minecraft/class_7500;Ljava/lang/String;)Z
named verify
Lnet/minecraft/network/encryption/ChatMessageSignature;verify(Lnet/minecraft/network/encryption/SignatureVerifier;Ljava/lang/String;)Z
-
updateSignature
public static void updateSignature(SignatureUpdatable.SignatureUpdater updater, Text message, UUID sender, Instant time, long salt) throws SignatureException Updatesupdater
with the passed parameters.- Throws:
SignatureException
- when updating signature fails- See Also:
- Implementation Note:
- The data to be signed is
salt
, followed by big-endian ordereduuid
, followed bytime
as seconds from the UTC epoch, followed by UTF-8 encodedmessage
bytes. - Mappings:
Namespace Name Mixin selector official a
Lrr;a(Lalv$a;Lrm;Ljava/util/UUID;Ljava/time/Instant;J)V
intermediary method_43862
Lnet/minecraft/class_7469;method_43862(Lnet/minecraft/class_7498$class_7499;Lnet/minecraft/class_2561;Ljava/util/UUID;Ljava/time/Instant;J)V
named updateSignature
Lnet/minecraft/network/encryption/ChatMessageSignature;updateSignature(Lnet/minecraft/network/encryption/SignatureUpdatable$SignatureUpdater;Lnet/minecraft/text/Text;Ljava/util/UUID;Ljava/time/Instant;J)V
-
toByteArray
- Mappings:
Namespace Name Mixin selector official a
Lrr;a(Lrm;)[B
intermediary method_43863
Lnet/minecraft/class_7469;method_43863(Lnet/minecraft/class_2561;)[B
named toByteArray
Lnet/minecraft/network/encryption/ChatMessageSignature;toByteArray(Lnet/minecraft/text/Text;)[B
-
canVerify
public boolean canVerify()Returns whether the signature can be verified.Verifiable signature is not the same as verified signature. A signatures is verifiable if it has proper sender UUID and signature data. However, it can still fail to verify.
- Returns:
- whether the signature can be verified
- Mappings:
Namespace Name Mixin selector official b
Lrr;b()Z
intermediary method_44124
Lnet/minecraft/class_7469;method_44124()Z
named canVerify
Lnet/minecraft/network/encryption/ChatMessageSignature;canVerify()Z
-
method_44336
- Mappings:
Namespace Name Mixin selector official a
Lrr;a(Ljava/util/UUID;)Z
intermediary method_44336
Lnet/minecraft/class_7469;method_44336(Ljava/util/UUID;)Z
named method_44336
Lnet/minecraft/network/encryption/ChatMessageSignature;method_44336(Ljava/util/UUID;)Z
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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)
. -
sender
Returns the value of thesender
record component.- Returns:
- the value of the
sender
record component
-
timestamp
Returns the value of thetimestamp
record component.- Returns:
- the value of the
timestamp
record component
-
saltSignature
Returns the value of thesaltSignature
record component.- Returns:
- the value of the
saltSignature
record component
-