Package net.minecraft.client.util
Class ProfileKeys
java.lang.Object
net.minecraft.client.util.ProfileKeys
A class to fetch, load, and save the player's public and private keys.
- Mappings:
Namespace Name official exqintermediary net/minecraft/class_7434named net/minecraft/client/util/ProfileKeys
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Pathprivate CompletableFuture<Optional<PlayerKeyPair>>private static final Loggerprivate static final Pathprivate final com.mojang.authlib.minecraft.UserApiService -
Constructor Summary
ConstructorsConstructorDescriptionProfileKeys(com.mojang.authlib.minecraft.UserApiService userApiService, UUID uuid, Path root) -
Method Summary
Modifier and TypeMethodDescriptionprivate static PlayerPublicKey.PublicKeyDatadecodeKeyPairResponse(com.mojang.authlib.yggdrasil.response.KeyPairResponse keyPairResponse) ReturnskeyPairResponsedecoded toPlayerPublicKey.PublicKeyData.private PlayerKeyPairfetchKeyPair(com.mojang.authlib.minecraft.UserApiService userApiService) Returns the key pair fetched from Mojang's server.private CompletableFuture<Optional<PlayerKeyPair>>getKeyPair(Optional<PlayerKeyPair> currentKey) Gets the key pair from the file cache, or if it is unavailable or expired, the Mojang server.private Optional<PlayerKeyPair>Returns the profile keys from the local cache.private voidsaveKeyPairToFile(@Nullable PlayerKeyPair keyPair) Saves thekeyPairto the cache file ifSharedConstants.isDevelopmentistrue; otherwise, just deletes the cache file.
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector official aLexq;a:Lorg/slf4j/Logger;intermediary field_39074Lnet/minecraft/class_7434;field_39074:Lorg/slf4j/Logger;named LOGGERLnet/minecraft/client/util/ProfileKeys;LOGGER:Lorg/slf4j/Logger;
-
PROFILE_KEYS_PATH
- Mappings:
Namespace Name Mixin selector official bLexq;b:Ljava/nio/file/Path;intermediary field_39075Lnet/minecraft/class_7434;field_39075:Ljava/nio/file/Path;named PROFILE_KEYS_PATHLnet/minecraft/client/util/ProfileKeys;PROFILE_KEYS_PATH:Ljava/nio/file/Path;
-
userApiService
private final com.mojang.authlib.minecraft.UserApiService userApiService- Mappings:
Namespace Name Mixin selector official cLexq;c:Lcom/mojang/authlib/minecraft/UserApiService;intermediary field_39958Lnet/minecraft/class_7434;field_39958:Lcom/mojang/authlib/minecraft/UserApiService;named userApiServiceLnet/minecraft/client/util/ProfileKeys;userApiService:Lcom/mojang/authlib/minecraft/UserApiService;
-
jsonPath
- Mappings:
Namespace Name Mixin selector official dLexq;d:Ljava/nio/file/Path;intermediary field_39076Lnet/minecraft/class_7434;field_39076:Ljava/nio/file/Path;named jsonPathLnet/minecraft/client/util/ProfileKeys;jsonPath:Ljava/nio/file/Path;
-
keyFuture
- Mappings:
Namespace Name Mixin selector official eLexq;e:Ljava/util/concurrent/CompletableFuture;intermediary field_39959Lnet/minecraft/class_7434;field_39959:Ljava/util/concurrent/CompletableFuture;named keyFutureLnet/minecraft/client/util/ProfileKeys;keyFuture: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>Lexq;<init>(Lcom/mojang/authlib/minecraft/UserApiService;Ljava/util/UUID;Ljava/nio/file/Path;)Vintermediary <init>Lnet/minecraft/class_7434;<init>(Lcom/mojang/authlib/minecraft/UserApiService;Ljava/util/UUID;Ljava/nio/file/Path;)Vnamed <init>Lnet/minecraft/client/util/ProfileKeys;<init>(Lcom/mojang/authlib/minecraft/UserApiService;Ljava/util/UUID;Ljava/nio/file/Path;)V
-
-
Method Details
-
getClientSession
- Mappings:
Namespace Name Mixin selector official aLexq;a()Ljava/util/concurrent/CompletableFuture;intermediary method_45743Lnet/minecraft/class_7434;method_45743()Ljava/util/concurrent/CompletableFuture;named getClientSessionLnet/minecraft/client/util/ProfileKeys;getClientSession()Ljava/util/concurrent/CompletableFuture;
-
getKeyPair
Gets the key pair from the file cache, or if it is unavailable or expired, the Mojang server.- Mappings:
Namespace Name Mixin selector official aLexq;a(Ljava/util/Optional;)Ljava/util/concurrent/CompletableFuture;intermediary method_43602Lnet/minecraft/class_7434;method_43602(Ljava/util/Optional;)Ljava/util/concurrent/CompletableFuture;named getKeyPairLnet/minecraft/client/util/ProfileKeys;getKeyPair(Ljava/util/Optional;)Ljava/util/concurrent/CompletableFuture;
-
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 bLexq;b()Ljava/util/Optional;intermediary method_43606Lnet/minecraft/class_7434;method_43606()Ljava/util/Optional;named loadKeyPairFromFileLnet/minecraft/client/util/ProfileKeys;loadKeyPairFromFile()Ljava/util/Optional;
-
saveKeyPairToFile
Saves thekeyPairto the cache file ifSharedConstants.isDevelopmentistrue; otherwise, just deletes the cache file.- Mappings:
Namespace Name Mixin selector official aLexq;a(Lbvu;)Vintermediary method_43600Lnet/minecraft/class_7434;method_43600(Lnet/minecraft/class_7427;)Vnamed saveKeyPairToFileLnet/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 malformedIOException- when fetching fails- Mappings:
Namespace Name Mixin selector official aLexq;a(Lcom/mojang/authlib/minecraft/UserApiService;)Lbvu;intermediary method_43605Lnet/minecraft/class_7434;method_43605(Lcom/mojang/authlib/minecraft/UserApiService;)Lnet/minecraft/class_7427;named fetchKeyPairLnet/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 ReturnskeyPairResponsedecoded toPlayerPublicKey.PublicKeyData.- Returns:
keyPairResponsedecoded toPlayerPublicKey.PublicKeyData- Throws:
NetworkEncryptionException- when the response is malformed- Mappings:
Namespace Name Mixin selector official aLexq;a(Lcom/mojang/authlib/yggdrasil/response/KeyPairResponse;)Lbvv$a;intermediary method_44076Lnet/minecraft/class_7434;method_44076(Lcom/mojang/authlib/yggdrasil/response/KeyPairResponse;)Lnet/minecraft/class_7428$class_7443;named decodeKeyPairResponseLnet/minecraft/client/util/ProfileKeys;decodeKeyPairResponse(Lcom/mojang/authlib/yggdrasil/response/KeyPairResponse;)Lnet/minecraft/network/encryption/PlayerPublicKey$PublicKeyData;
-