This commit is contained in:
liulu
2024-12-18 11:00:39 +08:00
parent f19891c39d
commit 36a2066542
9 changed files with 80 additions and 41 deletions
@@ -57,8 +57,8 @@ public class KeyInfoController {
@PostMapping("/create")
@AuditControllerLog(description = "创建密钥", operateType = AuditLogConst.ADD)
public R<String> save(@Valid @RequestBody KeyInfoDTO.KeySave save) {
Long id = keyInfoService.save(save);
return R.data(String.valueOf(id));
List<Long> ids = keyInfoService.save(save);
return R.data(String.valueOf(ids.get(0)));
}
/**
@@ -168,8 +168,7 @@ public class SingleSdfApiService implements SdfApiService, InitializingBean {
public byte[] encryptByTMK(byte[] data) {
checkKey();
byte[] pad = PaddingUtil.PKCS7Padding(data);
sdfApiAdapter.symEncrypt(sessionHandle, tmkHandle, AlgId.SGD_SM4_CBC, new byte[8], pad);
return new byte[0];
return sdfApiAdapter.symEncrypt(sessionHandle, tmkHandle, AlgId.SGD_SM4_CBC, new byte[8], pad);
}
@Override