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 Cipher
cipherFromKey(int opMode, Key key)
private static Cipher
crypt(int opMode, String algorithm, Key key)
private static byte[]
crypt(int opMode, Key key, byte[] data)
static byte[]
decrypt(Key key, byte[] data)
static SecretKey
decryptSecretKey(PrivateKey privateKey, byte[] encryptedSecretKey)
static byte[]
encrypt(Key key, byte[] data)
static SecretKey
generateKey()
static byte[]
generateServerId(String baseServerId, PublicKey publicKey, SecretKey secretKey)
static KeyPair
generateServerKeyPair()
private static byte[]
hash(byte[][] byte2)
static PublicKey
readEncodedPublicKey(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
-