当前位置:网站首页>Illegal key size 报错问题
Illegal key size 报错问题
2022-08-05 06:51:00 【null111666】
在搬砖时发现如下问题
对应的方法报错500:
具体错误如下:
2022-08-03 11:49:20.727 ERROR 36056 --- [nio-8999-exec-8] o.s.c.l.e.BladeRestExceptionTranslator : 系统异常
java.security.InvalidKeyException: Illegal key size
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1039)
at javax.crypto.Cipher.implInit(Cipher.java:805)
at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
at javax.crypto.Cipher.init(Cipher.java:1396)
at javax.crypto.Cipher.init(Cipher.java:1327)
at org.springblade.core.tool.utils.AesUtil.aes(AesUtil.java:268)
at org.springblade.core.tool.utils.AesUtil.encrypt(AesUtil.java:240)
at org.springblade.core.tool.utils.AesUtil.encrypt(AesUtil.java:79)
at org.springblade.core.tool.utils.AesUtil.encryptToBase64(AesUtil.java:123)
at org.springblade.core.api.crypto.util.ApiCryptoUtil.encryptData(ApiCryptoUtil.java:73)
at org.springblade.core.api.crypto.core.ApiEncryptResponseBodyAdvice.beforeBodyWrite(ApiEncryptResponseBodyAdvice.java:59)
at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyAdviceChain.processBody(RequestResponseBodyAdviceChain.java:141)
at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyAdviceChain.beforeBodyWrite(RequestResponseBodyAdviceChain.java:116)
at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:268)
at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.handleReturnValue(RequestResponseBodyMethodProcessor.java:181)
at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:82)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:123)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:626)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springblade.core.log.filter.LogTraceFilter.doFilter(LogTraceFilter.java:39)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springblade.core.boot.request.BladeRequestFilter.doFilter(BladeRequestFilter.java:58)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:124)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:97)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:357)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1707)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
异常原因:如果密钥大于128, 会抛出java.security.InvalidKeyException: Illegal key size 异常. 因为密钥长度是受限制的, java运行时环境读到的是受限的policy文件. 文件位于${java_home}/jre/lib/security, 这种限制是因为美国对软件出口的控制.
处理办法:将如下链接Illegalkeysize报错问题-Java文档类资源-CSDN下载两个jar包:local_policy.jar和 US_export_policy.jar下载后,
将解压后的文件覆盖 …/jdk1.8.0_151/jre/lib/security/policy/limited/文件夹的local_policy.jar和US_export_policy.jar
重启tomcat
然后不再报错
边栏推荐
- UDP广播
- 原来使Maya Arnold也能渲染出高质量作品!超赞小技巧
- RK3568 environment installation
- 400 times performance improvement 丨 swap valuation optimization case calculation
- Redis进阶
- 腾讯业务安全岗 IDP 谈话总结
- binary search tree problem
- IO进程线程->进程间的通信->day7
- Technical Analysis Mode (8) Double Top and Bottom
- MySQL: order by sorting query, group by grouping query
猜你喜欢
protobuf is compiled against the associated .proto file
typescript62-泛型工具类型(record)
Redis进阶
Shiny04---DT和进度条在shiny中的应用
typescript66-分析partial的实现
AI+视频技术助力保障校园安全,校园智能安防平台该如何建设?
(四)旋转物体检测数据roLabelImg转DOTA格式
Using printf function in STM32
UDP group (multi)cast
Flink Learning 10: Use idea to write WordCount and package and run
随机推荐
AI + video technology helps to ensure campus security, how to build a campus intelligent security platform?
An IP conflict is reported after installing the software on a dedicated computer terminal
环网冗余式CAN/光纤转换器 CAN总线转光纤转换器中继集线器hub光端机
Week 8 Document Clustering
Hong Kong International Jewellery Show and Hong Kong International Diamond, Gem and Pearl Show kick off
3555. 二叉树
Takeda Fiscal 2022 First Quarter Results Strong; On Track to Achieve Full-Year Management Guidance
【Go】IM系统Centrifugo
MySQL: JDBC programming
基于快速行进平方法的水面无人船路径规划
Vulnhub靶机:HA_ NARAK
在STM32中使用printf函数
GAN生成动漫头像Pytorch
任务流调度工具AirFlow,,220804,,
【工具配置篇】VSCode 常用使用总结
693. 行程排序
re正则表达式
MAYA船的建模
给网站套上Cloudflare(以腾讯云为例)
算法拾遗十五补链表相关面试题