package com.ruoyi.common.third.properties;

import com.ruoyi.common.third.constants.EncryptConstants;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConfigurationProperties(SecureEncryptProperties.PREFIX)
public class SecureEncryptProperties {
	/**
	 * 前缀
	 */
	public static final String PREFIX = "third-switch.secure.encrypt";

	/**
	 * 是否开启加密
	 */
	private Boolean enabled = Boolean.TRUE;

	/**
	 * 是否 开启签名
	 * */
	private Boolean enabledEncryptSign = Boolean.TRUE;

	/**data 加密的字符串 放置在此 属性名称*/
	private String data = EncryptConstants.ENCRYPT_DATA;
	/** sign  签名字符串 放置在此 属性名称*/
	private String sign = EncryptConstants.ENCRYPT_SIGN;
	/** key sm4对称加密 放置在此 属性名称*/
	private String key = EncryptConstants.ENCRYPT_KEY;
	/** key sm4对称加密 cbc模式下，iv属性名称*/
	private String iv = EncryptConstants.ENCRYPT_IV;

	/***
	 * 开启加密之后，请求判断header 是有不存在此属性或者等于0 时不加解密；等于1 加解密
	 *
	 * */
	private String headerEncrypt = EncryptConstants.ENCRYPT_HEADER;

	/**
	 * 数据传输加密中SM4算法是否使用cbc模式
	 * */
	private Boolean enableEncryptCbcMode = true;

	public Boolean getEnabled() {
		return enabled;
	}

	public void setEnabled(Boolean enabled) {
		this.enabled = enabled;
	}

	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public Boolean getEnabledEncryptSign() {
		return enabledEncryptSign;
	}

	public void setEnabledEncryptSign(Boolean enabledEncryptSign) {
		this.enabledEncryptSign = enabledEncryptSign;
	}

	public String getHeaderEncrypt() {
		return headerEncrypt;
	}

	public void setHeaderEncrypt(String headerEncrypt) {
		this.headerEncrypt = headerEncrypt;
	}

	public Boolean getEnableEncryptCbcMode() {
		return enableEncryptCbcMode;
	}

	public void setEnableEncryptCbcMode(Boolean enableEncryptCbcMode) {
		this.enableEncryptCbcMode = enableEncryptCbcMode;
	}

	public String getIv() {
		return iv;
	}

	public void setIv(String iv) {
		this.iv = iv;
	}
}
