如何安装无限强度辖区策略文件? [英] How to install Unlimited Strength Jurisdiction Policy Files?

查看:96
本文介绍了如何安装无限强度辖区策略文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以向我解释如何安装无限强度管辖权策略文件.我从 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.jarlocal_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());
  }
}

这篇关于如何安装无限强度辖区策略文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆