如何安装无限强度辖区策略文件?

编程入门 行业动态 更新时间:2024-10-10 15:25:49
本文介绍了如何安装无限强度辖区策略文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有人可以向我解释如何安装无限强度管辖权策略文件.我从 Oracle网站但我在安装它们时遇到了问题.我正在制作的Java程序不断给我这个错误:

Can someone explain to me how to install Unlimited Strength Jurisdiction Policy Files. I downloaded .jar files from Oracle website but I'm having a problem with installing them. Java program that I'm making keeps giving me this error:

Jan 11, 2017 12:32:31 AM com.subgraph.orchid.TorClient start INFO: Starting Orchid (version: 1.0.0) Jan 11, 2017 12:32:31 AM com.subgraph.orchid.TorClient verifyUnlimitedStrengthPolicyInstalled SEVERE: Unlimited Strength Jurisdiction Policy Files are required but not installed. Exception in thread "main" com.subgraph.orchid.TorException: Unlimited Strength Jurisdiction Policy Files are required but not installed. at com.subgraph.orchid.TorClient.verifyUnlimitedStrengthPolicyInstalled(TorClient.java:208) at com.subgraph.orchid.TorClient.start(TorClient.java:79) at com.nikola.WebCrawlerApp.App$OrchidDemo.startOrchid(App.java:46) at com.nikola.WebCrawlerApp.App$OrchidDemo.access$000(App.java:38) at com.nikola.WebCrawlerApp.App.main(App.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)

推荐答案

您需要确定Java主目录(通过Java中的System.getenv("JAVA_HOME")或命令行中的$ echo $JAVA_HOME).它应该是如下所示的路径:

You need to determine your Java home path (either via System.getenv("JAVA_HOME") from Java or $ echo $JAVA_HOME on the command line). It should be a path like the following:

    Windows上的
  • C:\Program Files\Java\jre8
  • 在Mac OS X上为
  • /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
  • * nix上的
  • /usr/java/jdk1.8.0_101/bin/java
  • C:\Program Files\Java\jre8 on Windows
  • /Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home on Mac OS X
  • /usr/java/jdk1.8.0_101/bin/java on *nix

然后,您需要将下载的US_export_policy.jar和local_policy.jar文件复制到以下目录中:<JAVA_HOME>/jre/lib/security,并覆盖同名的现有文件.

You then need to copy the US_export_policy.jar and local_policy.jar files you downloaded into the directory: <JAVA_HOME>/jre/lib/security and overwrite the existing files of the same name.

更新05/17/17

以下代码(仅用于演示目的)将指示JVM,无论安装了什么策略文件,都允许使用AES-256位加密和相应的TLS密码. 不推荐使用此方法.

The following code (for demonstration purposes only) will instruct the JVM that it is allowed to use AES-256 bit encryption and corresponding TLS ciphers regardless of the policy files installed. It is not recommended to employ this method.

if (Cipher.getMaxAllowedKeyLength("AES") < 256) { try { Field field = Class.forName("javax.crypto.JceSecurity"). getDeclaredField("isRestricted"); field.setAccessible(true); field.set(null, java.lang.Boolean.FALSE); } catch (Exception e) { fail("Could not override JCE cryptography strength policy setting"); fail(e.getMessage()); } }

更多推荐

如何安装无限强度辖区策略文件?

本文发布于:2023-11-24 17:01:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1626078.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:辖区   强度   策略   文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!