当前位置: 首页>>代码示例>>Java>>正文


Java AesException类代码示例

本文整理汇总了Java中com.qq.weixin.mp.aes.AesException的典型用法代码示例。如果您正苦于以下问题:Java AesException类的具体用法?Java AesException怎么用?Java AesException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AesException类属于com.qq.weixin.mp.aes包,在下文中一共展示了AesException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: contextInitialized

import com.qq.weixin.mp.aes.AesException; //导入依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent sce) {
	MyazureConstants.MYAZURE_APP_ID = MYAZURE_APP_ID;
	MyazureConstants.MYAZURE_APP_SECRET = MYAZURE_APP_SECRET;
	MyazureConstants.MYAZURE_ENCODE_TOKEN = MYAZURE_ENCODE_TOKEN;
	MyazureConstants.MYAZURE_ENCODE_KEY = MYAZURE_ENCODE_KEY;
	MyazureConstants.MYAZURE_APP_URL = MYAZURE_APP_URL;
	MyazureConstants.MYAZURE_SERVER_ID = MYAZURE_SERVER_ID;
	API.defaultMode(API.MODE_POPULAR);
	MyazureConstants.MYAZURE_COMPONENT_ACCESS_TOKEN = redisTemplate.opsForValue().get(WeixinConstans.COMPONENT_ACCESS_TOKEN_KEY);
	LocalHttpClient.init(1000, 100);
	try {
		MyazureConstants.MYAZUZRE_WXBIZMSGCRYPT = new WXBizMsgCrypt(MyazureConstants.MYAZURE_ENCODE_TOKEN, MyazureConstants.MYAZURE_ENCODE_KEY,
				MyazureConstants.MYAZURE_APP_ID);
	} catch (AesException e) {
		LOG.error(e.getMessage());
	}
	if (MyazureConstants.MYAZURE_APP_ID == null || MyazureConstants.MYAZURE_APP_SECRET == null || MyazureConstants.MYAZURE_ENCODE_TOKEN == null
			|| MyazureConstants.MYAZURE_ENCODE_KEY == null) {
		LOG.error("System Going Down|!!!!!!!!!!!!!!!!!!NULL!!!ID!!!!SECRET!!!!TOKEN!!!!!!KEY!!!!!");
	}
	LOG.debug("Myazure Weixin MYAZURE_COMPONENT_ACCESS_TOKEN:"+MyazureConstants.MYAZURE_COMPONENT_ACCESS_TOKEN);
}
 
开发者ID:Myazure,项目名称:weixin_component,代码行数:24,代码来源:SystemInitListener.java

示例2: acceptAuthorizeEvent

import com.qq.weixin.mp.aes.AesException; //导入依赖的package包/类
/**
 * 授权事件处理 1.授权成功 2.取消授权 3.更新授权 4.凭证发放
 * 
 * @param request
 * @param response
 * @throws IOException
 * @throws AesException
 */
@RequestMapping(path = "/event/authorize", method = RequestMethod.POST)
public void acceptAuthorizeEvent(HttpServletRequest request, HttpServletResponse response) throws IOException, AesException {
	ComponentReceiveXML eventMessage = myazureWeixinAPI.getEventMessage(request, response, ComponentReceiveXML.class);
	if (eventMessage == null) {
		outputStreamWrite(response.getOutputStream(), "false");
		return;
	}
	outputStreamWrite(response.getOutputStream(), "success");
	LOG.debug(MyazureConstants.LOG_SPLIT_LINE);
	LOG.debug(eventMessage.getInfoType());
	switch (eventMessage.getInfoType()) {
	case "component_verify_ticket":
		myazureWeixinAPI.refreshVerifyTicket(eventMessage);
		break;
	case "authorized":
		authorizeHandler.authorized(eventMessage);
		break;
	case "updateauthorized":
		authorizeHandler.updateauthorized(eventMessage);
		break;
	case "unauthorized":
		authorizeHandler.unauthorized(eventMessage);
		break;
	default:
		authorizeHandler.unknowEvent(eventMessage);
		break;
	}
	return;
}
 
开发者ID:Myazure,项目名称:weixin_component,代码行数:38,代码来源:MPController.java

示例3: MessageUtils

import com.qq.weixin.mp.aes.AesException; //导入依赖的package包/类
private MessageUtils(String token, String encodingAesKey, String appID) {
    try {
        this.enDeCrypter = new WXBizMsgCrypt(token, encodingAesKey, appID);
    } catch (AesException e) {
        LOGGER.error("init enDecrypter", e);
    }
}
 
开发者ID:oopschen,项目名称:sdk-weixin,代码行数:8,代码来源:MessageUtils.java

示例4: encryptMessage

import com.qq.weixin.mp.aes.AesException; //导入依赖的package包/类
/**
 * <p>加密消息</p>
 *
 * @param msg       消息实体
 * @param timeStamp 时间戳,可以自己生成,也可以用URL参数的timestamp
 * @param nonce     随机串,可以自己生成,也可以用URL参数的nonce
 */
public String encryptMessage(BaseContentMessage msg, String timeStamp, String nonce)
    throws AesException {
    if (null == msg || StringUtils.isBlank(timeStamp) || StringUtils.isBlank(nonce)
        || null == enDeCrypter) {
        return null;
    }

    return enDeCrypter.encryptMsg(msg.toString(), timeStamp, nonce);
}
 
开发者ID:oopschen,项目名称:sdk-weixin,代码行数:17,代码来源:MessageUtils.java

示例5: decryptAndValidationMessage

import com.qq.weixin.mp.aes.AesException; //导入依赖的package包/类
/**
 * <p>解密消息,如无加密则解析消息</p>
 *
 * @param msg 公众平台推送的消息
 * @return 消息实体
 */
public BaseMessage decryptAndValidationMessage(EncryptMessage msg) throws AesException {
    if (null == msg || StringUtils.isBlank(msg.getNonce()) || StringUtils
        .isBlank(msg.getTimeStamp()) || StringUtils.isBlank(msg.getSignature())) {
        return null;
    }

    String decodedMsg = enDeCrypter
        .decryptMsg(msg.getSignature(), msg.getTimeStamp(), msg.getNonce(), msg.toString());
    if (StringUtils.isBlank(decodedMsg)) {
        return null;
    }

    return parseMessage(decodedMsg);
}
 
开发者ID:oopschen,项目名称:sdk-weixin,代码行数:21,代码来源:MessageUtils.java

示例6: privateMassSendTextMsg

import com.qq.weixin.mp.aes.AesException; //导入依赖的package包/类
@RequestMapping(path = "/private/masssend", method = RequestMethod.POST)
public void privateMassSendTextMsg(  HttpServletRequest request, HttpServletResponse response) throws IOException,
		AesException {

}
 
开发者ID:Myazure,项目名称:weixin_component,代码行数:6,代码来源:MassSendController.java


注:本文中的com.qq.weixin.mp.aes.AesException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。