Class MinecraftEncryptionUtil

java.lang.Object
com.github.retrooper.packetevents.util.crypto.MinecraftEncryptionUtil

public class MinecraftEncryptionUtil extends Object
  • Constructor Details

    • MinecraftEncryptionUtil

      public MinecraftEncryptionUtil()
  • Method Details

    • decryptRSA

      public static byte[] decryptRSA(PrivateKey privateKey, byte[] data)
      This decrypts the specified byte data using RSA PKCS#1 padding.
      Parameters:
      privateKey - Private key from the server key pair
      data - Encrypted data
      Returns:
      Decrypted data
    • encryptRSA

      public static byte[] encryptRSA(PublicKey publicKey, byte[] data)
      This encrypts the specified byte data using RSA PKCS#1 padding.
      Parameters:
      publicKey - Public key from the server key pair
      data - Decrypted data
      Returns:
      Encrypted data
    • decrypt

      public static byte[] decrypt(Cipher cipher, byte[] data)
    • decrypt

      public static byte[] decrypt(String algorithm, PrivateKey privateKey, byte[] data)
    • encrypt

      public static byte[] encrypt(String algorithm, PublicKey publicKey, byte[] data)
    • encrypt

      public static byte[] encrypt(Cipher cipher, byte[] data)
    • publicKey

      public static PublicKey publicKey(byte[] bytes)