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(byte[][] byte2) |
static PublicKey |
readEncodedPublicKey(byte[] byte2) |
@Environment(value=CLIENT) public static SecretKey generateKey() throws NetworkEncryptionException
NetworkEncryptionExceptionpublic static KeyPair generateServerKeyPair() throws NetworkEncryptionException
NetworkEncryptionExceptionpublic static byte[] generateServerId(String baseServerId, PublicKey publicKey, SecretKey secretKey) throws NetworkEncryptionException
NetworkEncryptionException@Environment(value=CLIENT) public static PublicKey readEncodedPublicKey(byte[] byte2) throws NetworkEncryptionException
NetworkEncryptionExceptionpublic static SecretKey decryptSecretKey(PrivateKey privateKey, byte[] encryptedSecretKey) throws NetworkEncryptionException
NetworkEncryptionException@Environment(value=CLIENT) public static byte[] encrypt(Key key, byte[] data) throws NetworkEncryptionException
NetworkEncryptionExceptionpublic static byte[] decrypt(Key key, byte[] data) throws NetworkEncryptionException
NetworkEncryptionExceptionprivate static byte[] crypt(int opMode,
Key key,
byte[] data)
throws NetworkEncryptionException
NetworkEncryptionExceptionprivate static Cipher crypt(int opMode, String algorithm, Key key) throws Exception
Exceptionpublic static Cipher cipherFromKey(int opMode, Key key) throws NetworkEncryptionException
NetworkEncryptionException