package cn.config;

import org.jasypt.encryption.StringEncryptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import cn.security.jasypt.JasyptUtil;

/**
 * see  加密
 * */
@Configuration
@Component("desencrypt")
public class JasyptConfig implements StringEncryptor 
{
	@Value("${jasypt.decrypt.url}")
	private String decryptUrl;
	
	@Override
	public String decrypt(String ciphertext) {
		return JasyptUtil.decode(ciphertext);
	}

	@Override
	public String encrypt(String message) {
		return JasyptUtil.encode(message);
	}
}