mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2024-06-28 10:44:44 +02:00
25 lines
900 B
Java
25 lines
900 B
Java
|
package net.raphimc.viaproxy.injection.transformer;
|
||
|
|
||
|
import com.mojang.authlib.yggdrasil.ServicesKeyInfo;
|
||
|
import com.mojang.authlib.yggdrasil.YggdrasilServicesKeyInfo;
|
||
|
import net.lenni0451.classtransform.annotations.CTransformer;
|
||
|
import net.lenni0451.classtransform.annotations.injection.COverride;
|
||
|
import net.lenni0451.reflect.stream.RStream;
|
||
|
import net.raphimc.netminecraft.netty.crypto.CryptUtil;
|
||
|
|
||
|
import java.security.PublicKey;
|
||
|
|
||
|
@CTransformer(YggdrasilServicesKeyInfo.class)
|
||
|
public abstract class YggdrasilServicesKeyInfoTransformer {
|
||
|
|
||
|
@COverride
|
||
|
public static ServicesKeyInfo createFromResources() {
|
||
|
try {
|
||
|
return RStream.of(YggdrasilServicesKeyInfo.class).constructors().by(PublicKey.class).newInstance(CryptUtil.MOJANG_PUBLIC_KEY);
|
||
|
} catch (Throwable e) {
|
||
|
throw new AssertionError("Missing/invalid yggdrasil public key!", e);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|