com.alibaba.csp.ahas.switchcenter.SimpleAcmDecryptor Maven / Gradle / Ivy
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