Use class loader for loading the session key

Related #849
This commit is contained in:
games647
2022-07-17 16:53:58 +02:00
parent 18a8d7a5dc
commit e338a768ca

View File

@ -25,6 +25,7 @@
*/
package com.github.games647.fastlogin.bukkit.listener.protocollib;
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
import com.github.games647.fastlogin.bukkit.listener.protocollib.packet.ClientPublicKey;
import com.google.common.hash.Hasher;
import com.google.common.hash.Hashing;
@ -176,7 +177,7 @@ final class EncryptionUtil {
private static PublicKey loadMojangSessionKey()
throws IOException, NoSuchAlgorithmException, InvalidKeySpecException {
var keyUrl = Resources.getResource("yggdrasil_session_pubkey.der");
var keyUrl = FastLoginBukkit.class.getClassLoader().getResource("yggdrasil_session_pubkey.der");
var keyData = Resources.toByteArray(keyUrl);
var keySpec = new X509EncodedKeySpec(keyData);