Class ProfileKeys

java.lang.Object
net.minecraft.client.util.ProfileKeys

@Environment(CLIENT) public class ProfileKeys extends Object
A class to fetch, load, and save the player's public and private keys.
Mappings:
Namespace Name
official etr
intermediary net/minecraft/class_7434
named net/minecraft/client/util/ProfileKeys
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      official a Letr;a:Lorg/slf4j/Logger;
      intermediary field_39074 Lnet/minecraft/class_7434;field_39074:Lorg/slf4j/Logger;
      named LOGGER Lnet/minecraft/client/util/ProfileKeys;LOGGER:Lorg/slf4j/Logger;
    • PROFILE_KEYS_PATH

      private static final Path PROFILE_KEYS_PATH
      Mappings:
      Namespace Name Mixin selector
      official b Letr;b:Ljava/nio/file/Path;
      intermediary field_39075 Lnet/minecraft/class_7434;field_39075:Ljava/nio/file/Path;
      named PROFILE_KEYS_PATH Lnet/minecraft/client/util/ProfileKeys;PROFILE_KEYS_PATH:Ljava/nio/file/Path;
    • jsonPath

      private final Path jsonPath
      Mappings:
      Namespace Name Mixin selector
      official c Letr;c:Ljava/nio/file/Path;
      intermediary field_39076 Lnet/minecraft/class_7434;field_39076:Ljava/nio/file/Path;
      named jsonPath Lnet/minecraft/client/util/ProfileKeys;jsonPath:Ljava/nio/file/Path;
    • publicKeyFuture

      private final CompletableFuture<Optional<PlayerPublicKey>> publicKeyFuture
      Mappings:
      Namespace Name Mixin selector
      official d Letr;d:Ljava/util/concurrent/CompletableFuture;
      intermediary field_39434 Lnet/minecraft/class_7434;field_39434:Ljava/util/concurrent/CompletableFuture;
      named publicKeyFuture Lnet/minecraft/client/util/ProfileKeys;publicKeyFuture:Ljava/util/concurrent/CompletableFuture;
    • signerFuture

      private final CompletableFuture<Optional<Signer>> signerFuture
      Mappings:
      Namespace Name Mixin selector
      official e Letr;e:Ljava/util/concurrent/CompletableFuture;
      intermediary field_39435 Lnet/minecraft/class_7434;field_39435:Ljava/util/concurrent/CompletableFuture;
      named signerFuture Lnet/minecraft/client/util/ProfileKeys;signerFuture:Ljava/util/concurrent/CompletableFuture;
  • Constructor Details

    • ProfileKeys

      public ProfileKeys(com.mojang.authlib.minecraft.UserApiService userApiService, UUID uuid, Path root)
      Mappings:
      Namespace Name Mixin selector
      official <init> Letr;<init>(Lcom/mojang/authlib/minecraft/UserApiService;Ljava/util/UUID;Ljava/nio/file/Path;)V
      intermediary <init> Lnet/minecraft/class_7434;<init>(Lcom/mojang/authlib/minecraft/UserApiService;Ljava/util/UUID;Ljava/nio/file/Path;)V
      named <init> Lnet/minecraft/client/util/ProfileKeys;<init>(Lcom/mojang/authlib/minecraft/UserApiService;Ljava/util/UUID;Ljava/nio/file/Path;)V
  • Method Details

    • getKeyPair

      private CompletableFuture<Optional<PlayerKeyPair>> getKeyPair(com.mojang.authlib.minecraft.UserApiService userApiService)
      Gets the key pair from the file cache, or if it is unavailable or expired, the Mojang server.
      Mappings:
      Namespace Name Mixin selector
      official a Letr;a(Lcom/mojang/authlib/minecraft/UserApiService;)Ljava/util/concurrent/CompletableFuture;
      intermediary method_43602 Lnet/minecraft/class_7434;method_43602(Lcom/mojang/authlib/minecraft/UserApiService;)Ljava/util/concurrent/CompletableFuture;
      named getKeyPair Lnet/minecraft/client/util/ProfileKeys;getKeyPair(Lcom/mojang/authlib/minecraft/UserApiService;)Ljava/util/concurrent/CompletableFuture;
    • loadKeyPairFromFile

      private Optional<PlayerKeyPair> loadKeyPairFromFile()
      Returns the profile keys from the local cache.

      This can return expired keys.

      Returns:
      the profile keys from the local cache
      Implementation Note:
      The cache file is stored at .minecraft/profilekeys/<uuid>.json.
      Mappings:
      Namespace Name Mixin selector
      official d Letr;d()Ljava/util/Optional;
      intermediary method_43606 Lnet/minecraft/class_7434;method_43606()Ljava/util/Optional;
      named loadKeyPairFromFile Lnet/minecraft/client/util/ProfileKeys;loadKeyPairFromFile()Ljava/util/Optional;
    • saveKeyPairToFile

      private void saveKeyPairToFile(@Nullable @Nullable PlayerKeyPair keyPair)
      Saves the keyPair to the cache file.
      Mappings:
      Namespace Name Mixin selector
      official a Letr;a(Lbth;)V
      intermediary method_43600 Lnet/minecraft/class_7434;method_43600(Lnet/minecraft/class_7427;)V
      named saveKeyPairToFile Lnet/minecraft/client/util/ProfileKeys;saveKeyPairToFile(Lnet/minecraft/network/encryption/PlayerKeyPair;)V
    • fetchKeyPair

      private PlayerKeyPair fetchKeyPair(com.mojang.authlib.minecraft.UserApiService userApiService) throws NetworkEncryptionException, IOException
      Returns the key pair fetched from Mojang's server.
      Returns:
      the key pair fetched from Mojang's server
      Throws:
      NetworkEncryptionException - when the fetched key is malformed
      IOException - when fetching fails
      Mappings:
      Namespace Name Mixin selector
      official b Letr;b(Lcom/mojang/authlib/minecraft/UserApiService;)Lbth;
      intermediary method_43605 Lnet/minecraft/class_7434;method_43605(Lcom/mojang/authlib/minecraft/UserApiService;)Lnet/minecraft/class_7427;
      named fetchKeyPair Lnet/minecraft/client/util/ProfileKeys;fetchKeyPair(Lcom/mojang/authlib/minecraft/UserApiService;)Lnet/minecraft/network/encryption/PlayerKeyPair;
    • decodeKeyPairResponse

      private static PlayerPublicKey.PublicKeyData decodeKeyPairResponse(com.mojang.authlib.yggdrasil.response.KeyPairResponse keyPairResponse) throws NetworkEncryptionException
      Returns keyPairResponse decoded to PlayerPublicKey.PublicKeyData.
      Returns:
      keyPairResponse decoded to PlayerPublicKey.PublicKeyData
      Throws:
      NetworkEncryptionException - when the response is malformed
      Mappings:
      Namespace Name Mixin selector
      official a Letr;a(Lcom/mojang/authlib/yggdrasil/response/KeyPairResponse;)Lbti$a;
      intermediary method_44076 Lnet/minecraft/class_7434;method_44076(Lcom/mojang/authlib/yggdrasil/response/KeyPairResponse;)Lnet/minecraft/class_7428$class_7443;
      named decodeKeyPairResponse Lnet/minecraft/client/util/ProfileKeys;decodeKeyPairResponse(Lcom/mojang/authlib/yggdrasil/response/KeyPairResponse;)Lnet/minecraft/network/encryption/PlayerPublicKey$PublicKeyData;
    • getSigner

      @Nullable public @Nullable Signer getSigner()
      Returns the signer, or null if there is no key pair associated with the profile.
      Returns:
      the signer, or null if there is no key pair associated with the profile
      Mappings:
      Namespace Name Mixin selector
      official a Letr;a()Lalx;
      intermediary method_44287 Lnet/minecraft/class_7434;method_44287()Lnet/minecraft/class_7501;
      named getSigner Lnet/minecraft/client/util/ProfileKeys;getSigner()Lnet/minecraft/network/encryption/Signer;
    • getPublicKey

      public Optional<PlayerPublicKey> getPublicKey()
      Returns the public key, or null if there is no public key associated with the profile.
      Returns:
      the public key, or null if there is no public key associated with the profile
      Mappings:
      Namespace Name Mixin selector
      official b Letr;b()Ljava/util/Optional;
      intermediary method_43603 Lnet/minecraft/class_7434;method_43603()Ljava/util/Optional;
      named getPublicKey Lnet/minecraft/client/util/ProfileKeys;getPublicKey()Ljava/util/Optional;
    • getPublicKeyData

      public Optional<PlayerPublicKey.PublicKeyData> getPublicKeyData()
      Mappings:
      Namespace Name Mixin selector
      official c Letr;c()Ljava/util/Optional;
      intermediary method_43784 Lnet/minecraft/class_7434;method_43784()Ljava/util/Optional;
      named getPublicKeyData Lnet/minecraft/client/util/ProfileKeys;getPublicKeyData()Ljava/util/Optional;