Package net.minecraft.client.session
Class ProfileKeysImpl
java.lang.Object
net.minecraft.client.session.ProfileKeysImpl
- All Implemented Interfaces:
- ProfileKeys
A class to fetch, load, and save the player's public and private keys.
- Mappings:
- Namespace - Name - named - net/minecraft/client/session/ProfileKeysImpl- intermediary - net/minecraft/class_7434- official - glg
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate Instantprivate final Pathprivate CompletableFuture<Optional<PlayerKeyPair>> private static final Loggerprivate static final Pathprivate static final Durationprivate final com.mojang.authlib.minecraft.UserApiServiceFields inherited from interface net.minecraft.client.session.ProfileKeysMISSING
- 
Constructor SummaryConstructorsConstructorDescriptionProfileKeysImpl(com.mojang.authlib.minecraft.UserApiService userApiService, UUID uuid, Path root) 
- 
Method SummaryModifier and TypeMethodDescriptionprivate static PlayerPublicKey.PublicKeyDatadecodeKeyPairResponse(com.mojang.authlib.yggdrasil.response.KeyPairResponse keyPairResponse) ReturnskeyPairResponsedecoded toPlayerPublicKey.PublicKeyData.private @Nullable 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.booleanprivate 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 - named - LOGGER- Lnet/minecraft/client/session/ProfileKeysImpl;LOGGER:Lorg/slf4j/Logger;- intermediary - field_39074- Lnet/minecraft/class_7434;field_39074:Lorg/slf4j/Logger;- official - b- Lglg;b:Lorg/slf4j/Logger;
 
- 
TIME_UNTIL_FIRST_EXPIRY_CHECK- Mappings:
- Namespace - Name - Mixin selector - named - TIME_UNTIL_FIRST_EXPIRY_CHECK- Lnet/minecraft/client/session/ProfileKeysImpl;TIME_UNTIL_FIRST_EXPIRY_CHECK:Ljava/time/Duration;- intermediary - field_40797- Lnet/minecraft/class_7434;field_40797:Ljava/time/Duration;- official - c- Lglg;c:Ljava/time/Duration;
 
- 
PROFILE_KEYS_PATH- Mappings:
- Namespace - Name - Mixin selector - named - PROFILE_KEYS_PATH- Lnet/minecraft/client/session/ProfileKeysImpl;PROFILE_KEYS_PATH:Ljava/nio/file/Path;- intermediary - field_39075- Lnet/minecraft/class_7434;field_39075:Ljava/nio/file/Path;- official - d- Lglg;d:Ljava/nio/file/Path;
 
- 
userApiServiceprivate final com.mojang.authlib.minecraft.UserApiService userApiService- Mappings:
- Namespace - Name - Mixin selector - named - userApiService- Lnet/minecraft/client/session/ProfileKeysImpl;userApiService:Lcom/mojang/authlib/minecraft/UserApiService;- intermediary - field_39958- Lnet/minecraft/class_7434;field_39958:Lcom/mojang/authlib/minecraft/UserApiService;- official - e- Lglg;e:Lcom/mojang/authlib/minecraft/UserApiService;
 
- 
jsonPath- Mappings:
- Namespace - Name - Mixin selector - named - jsonPath- Lnet/minecraft/client/session/ProfileKeysImpl;jsonPath:Ljava/nio/file/Path;- intermediary - field_39076- Lnet/minecraft/class_7434;field_39076:Ljava/nio/file/Path;- official - f- Lglg;f:Ljava/nio/file/Path;
 
- 
keyFuture- Mappings:
- Namespace - Name - Mixin selector - named - keyFuture- Lnet/minecraft/client/session/ProfileKeysImpl;keyFuture:Ljava/util/concurrent/CompletableFuture;- intermediary - field_39959- Lnet/minecraft/class_7434;field_39959:Ljava/util/concurrent/CompletableFuture;- official - g- Lglg;g:Ljava/util/concurrent/CompletableFuture;
 
- 
expiryCheckTime- Mappings:
- Namespace - Name - Mixin selector - named - expiryCheckTime- Lnet/minecraft/client/session/ProfileKeysImpl;expiryCheckTime:Ljava/time/Instant;- intermediary - field_40798- Lnet/minecraft/class_7434;field_40798:Ljava/time/Instant;- official - h- Lglg;h:Ljava/time/Instant;
 
 
- 
- 
Constructor Details- 
ProfileKeysImplpublic ProfileKeysImpl(com.mojang.authlib.minecraft.UserApiService userApiService, UUID uuid, Path root) - Mappings:
- Namespace - Name - Mixin selector - named - <init>- Lnet/minecraft/client/session/ProfileKeysImpl;<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- official - <init>- Lglg;<init>(Lcom/mojang/authlib/minecraft/UserApiService;Ljava/util/UUID;Ljava/nio/file/Path;)V
 
 
- 
- 
Method Details- 
fetchKeyPair- Specified by:
- fetchKeyPairin interface- ProfileKeys
- Mappings:
- Namespace - Name - Mixin selector - named - fetchKeyPair- Lnet/minecraft/client/session/ProfileKeys;fetchKeyPair()Ljava/util/concurrent/CompletableFuture;- intermediary - method_46522- Lnet/minecraft/class_7853;method_46522()Ljava/util/concurrent/CompletableFuture;- official - a- Lgmb;a()Ljava/util/concurrent/CompletableFuture;
 
- 
isExpiredpublic boolean isExpired()- Specified by:
- isExpiredin interface- ProfileKeys
- Mappings:
- Namespace - Name - Mixin selector - named - isExpired- Lnet/minecraft/client/session/ProfileKeys;isExpired()Z- intermediary - method_46523- Lnet/minecraft/class_7853;method_46523()Z- official - b- Lgmb;b()Z
 
- 
getKeyPairGets the key pair from the file cache, or if it is unavailable or expired, the Mojang server.- Mappings:
- Namespace - Name - Mixin selector - named - getKeyPair- Lnet/minecraft/client/session/ProfileKeysImpl;getKeyPair(Ljava/util/Optional;)Ljava/util/concurrent/CompletableFuture;- intermediary - method_43602- Lnet/minecraft/class_7434;method_43602(Ljava/util/Optional;)Ljava/util/concurrent/CompletableFuture;- official - a- Lglg;a(Ljava/util/Optional;)Ljava/util/concurrent/CompletableFuture;
 
- 
loadKeyPairFromFileReturns 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 - named - loadKeyPairFromFile- Lnet/minecraft/client/session/ProfileKeysImpl;loadKeyPairFromFile()Ljava/util/Optional;- intermediary - method_43606- Lnet/minecraft/class_7434;method_43606()Ljava/util/Optional;- official - c- Lglg;c()Ljava/util/Optional;
 
- 
saveKeyPairToFileSaves thekeyPairto the cache file ifSharedConstants.isDevelopmentistrue; otherwise, just deletes the cache file.- Mappings:
- Namespace - Name - Mixin selector - named - saveKeyPairToFile- Lnet/minecraft/client/session/ProfileKeysImpl;saveKeyPairToFile(Lnet/minecraft/network/encryption/PlayerKeyPair;)V- intermediary - method_43600- Lnet/minecraft/class_7434;method_43600(Lnet/minecraft/class_7427;)V- official - a- Lglg;a(Lcsl;)V
 
- 
fetchKeyPair@Nullable private @Nullable 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 - named - fetchKeyPair- Lnet/minecraft/client/session/ProfileKeysImpl;fetchKeyPair(Lcom/mojang/authlib/minecraft/UserApiService;)Lnet/minecraft/network/encryption/PlayerKeyPair;- intermediary - method_43605- Lnet/minecraft/class_7434;method_43605(Lcom/mojang/authlib/minecraft/UserApiService;)Lnet/minecraft/class_7427;- official - a- Lglg;a(Lcom/mojang/authlib/minecraft/UserApiService;)Lcsl;
 
- 
decodeKeyPairResponseprivate static PlayerPublicKey.PublicKeyData decodeKeyPairResponse(com.mojang.authlib.yggdrasil.response.KeyPairResponse keyPairResponse) throws NetworkEncryptionException ReturnskeyPairResponsedecoded toPlayerPublicKey.PublicKeyData.- Returns:
- keyPairResponsedecoded to- PlayerPublicKey.PublicKeyData
- Throws:
- NetworkEncryptionException- when the response is malformed
- Mappings:
- Namespace - Name - Mixin selector - named - decodeKeyPairResponse- Lnet/minecraft/client/session/ProfileKeysImpl;decodeKeyPairResponse(Lcom/mojang/authlib/yggdrasil/response/KeyPairResponse;)Lnet/minecraft/network/encryption/PlayerPublicKey$PublicKeyData;- intermediary - method_44076- Lnet/minecraft/class_7434;method_44076(Lcom/mojang/authlib/yggdrasil/response/KeyPairResponse;)Lnet/minecraft/class_7428$class_7443;- official - a- Lglg;a(Lcom/mojang/authlib/yggdrasil/response/KeyPairResponse;)Lcsm$a;
 
 
-