销毁管理密钥

This commit is contained in:
liulu 2026-03-10 16:21:01 +08:00
parent efec85a59c
commit 0eb857b6fa
2 changed files with 14 additions and 0 deletions

View File

@ -12,6 +12,7 @@ import com.cisd.tms.modules.mk.service.LmkService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@ -105,4 +106,10 @@ public class LmkController {
return ApiResponse.success(lmk);
}
@GetMapping("/destroyLMKAndIK")
public ApiResponse<String> destroyLMKAndIK() {
lmkService.destroyLMKAndIK();
return ApiResponse.success("主密钥和内部密钥销毁成功!");
}
}

View File

@ -200,4 +200,11 @@ public class LmkService {
return lmk;
}
public void destroyLMKAndIK() {
pcieCryptoService.destroyLmk();
pcieCryptoService.destroyIk(IKEnums.KEY_TYPE_AUTH.getCode());
pcieCryptoService.destroyIk(IKEnums.KEY_TYPE_DEVICE.getCode());
keyComponentList = null;
}
}