mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-10 07:02:47 +08:00
fix(storage): 存储管理 S3 存储功能修复 (#51)
1、S3存储管理功能及文件上传回显测试通过 2、修复S3协议存储无法编辑 3、对S3私钥配置信息脱密
This commit is contained in:
@@ -31,9 +31,11 @@ public class RsaProperties {
|
||||
* 私钥
|
||||
*/
|
||||
public static final String PRIVATE_KEY;
|
||||
public static final String PUBLIC_KEY;
|
||||
|
||||
static {
|
||||
PRIVATE_KEY = SpringUtil.getProperty("continew-starter.security.crypto.private-key");
|
||||
PUBLIC_KEY = SpringUtil.getProperty("continew-starter.security.crypto.public-key");
|
||||
}
|
||||
|
||||
private RsaProperties() {
|
||||
|
@@ -44,6 +44,18 @@ public class SecureUtils {
|
||||
return Base64.encode(SecureUtil.rsa(null, publicKey).encrypt(data, KeyType.PublicKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 公钥加密
|
||||
*
|
||||
* @param data 要加密的内容
|
||||
* @return 公钥加密并 Base64 加密后的内容
|
||||
*/
|
||||
public static String encryptByRsaPublicKey(String data) {
|
||||
String publicKey = RsaProperties.PUBLIC_KEY;
|
||||
ValidationUtils.throwIfBlank(publicKey, "请配置 RSA 公钥");
|
||||
return encryptByRsaPublicKey(data, publicKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 私钥解密
|
||||
*
|
||||
|
Reference in New Issue
Block a user