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 esjintermediary net/minecraft/class_7434named net/minecraft/client/util/ProfileKeys
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Pathprivate final CompletableFuture<PlayerKeyPair>private static final org.slf4j.Loggerprivate static final Path -
Constructor Summary
ConstructorsConstructorDescriptionProfileKeys(com.mojang.authlib.minecraft.UserApiService userApiService, UUID uuid, Path root) -
Method Summary
Modifier and TypeMethodDescriptionReturns the SHA1withRSA signature instance used for signing, ornullif there is no private key associated with the profile.private PlayerKeyPairfetchKeyPair(com.mojang.authlib.minecraft.UserApiService userApiService) Returns the key pair fetched from Mojang's server.private CompletableFuture<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.private @Nullable PrivateKeyReturns the private key, ornullif there is no private key associated with the profile.Returns the public key, ornullif there is no public key associated with the profile.private Optional<PlayerKeyPair>Returns the profile keys from the local cache.private voidsaveKeyPairToFile(@Nullable PlayerKeyPair keyPair) Saves thekeyPairto the cache file.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER- Mappings:
Namespace Name Mixin selector official aLesj;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 bLesj;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;
-
jsonPath
- Mappings:
Namespace Name Mixin selector official cLesj;c: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;
-
keyPairFuture
- Mappings:
Namespace Name Mixin selector official dLesj;d:Ljava/util/concurrent/CompletableFuture;intermediary field_39077Lnet/minecraft/class_7434;field_39077:Ljava/util/concurrent/CompletableFuture;named keyPairFutureLnet/minecraft/client/util/ProfileKeys;keyPairFuture: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>Lesj;<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
-
getKeyPair
private CompletableFuture<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 aLesj;a(Lcom/mojang/authlib/minecraft/UserApiService;)Ljava/util/concurrent/CompletableFuture;intermediary method_43602Lnet/minecraft/class_7434;method_43602(Lcom/mojang/authlib/minecraft/UserApiService;)Ljava/util/concurrent/CompletableFuture;named getKeyPairLnet/minecraft/client/util/ProfileKeys;getKeyPair(Lcom/mojang/authlib/minecraft/UserApiService;)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 dLesj;d()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.- Mappings:
Namespace Name Mixin selector official aLesj;a(Lbsh;)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 bLesj;b(Lcom/mojang/authlib/minecraft/UserApiService;)Lbsh;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;
-
createSignatureInstance
Returns the SHA1withRSA signature instance used for signing, ornullif there is no private key associated with the profile.- Returns:
- the SHA1withRSA signature instance used for signing, or
nullif there is no private key associated with the profile - Throws:
GeneralSecurityException- when creation fails- See Also:
-
-
invalid @see
PlayerPublicKey.PublicKeyData#createSignatureInstance()
-
- API Note:
- Use {#link PlayerPublicKey.PublicKeyData#createSignatureInstance()} to create the signature for verifying the signatures.
- Mappings:
Namespace Name Mixin selector official aLesj;a()Ljava/security/Signature;intermediary method_43599Lnet/minecraft/class_7434;method_43599()Ljava/security/Signature;named createSignatureInstanceLnet/minecraft/client/util/ProfileKeys;createSignatureInstance()Ljava/security/Signature;
-
method_43784
- Mappings:
Namespace Name Mixin selector official bLesj;b()Ljava/util/Optional;intermediary method_43784Lnet/minecraft/class_7434;method_43784()Ljava/util/Optional;named method_43784Lnet/minecraft/client/util/ProfileKeys;method_43784()Ljava/util/Optional;
-
getPublicKey
Returns the public key, ornullif there is no public key associated with the profile.- Returns:
- the public key, or
nullif there is no public key associated with the profile - Mappings:
Namespace Name Mixin selector official cLesj;c()Lbsi;intermediary method_43603Lnet/minecraft/class_7434;method_43603()Lnet/minecraft/class_7428;named getPublicKeyLnet/minecraft/client/util/ProfileKeys;getPublicKey()Lnet/minecraft/network/encryption/PlayerPublicKey;
-
getPrivateKey
Returns the private key, ornullif there is no private key associated with the profile.- Returns:
- the private key, or
nullif there is no private key associated with the profile - Mappings:
Namespace Name Mixin selector official eLesj;e()Ljava/security/PrivateKey;intermediary method_43608Lnet/minecraft/class_7434;method_43608()Ljava/security/PrivateKey;named getPrivateKeyLnet/minecraft/client/util/ProfileKeys;getPrivateKey()Ljava/security/PrivateKey;
-