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 { try {
String sensorConfigJsonStr = this.objectMapper.writeValueAsString(sensorConfig); String sensorConfigJsonStr = this.objectMapper.writeValueAsString(sensorConfig);
// gzip // gzip
ByteArrayOutputStream bos = new ByteArrayOutputStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream(sensorConfigJsonStr.length());
GZIPOutputStream gzip = new GZIPOutputStream(bos); GZIPOutputStream gzip = new GZIPOutputStream(bos);
gzip.write(sensorConfigJsonStr.getBytes("UTF-8")); gzip.write(sensorConfigJsonStr.getBytes("UTF-8"));
gzip.flush(); gzip.flush();
gzip.close(); gzip.close();
byte[] compressedByte = bos.toByteArray(); byte[] compressedByte = bos.toByteArray();
bos.close();
// DES encryption // DES encryption
Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding"); Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding");