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:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user