SubServers-2/SubServers.Host/src/net/ME1312/SubServers/Host/Network/Cipher.java
ME1312 75b9b688cc Rewrite SubData API for JSON dependancy changes
This commit removes the org.JSON library where alternatives are already provided (Bungee & Bukkit provide Gson). This change was made to improve compatability with BungeeCord plugins and reduce file sizes.

This means big changes to the SubData API, which heavily relied on org.JSON. Now we submit our data through YAMLSection to be converted and sent over the network.
2018-04-14 21:53:51 -04:00

34 lines
746 B
Java

package net.ME1312.SubServers.Host.Network;
import net.ME1312.SubServers.Host.Library.Config.YAMLSection;
/**
* SubData Cipher Layout Class
*/
public interface Cipher {
/**
* Get the name of this Cipher
*
* @return Cipher Name
*/
String getName();
/**
* Encrypt JSON Data
*
* @param key Key to Encrypt Data with
* @param data Data to Encrypt
* @return Encrypted Data Array
*/
byte[] encrypt(String key, YAMLSection data) throws Exception;
/**
* Decrypt Encrypted JSON Data
*
* @param key Key to Decrypt Data with
* @param data Encrypted Data Array
* @return JSON Data
*/
YAMLSection decrypt(String key, byte[] data) throws Exception;
}