feat: HSM main/slave certificate comparison with batch SQL generation

- compare usercert_tab by subject raw bytes + certtype
- generate single annotated CSV report
- generate merge-<timestamp>.sql in current directory for DBA execution
- preserve GBK DN bytes via ATTACH + INSERT OR REPLACE / UPDATE
- compatible with sqlite3 3.6.20 and JDK 1.8
This commit is contained in:
cheney
2026-11-04 15:18:42 +08:00
commit fe28ddeaac
38 changed files with 4952 additions and 0 deletions
@@ -0,0 +1,28 @@
package com.sunyard.certcompare.model;
/**
* 人工合并选择。报表中显示为“主”/“备”,内部使用枚举,SQL 中只出现 MAIN/SLAVE。
*/
public enum MergeChoice {
MAIN("主"),
SLAVE("备");
public final String label;
MergeChoice(String label) {
this.label = label;
}
public static MergeChoice fromText(String text) {
if (text == null) {
return null;
}
String t = text.trim();
for (MergeChoice c : values()) {
if (c.label.equals(t) || c.name().equalsIgnoreCase(t)) {
return c;
}
}
return null;
}
}