This commit is contained in:
liulu
2024-12-20 10:34:08 +08:00
parent 427df73a40
commit e3bf63ddef
9 changed files with 98 additions and 13 deletions
@@ -8,6 +8,8 @@ import com.sunyard.chsm.utils.CodecUtils;
*/
public interface CryptoConst {
byte[] iv = CodecUtils.decodeHex("30303030303030303030303030303030");
static byte[] iv() {
return CodecUtils.decodeHex("30303030303030303030303030303030");
}
}
@@ -134,6 +134,10 @@ public class TmkService {
cipher = EccCipher.fromHex(check.getEncTmk());
log.debug("device serial, pubKey not changed, use origin device enc tmk");
} else {
if (DeviceTmkStatus.finished.name().equals(check.getTmkStatus())) {
res.setStatus(DeviceTmkStatus.available);
return res;
}
log.debug("device serial, pubKey is changed, or no tmk in origin device");
Device device = getOneByStatus(DeviceTmkStatus.finished);
Assert.notNull(device, "系统主密钥设备异常,请联系管理员排查");