密钥恢复

This commit is contained in:
liulu
2024-10-29 14:13:18 +08:00
parent e45f9624e4
commit 74ddfcae3c
4 changed files with 35 additions and 35 deletions
@@ -52,7 +52,7 @@ public class KeyInfoAsymController {
*/
@PostMapping("/backup")
public ResponseEntity<org.springframework.core.io.Resource> backupKey(@Valid @RequestBody KeyInfoDTO.Backup backup) {
backup.setKeyType(KeyCategory.SYM_KEY.getCode());
backup.setKeyType(KeyCategory.ASYM_KEY.getCode());
byte[] content = keyInfoService.backupKey(backup);
String fileName = String.join("-",
@@ -78,7 +78,7 @@ public class KeyInfoController {
@PostMapping("/recovery")
public R<String> recoveryKey(MultipartFile file) {
try {
String s = keyInfoService.recoveryKey(file.getBytes());
String s = keyInfoService.recoveryKey(file.getInputStream());
return R.ok(s);
} catch (IOException e) {
throw new SspwebException("获取文件内容异常");