本文整理匯總了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);
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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 {
}