From c038e7bbc5aa669e83035dad29da4ee59c9629ec Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Fri, 20 Sep 2024 09:56:32 +0900 Subject: [PATCH] =?UTF-8?q?enabled=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cokr/xit/interfaces/gpki/GPKI.java | 19 ++++++++++++++++++- src/main/resources/intf-conf/gpki.conf | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/main/java/cokr/xit/interfaces/gpki/GPKI.java b/src/main/java/cokr/xit/interfaces/gpki/GPKI.java index a0448e7..bf79e3c 100644 --- a/src/main/java/cokr/xit/interfaces/gpki/GPKI.java +++ b/src/main/java/cokr/xit/interfaces/gpki/GPKI.java @@ -43,6 +43,7 @@ public class GPKI extends AbstractComponent { * @return 지정한 아이디의 서버인증서로 암호화한 문자열 */ public String encrypt(String serverID, String data) { + if (!conf.enabled) return data; if (isEmpty(data)) return ""; try { @@ -62,6 +63,7 @@ public class GPKI extends AbstractComponent { * @return 복호화한 문자열 */ public String decrypt(String encrypted) { + if (!conf.enabled) return encrypted; if (isEmpty(encrypted)) return ""; try { @@ -277,7 +279,7 @@ public class GPKI extends AbstractComponent { * } * @author mjkhan */ - public static class Config extends AbstractComponent { + public static class Config { private static Config conf; public static Config get() { @@ -291,6 +293,7 @@ public class GPKI extends AbstractComponent { return conf; } + private boolean enabled; private String charset, license, @@ -301,6 +304,20 @@ public class GPKI extends AbstractComponent { env, sig; + /**활성화 여부를 반환한다. + * @return 활성화 여부 + */ + public boolean isEnabled() { + return enabled; + } + + /**활성화 여부를 설정한다. + * @param enabled 활성화 여부 + */ + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + /**charset을(를) 반환한다. * @return charset */ diff --git a/src/main/resources/intf-conf/gpki.conf b/src/main/resources/intf-conf/gpki.conf index 0d27005..feaa3de 100644 --- a/src/main/resources/intf-conf/gpki.conf +++ b/src/main/resources/intf-conf/gpki.conf @@ -1,6 +1,6 @@ { + "enabled": true, /* 활성화(사용) 여부 */ "license": "C:\\GPKI\\Lic", /* 이용기관 GPKI API 라이센스 디렉토리 */ - "charset": "UTF-8", /* 문자셋 */ "server": {