Giter Club home page Giter Club logo

Comments (3)

jiwan2004 avatar jiwan2004 commented on August 29, 2024

使用微信测试接口发送数据,兼容模式都可以看到明文。改为安全模式,无法使用

from wechat4j.

sionsxie avatar sionsxie commented on August 29, 2024

java权限策略问题 官方例子加密例子里有的

AES KeySize异常解决方案

如果出现异常java.security.InvalidKeyException:illegal Key Size,在官方网站下载JCE无限制权限策略文件,解压后拷贝local_policy.jar和US_export_policy.jar到
<%JRE%>\lib\security目录下覆盖原来的文件。

from wechat4j.

sionsxie avatar sionsxie commented on August 29, 2024

还有就是WechatSupport类里没有对加密解密相关的做处理要自己写

`/**
* wechat调用入口,进行数据接收,事件分发
* @return
*/
public String execute(){
logger.debug("WechatSupport run");
SignatureParam param = new SignatureParam(request);
String signature =param.getSignature();
String timestamp = param.getTimestamp();
String nonce = param.getNonce();
String echostr = param.getEchostr();
String encrypt_type = request.getParameter(ENCRYPT_TYPE);
String token = Config.instance().getToken();

	ValidateSignature validateSignature = new ValidateSignature(signature, 
			timestamp, nonce, token);
	//////////////////////////////// 修改部分
	if(!validateSignature.check()){
		return "error";
	}
	if(StringUtils.isNotBlank(echostr)){
 		return echostr;
	}
	//分发消息,得到响应
	String result;
	if(StringUtils.equals(encrypt_type, "aes")){//aes方式加解密
		result = dispatchSign(timestamp, nonce);
	}else{
		result = dispatch();
	}
	logger.info("response data:" + result);
	////////////////////////////////
	return result;
}`

from wechat4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.