添加加密器配置.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
package com.orion.ops.framework.security.core.crypto;
|
package com.orion.ops.framework.common.crypto;
|
||||||
|
|
||||||
import com.orion.lang.utils.crypto.symmetric.SymmetricCrypto;
|
import com.orion.lang.utils.crypto.symmetric.SymmetricCrypto;
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.orion.ops.framework.security.config;
|
package com.orion.ops.framework.security.config;
|
||||||
|
|
||||||
|
import com.orion.ops.framework.common.crypto.ValueCrypto;
|
||||||
import com.orion.ops.framework.common.utils.CryptoUtils;
|
import com.orion.ops.framework.common.utils.CryptoUtils;
|
||||||
import com.orion.ops.framework.security.core.crypto.ValueCrypto;
|
|
||||||
import com.orion.ops.framework.security.core.crypto.aes.AesCryptoProcessor;
|
import com.orion.ops.framework.security.core.crypto.aes.AesCryptoProcessor;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
@@ -32,8 +32,7 @@ public class OrionCryptoAutoConfiguration {
|
|||||||
@Bean(initMethod = "init")
|
@Bean(initMethod = "init")
|
||||||
@ConditionalOnProperty(value = "orion.crypto.aes.enabled", havingValue = "true")
|
@ConditionalOnProperty(value = "orion.crypto.aes.enabled", havingValue = "true")
|
||||||
public ValueCrypto aes() {
|
public ValueCrypto aes() {
|
||||||
AesCryptoProcessor processor = new AesCryptoProcessor(config.getAes());
|
ValueCrypto processor = new AesCryptoProcessor(config.getAes());
|
||||||
processor.init();
|
|
||||||
// 设置工具委托类 委托需要与 @Primary 相同, 否则会导致工具类和bean的结果不同
|
// 设置工具委托类 委托需要与 @Primary 相同, 否则会导致工具类和bean的结果不同
|
||||||
CryptoUtils.delegate = processor;
|
CryptoUtils.delegate = processor;
|
||||||
return processor;
|
return processor;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.orion.ops.framework.security.core.crypto;
|
package com.orion.ops.framework.security.core.crypto;
|
||||||
|
|
||||||
|
import com.orion.ops.framework.common.crypto.ValueCrypto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据加密器
|
* 数据加密器
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user