Package net.minecraft.network.message
Record Class MessageSignature
java.lang.Object
java.lang.Record
net.minecraft.network.message.MessageSignature
- Record Components:
sender
-timestamp
-saltSignature
-
public record MessageSignature(UUID sender, Instant timestamp, NetworkEncryptionUtils.SignatureData saltSignature)
extends Record
A signature for chat messages and message command arguments, consisting
of the sender, the timestamp, and the signature data.
- Mappings:
Namespace Name official rr
intermediary net/minecraft/class_7469
named net/minecraft/network/message/MessageSignature
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
ConstructorDescriptionMessageSignature
(UUID uUID, Instant instant, NetworkEncryptionUtils.SignatureData signatureData) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether the signature can be verified.boolean
canVerifyFrom
(UUID expectedSender) Returns whether the message is fromexpectedSender
and 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.static MessageSignature
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
-
MessageSignature
public MessageSignature(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/message/MessageSignature;none()Lnet/minecraft/network/message/MessageSignature;
-
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/message/MessageSignature;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/message/MessageSignature;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/message/MessageSignature;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/message/MessageSignature;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/message/MessageSignature;canVerify()Z
-
canVerifyFrom
Returns whether the message is fromexpectedSender
and 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 message is from
expectedSender
and the signature can be verified - 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 canVerifyFrom
Lnet/minecraft/network/message/MessageSignature;canVerifyFrom(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
-