mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-08 04:39:00 +08:00
♻️ Refactoring code. common-encry-api 支持国密算法
This commit is contained in:
1 parent
3f2b9bf214
commit
1020954ec0
1 file changed
+8
-6
+8
-6
@@ -18,12 +18,14 @@ public class DefaultSecretKeyResolver implements ISecretKeyResolver {
|
||||
|
||||
@Override
|
||||
public String getSecretKey(HttpServletRequest request, EncryptType encryptType) {
|
||||
return switch (encryptType) {
|
||||
case SM4 -> properties.getSm4Key();
|
||||
case DES -> properties.getDesKey();
|
||||
case RSA -> properties.getRsaPrivateKey();
|
||||
default -> properties.getAesKey();
|
||||
};
|
||||
switch (encryptType) {
|
||||
case DES:
|
||||
return properties.getDesKey();
|
||||
case RSA:
|
||||
return properties.getRsaPrivateKey();
|
||||
default:
|
||||
return properties.getAesKey();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user