sensorconfig encryption

This commit is contained in:
insanity 2018-07-02 21:10:49 +09:00
parent d9576bf275
commit ffcc2407cb

View File

@ -73,12 +73,13 @@ public class CentralSensorConfigService {
try {
String sensorConfigJsonStr = this.objectMapper.writeValueAsString(sensorConfig);
// gzip
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ByteArrayOutputStream bos = new ByteArrayOutputStream(sensorConfigJsonStr.length());
GZIPOutputStream gzip = new GZIPOutputStream(bos);
gzip.write(sensorConfigJsonStr.getBytes("UTF-8"));
gzip.flush();
gzip.close();
byte[] compressedByte = bos.toByteArray();
bos.close();
// DES encryption
Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");