Package net.minecraft.network
Class NetworkEncryptionUtils
java.lang.Object
net.minecraft.network.NetworkEncryptionUtils
public class NetworkEncryptionUtils extends Object
-
Constructor Summary
Constructors Constructor Description NetworkEncryptionUtils() -
Method Summary
Modifier and Type Method Description static CiphercipherFromKey(int opMode, Key key)private static Ciphercrypt(int opMode, String algorithm, Key key)private static byte[]crypt(int opMode, Key key, byte[] data)static byte[]decrypt(Key key, byte[] data)static SecretKeydecryptSecretKey(PrivateKey privateKey, byte[] encryptedSecretKey)static byte[]encrypt(Key key, byte[] data)static SecretKeygenerateKey()static byte[]generateServerId(String baseServerId, PublicKey publicKey, SecretKey secretKey)static KeyPairgenerateServerKeyPair()private static byte[]hash(byte[][] byte2)static PublicKeyreadEncodedPublicKey(byte[] byte2)
-
Constructor Details
-
NetworkEncryptionUtils
public NetworkEncryptionUtils()
-
-
Method Details
-
generateKey
- Throws:
NetworkEncryptionException
-
generateServerKeyPair
- Throws:
NetworkEncryptionException
-
generateServerId
public static byte[] generateServerId(String baseServerId, PublicKey publicKey, SecretKey secretKey) throws NetworkEncryptionException- Throws:
NetworkEncryptionException
-
hash
- Throws:
Exception
-
readEncodedPublicKey
@Environment(CLIENT) public static PublicKey readEncodedPublicKey(byte[] byte2) throws NetworkEncryptionException- Throws:
NetworkEncryptionException
-
decryptSecretKey
public static SecretKey decryptSecretKey(PrivateKey privateKey, byte[] encryptedSecretKey) throws NetworkEncryptionException- Throws:
NetworkEncryptionException
-
encrypt
@Environment(CLIENT) public static byte[] encrypt(Key key, byte[] data) throws NetworkEncryptionException- Throws:
NetworkEncryptionException
-
decrypt
- Throws:
NetworkEncryptionException
-
crypt
- Throws:
NetworkEncryptionException
-
crypt
- Throws:
Exception
-
cipherFromKey
- Throws:
NetworkEncryptionException
-