21 changed files with 49 additions and 20 deletions
@ -0,0 +1,29 @@ |
|||||
|
package com.bnyer.system.config; |
||||
|
|
||||
|
import com.bnyer.common.core.utils.Sm4Util; |
||||
|
import lombok.Getter; |
||||
|
import lombok.Setter; |
||||
|
import org.springframework.beans.factory.annotation.Value; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
|
||||
|
import javax.annotation.PostConstruct; |
||||
|
import java.util.Objects; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @author chengkun |
||||
|
* @date 2022/04/27 16:40 |
||||
|
*/ |
||||
|
@Configuration |
||||
|
@Getter |
||||
|
@Setter |
||||
|
public class Sm4Config { |
||||
|
@Value("${encryption.sm4.key}") |
||||
|
private String key ; |
||||
|
|
||||
|
@PostConstruct |
||||
|
public void init(){ |
||||
|
Objects.requireNonNull(key,"encryption.sm4.key is null"); |
||||
|
Sm4Util.utilInit(key); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue