- 기본 charset 을 UTF-8 로 변경
- DamoManager CHARSET 상수/javadoc 갱신 - README 내 charset 표기 동기화 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -29,7 +29,7 @@ gradle runFakeSmoke
|
||||
|---|---|---|
|
||||
| `INI_FILE` | scpdb 에 전달할 ini 경로 | `/prod/damo/ba_scp/scpdb_agent.ini` |
|
||||
| `KEY` | `ScpEncB64`/`ScpDecB64` 의 키 이름 | `KEY1` |
|
||||
| `CHARSET` | scpdb 호출 시 charset 인자 | `EUC-KR` |
|
||||
| `CHARSET` | scpdb 호출 시 charset 인자 | `UTF-8` |
|
||||
| `SHA256`, `SHA512` | 해시 type 상수 | `71`, `73` |
|
||||
|
||||
새 scpdb 메서드를 래핑하려면 다음 4 곳을 동기화한다.
|
||||
@@ -130,9 +130,9 @@ int rc = damo.getReturnCode(); // 0: 성공, -1:
|
||||
|
||||
| 메서드 | 운영 동작 | Fake 동작 |
|
||||
|---|---|---|
|
||||
| `String encrypt(String plain)` | `ScpEncB64(INI_FILE, "KEY1", plain, "EUC-KR")` | `Base64.encode(plain.getBytes("EUC-KR"))` |
|
||||
| `String decrypt(String b64)` | `ScpDecB64(INI_FILE, "KEY1", b64, "EUC-KR")` | `new String(Base64.decode(b64), "EUC-KR")` |
|
||||
| `String hash(int type, String src)` | `ScpHashB64(type, src, "EUC-KR")` | `MessageDigest(SHA-256/512).digest(src) → Base64` |
|
||||
| `String encrypt(String plain)` | `ScpEncB64(INI_FILE, "KEY1", plain, "UTF-8")` | `Base64.encode(plain.getBytes("UTF-8"))` |
|
||||
| `String decrypt(String b64)` | `ScpDecB64(INI_FILE, "KEY1", b64, "UTF-8")` | `new String(Base64.decode(b64), "UTF-8")` |
|
||||
| `String hash(int type, String src)` | `ScpHashB64(type, src, "UTF-8")` | `MessageDigest(SHA-256/512).digest(src) → Base64` |
|
||||
|
||||
해시 `type` 상수:
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ import java.util.Base64;
|
||||
* fake 모드 진입 시 클래스 로딩 시점에 System.err 로 강한 경고 배너 출력.
|
||||
*
|
||||
* fake 모드 동작:
|
||||
* - encrypt(s) : Base64.encode(s.getBytes(EUC-KR)) -- 암호화 없음
|
||||
* - decrypt(s) : new String(Base64.decode(s), EUC-KR)
|
||||
* - encrypt(s) : Base64.encode(s.getBytes(UTF-8)) -- 암호화 없음
|
||||
* - decrypt(s) : new String(Base64.decode(s), UTF-8)
|
||||
* - hash(t, s) : SHA-256(71) / SHA-512(73) JRE MessageDigest -> Base64
|
||||
*/
|
||||
public class DamoManager {
|
||||
@@ -24,7 +24,7 @@ public class DamoManager {
|
||||
|
||||
private static final String INI_FILE = "/prod/damo/ba_scp/scpdb_agent.ini";
|
||||
private static final String KEY = "KEY1";
|
||||
private static final String CHARSET = "EUC-KR";
|
||||
private static final String CHARSET = "UTF-8";
|
||||
|
||||
private static final int SCP_OK = 0;
|
||||
private static final int SCP_FAIL = -1;
|
||||
|
||||
Reference in New Issue
Block a user