public class NetworkEncryptionUtils extends Object
Constructor and Description |
---|
NetworkEncryptionUtils() |
Modifier and Type | Method and Description |
---|---|
static Cipher |
cipherFromKey(int opMode,
Key key) |
private static byte[] |
crypt(int opMode,
Key key,
byte[] data) |
private static Cipher |
crypt(int opMode,
String algorithm,
Key key) |
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(String algorithm,
byte[][] data) |
static PublicKey |
readEncodedPublicKey(byte[] byte2) |
private static final Logger LOGGER
@Environment(value=CLIENT) public static SecretKey generateKey()
public static KeyPair generateServerKeyPair()
public static byte[] generateServerId(String baseServerId, PublicKey publicKey, SecretKey secretKey)
private static byte[] hash(String algorithm, byte[][] data)
public static PublicKey readEncodedPublicKey(byte[] byte2)
public static SecretKey decryptSecretKey(PrivateKey privateKey, byte[] encryptedSecretKey)
@Environment(value=CLIENT) public static byte[] encrypt(Key key, byte[] data)
public static byte[] decrypt(Key key, byte[] data)
private static byte[] crypt(int opMode, Key key, byte[] data)