Class MinecraftEncryptionUtil
java.lang.Object
com.github.retrooper.packetevents.util.crypto.MinecraftEncryptionUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
decrypt
(String algorithm, PrivateKey privateKey, byte[] data) static byte[]
static byte[]
decryptRSA
(PrivateKey privateKey, byte[] data) This decrypts the specified byte data using RSA PKCS#1 padding.static byte[]
static byte[]
static byte[]
encryptRSA
(PublicKey publicKey, byte[] data) This encrypts the specified byte data using RSA PKCS#1 padding.static PublicKey
publicKey
(byte[] bytes)
-
Constructor Details
-
MinecraftEncryptionUtil
public MinecraftEncryptionUtil()
-
-
Method Details
-
decryptRSA
This decrypts the specified byte data using RSA PKCS#1 padding.- Parameters:
privateKey
- Private key from the server key pairdata
- Encrypted data- Returns:
- Decrypted data
-
encryptRSA
This encrypts the specified byte data using RSA PKCS#1 padding.- Parameters:
publicKey
- Public key from the server key pairdata
- Decrypted data- Returns:
- Encrypted data
-
decrypt
-
decrypt
-
encrypt
-
encrypt
-
publicKey
-