class EncryCredentialManagerImpl implements EncryCredentialManager {

	@Override
	public String encrypt(EncryCredentialInfo encryCredentialInfo) {
		StringBuffer sb = new StringBuffer();
		if(encryCredentialInfo!=null){
			try {
				String data = encryptSensitiveInfo(encryCredentialInfo);
				sb.append(data).append("?appId=").append(encryCredentialInfo.getAppId())
				.append("&keyId=").append(encryCredentialInfo.getKeyId());
				//再进行BASE64编码，避免传输错误。
				return URLEncoder.encode(Base64Coder.encryptBASE64(sb.toString().getBytes()), "UTF-8");
			} catch (Exception e) {
				LOGGER.log(Level.SEVERE, "encrypt data exception", e);
			}
		}
		return sb.toString();
	}

}