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": {