Record Class PlayerPublicKey

java.lang.Object
java.lang.Record
net.minecraft.network.encryption.PlayerPublicKey
Record Components:
data -

public record PlayerPublicKey(PlayerPublicKey.PublicKeyData data) extends Record
An RSA public key for a player, signed by the Mojang's server.

Users cannot generate the keys themselves; this must be provided from Mojang's authentication server.

See Also:
Mappings:
Namespace Name
official buf
intermediary net/minecraft/class_7428
named net/minecraft/network/encryption/PlayerPublicKey
official e
intermediary comp_767
named data
  • Field Details

    • data

      private final PlayerPublicKey.PublicKeyData data
      The field for the data record component.
    • field_39953

      public static final Text field_39953
      Mappings:
      Namespace Name Mixin selector
      official a Lbuf;a:Lrq;
      intermediary field_39953 Lnet/minecraft/class_7428;field_39953:Lnet/minecraft/class_2561;
      named field_39953 Lnet/minecraft/network/encryption/PlayerPublicKey;field_39953:Lnet/minecraft/text/Text;
    • field_39954

      public static final Text field_39954
      Mappings:
      Namespace Name Mixin selector
      official b Lbuf;b:Lrq;
      intermediary field_39954 Lnet/minecraft/class_7428;field_39954:Lnet/minecraft/class_2561;
      named field_39954 Lnet/minecraft/network/encryption/PlayerPublicKey;field_39954:Lnet/minecraft/text/Text;
    • field_39956

      private static final Text field_39956
      Mappings:
      Namespace Name Mixin selector
      official f Lbuf;f:Lrq;
      intermediary field_39956 Lnet/minecraft/class_7428;field_39956:Lnet/minecraft/class_2561;
      named field_39956 Lnet/minecraft/network/encryption/PlayerPublicKey;field_39956:Lnet/minecraft/text/Text;
    • field_39955

      public static final Duration field_39955
      Mappings:
      Namespace Name Mixin selector
      official c Lbuf;c:Ljava/time/Duration;
      intermediary field_39955 Lnet/minecraft/class_7428;field_39955:Ljava/time/Duration;
      named field_39955 Lnet/minecraft/network/encryption/PlayerPublicKey;field_39955:Ljava/time/Duration;
    • CODEC

      public static final com.mojang.serialization.Codec<PlayerPublicKey> CODEC
      Mappings:
      Namespace Name Mixin selector
      official d Lbuf;d:Lcom/mojang/serialization/Codec;
      intermediary field_39050 Lnet/minecraft/class_7428;field_39050:Lcom/mojang/serialization/Codec;
      named CODEC Lnet/minecraft/network/encryption/PlayerPublicKey;CODEC:Lcom/mojang/serialization/Codec;
  • Constructor Details

  • Method Details

    • verifyAndDecode

      public static PlayerPublicKey verifyAndDecode(SignatureVerifier servicesSignatureVerifier, UUID playerUuid, PlayerPublicKey.PublicKeyData publicKeyData, Duration duration) throws PlayerPublicKey.class_7652
      Verifies the public key and decodes it.

      The checks whether the public key is present, signed with the Mojang's private key, and not expired.

      Throws:
      InsecurePublicKeyException.MissingException - when the key is missing or empty
      InsecurePublicKeyException.InvalidException - when the key does not belong to the profile, is unsigned, or expired
      NetworkEncryptionException - when the key is malformed
      PlayerPublicKey.class_7652
      Mappings:
      Namespace Name Mixin selector
      official a Lbuf;a(Lamp;Ljava/util/UUID;Lbuf$a;Ljava/time/Duration;)Lbuf;
      intermediary method_43550 Lnet/minecraft/class_7428;method_43550(Lnet/minecraft/class_7500;Ljava/util/UUID;Lnet/minecraft/class_7428$class_7443;Ljava/time/Duration;)Lnet/minecraft/class_7428;
      named verifyAndDecode Lnet/minecraft/network/encryption/PlayerPublicKey;verifyAndDecode(Lnet/minecraft/network/encryption/SignatureVerifier;Ljava/util/UUID;Lnet/minecraft/network/encryption/PlayerPublicKey$PublicKeyData;Ljava/time/Duration;)Lnet/minecraft/network/encryption/PlayerPublicKey;
    • createSignatureInstance

      public SignatureVerifier createSignatureInstance()
      Mappings:
      Namespace Name Mixin selector
      official a Lbuf;a()Lamp;
      intermediary method_43697 Lnet/minecraft/class_7428;method_43697()Lnet/minecraft/class_7500;
      named createSignatureInstance Lnet/minecraft/network/encryption/PlayerPublicKey;createSignatureInstance()Lnet/minecraft/network/encryption/SignatureVerifier;
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • data

      Returns the value of the data record component.
      Returns:
      the value of the data record component