diff --git a/Match-Api/src/main/java/com/example/matchapi/order/helper/DataEncrypt.java b/Match-Api/src/main/java/com/example/matchapi/order/helper/DataEncrypt.java new file mode 100644 index 00000000..bba621ea --- /dev/null +++ b/Match-Api/src/main/java/com/example/matchapi/order/helper/DataEncrypt.java @@ -0,0 +1,35 @@ +package com.example.matchapi.order.helper; + +import org.apache.commons.codec.binary.Hex; +import org.springframework.stereotype.Service; + +import java.security.MessageDigest; + +@Service +public class DataEncrypt{ + MessageDigest md; + String strSRCData = ""; + String strENCData = ""; + String strOUTData = ""; + + public DataEncrypt(){ } + public String encrypt(String strData){ + String passACL = null; + MessageDigest md = null; + try{ + md = MessageDigest.getInstance("SHA-256"); + md.reset(); + md.update(strData.getBytes()); + byte[] raw = md.digest(); + passACL = encodeHex(raw); + }catch(Exception e){ + System.out.print("암호화 에러" + e.toString()); + } + return passACL; + } + + public String encodeHex(byte [] b){ + char [] c = Hex.encodeHex(b); + return new String(c); + } +} \ No newline at end of file diff --git a/Match-Domain/src/main/java/com/example/matchdomain/redis/entity/OrderRequest.java b/Match-Domain/src/main/java/com/example/matchdomain/redis/entity/OrderRequest.java index 06a5e610..356bf36a 100644 --- a/Match-Domain/src/main/java/com/example/matchdomain/redis/entity/OrderRequest.java +++ b/Match-Domain/src/main/java/com/example/matchdomain/redis/entity/OrderRequest.java @@ -22,6 +22,7 @@ public class OrderRequest { + @TimeToLive private long ttl;