Record Class PlayerPublicKey

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

public record PlayerPublicKey(PlayerPublicKey.class_7443 data, PublicKey key) 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 bsi
intermediary net/minecraft/class_7428
named net/minecraft/network/encryption/PlayerPublicKey
official b
intermediary comp_767
named data
official c
intermediary comp_768
named key
  • Field Details

    • data

      private final PlayerPublicKey.class_7443 data
      The field for the data record component.
    • key

      private final PublicKey key
      The field for the key record component.
    • CODEC

      public static final com.mojang.serialization.Codec<PlayerPublicKey> CODEC
      Mappings:
      Namespace Name Mixin selector
      official a Lbsi;a: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;
    • PUBLIC_KEY

      private static final String PUBLIC_KEY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official d Lbsi;d:Ljava/lang/String;
      intermediary field_39051 Lnet/minecraft/class_7428;field_39051:Ljava/lang/String;
      named PUBLIC_KEY Lnet/minecraft/network/encryption/PlayerPublicKey;PUBLIC_KEY:Ljava/lang/String;
  • Constructor Details

  • Method Details

    • method_43698

      public static PlayerPublicKey method_43698(PlayerPublicKey.class_7443 class_7443) throws NetworkEncryptionException
      Throws:
      NetworkEncryptionException
      Mappings:
      Namespace Name Mixin selector
      official a Lbsi;a(Lbsi$a;)Lbsi;
      intermediary method_43698 Lnet/minecraft/class_7428;method_43698(Lnet/minecraft/class_7428$class_7443;)Lnet/minecraft/class_7428;
      named method_43698 Lnet/minecraft/network/encryption/PlayerPublicKey;method_43698(Lnet/minecraft/network/encryption/PlayerPublicKey$class_7443;)Lnet/minecraft/network/encryption/PlayerPublicKey;
    • verifyAndDecode

      public static PlayerPublicKey verifyAndDecode(com.mojang.authlib.minecraft.MinecraftSessionService minecraftSessionService, PlayerPublicKey.class_7443 class_7443) throws com.mojang.authlib.minecraft.InsecurePublicKeyException, NetworkEncryptionException
      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:
      com.mojang.authlib.minecraft.InsecurePublicKeyException.MissingException - when the key is missing or empty
      com.mojang.authlib.minecraft.InsecurePublicKeyException.InvalidException - when the key is unsigned or expired
      NetworkEncryptionException - when the key is malformed
      com.mojang.authlib.minecraft.InsecurePublicKeyException
      Mappings:
      Namespace Name Mixin selector
      official a Lbsi;a(Lcom/mojang/authlib/minecraft/MinecraftSessionService;Lbsi$a;)Lbsi;
      intermediary method_43550 Lnet/minecraft/class_7428;method_43550(Lcom/mojang/authlib/minecraft/MinecraftSessionService;Lnet/minecraft/class_7428$class_7443;)Lnet/minecraft/class_7428;
      named verifyAndDecode Lnet/minecraft/network/encryption/PlayerPublicKey;verifyAndDecode(Lcom/mojang/authlib/minecraft/MinecraftSessionService;Lnet/minecraft/network/encryption/PlayerPublicKey$class_7443;)Lnet/minecraft/network/encryption/PlayerPublicKey;
    • method_43697

      public Signature method_43697() throws NetworkEncryptionException
      Throws:
      NetworkEncryptionException
      Mappings:
      Namespace Name Mixin selector
      official a Lbsi;a()Ljava/security/Signature;
      intermediary method_43697 Lnet/minecraft/class_7428;method_43697()Ljava/security/Signature;
      named method_43697 Lnet/minecraft/network/encryption/PlayerPublicKey;method_43697()Ljava/security/Signature;
    • 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
    • key

      public PublicKey key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component