加密算法时报错:Illegal key size or default parameters

项目中加密算法时报错:Illegal key size or default parameters
在java中可能会面临需要加密 解密传输一些数据信息, 最近我就在项目中用到加密算法AES, 然而在启动项目时,给我报错了

cn.hnisi.wx.core.exception.AppException: java.security.InvalidKeyException: Illegal key size or default parameters
    at cn.hnisi.wx.server.validateface.ValidateFaceService.getDetectInfo(ValidateFaceService.java:404) ~[classes/:na]
    at cn.hnisi.wx.server.validateface.ValidateFaceService.saveTokenDetail(ValidateFaceService.java:88) ~[classes/:na]
    at cn.hnisi.wx.server.validateface.ValidateFaceService$$FastClassBySpringCGLIB$$26e78a3d.invoke(<generated>) ~[classes/:na]at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE]
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) ~[spring-aop-5.0.7.RELEASE.jar:5.0.7.RELEASE]
.
.
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.0.7.RELEASE.jar:5.0.7.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor$$Lambda$450/1438104724.proceedWithInvocation(Unknown Source) ~[na:na]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294) ~[spring-tx-5.0.7.RELEASE.jar:5.0.7.RELEASE]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98) ~[spring-tx-5.0.7.RELEASE.jar:5.0.7.RELEASE]

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_45]
.
.
    at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]

经过查阅资料
http://www.cnblogs.com/AloneSword/p/3487809.html
发现 我们jdk 或jre\lib\security目录 下, 需要两个保密的jar文件
 Oracle在其官方网站上提供了无政策限制权限文件(Unlimited Strength Jurisdiction Policy Files),我们只需要将其部署在JRE环境中,就可以解决限制问题。
下载地址:
      http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-java-plat-419418.html
把里面的两个jar包:local_policy.jar 和 US_export_policy.jar 替换掉原来安装目录jdk中或者jre中的\lib\security 下的两个jar包接可以了

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

漫长的~以后

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值