enabled 추가

master
mjkhan21 2 months ago
parent dc6cfdbed1
commit c038e7bbc5

@ -43,6 +43,7 @@ public class GPKI extends AbstractComponent {
* @return * @return
*/ */
public String encrypt(String serverID, String data) { public String encrypt(String serverID, String data) {
if (!conf.enabled) return data;
if (isEmpty(data)) return ""; if (isEmpty(data)) return "";
try { try {
@ -62,6 +63,7 @@ public class GPKI extends AbstractComponent {
* @return * @return
*/ */
public String decrypt(String encrypted) { public String decrypt(String encrypted) {
if (!conf.enabled) return encrypted;
if (isEmpty(encrypted)) return ""; if (isEmpty(encrypted)) return "";
try { try {
@ -277,7 +279,7 @@ public class GPKI extends AbstractComponent {
* }</code></pre> * }</code></pre>
* @author mjkhan * @author mjkhan
*/ */
public static class Config extends AbstractComponent { public static class Config {
private static Config conf; private static Config conf;
public static Config get() { public static Config get() {
@ -291,6 +293,7 @@ public class GPKI extends AbstractComponent {
return conf; return conf;
} }
private boolean enabled;
private String private String
charset, charset,
license, license,
@ -301,6 +304,20 @@ public class GPKI extends AbstractComponent {
env, env,
sig; sig;
/** .
* @return
*/
public boolean isEnabled() {
return enabled;
}
/** .
* @param enabled
*/
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
/**charset() . /**charset() .
* @return charset * @return charset
*/ */

@ -1,6 +1,6 @@
{ {
"enabled": true, /* 활성화(사용) 여부 */
"license": "C:\\GPKI\\Lic", /* 이용기관 GPKI API 라이센스 디렉토리 */ "license": "C:\\GPKI\\Lic", /* 이용기관 GPKI API 라이센스 디렉토리 */
"charset": "UTF-8", /* 문자셋 */ "charset": "UTF-8", /* 문자셋 */
"server": { "server": {

Loading…
Cancel
Save