♻️ Refactoring code. common-encry-api 支持国密算法

This commit is contained in:
lbw committed 2023-09-01 14:21:15 +08:00
1 parent 3f2b9bf214
commit 1020954ec0
1 file changed
+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();
}
}
}