All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alibaba.csp.ahas.switchcenter.SimpleAcmDecryptor Maven / Gradle / Ivy

There is a newer version: 1.2.2
Show newest version
package com.alibaba.csp.ahas.switchcenter;

import com.taobao.csp.ahas.auth.api.AuthUtil;
import com.taobao.csp.switchcenter.acm.AcmDecryptor;
import com.taobao.csp.switchcenter.log.SwitchRecordLog;

public class SimpleAcmDecryptor implements AcmDecryptor {

	@Override
	public String decrypt(String source) {
		if (source == null) {
			return source;
		}
		try {
			return AuthUtil.decrypt(AuthUtil.getSecretKey(), source);
		} catch (Exception e) {
			// decrypt fail, try return original source
			SwitchRecordLog.info("decrypt fail, will use source as it is", e);
			return source;
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy