简体   繁体   English

JCE-Java 7…?

[英]JCE - Java 7…?

I've installed JDK 7 . 我已经安装了JDK 7 Which already contains the following JARs: 其中已经包含以下JAR:

local_policy
US_export_policy

But when I start my application, I was facing JCE error . 但是,当我启动应用程序时,遇到了JCE error So I googled and downloaded JDK 7 JCE from here . 所以我从这里搜索并下载了JDK 7 JCE。

My doubt is, when JDK 7 already has JCE JARs , why should I specifically download the same JCE JARs and replace the existing JCE JARs again..?? 我的疑问是,当JDK 7已经具有JCE JARs ,为什么我应该专门下载相同的JCE JARs然后再次替换现有的JCE JARs

Edit: 编辑:

I am using SSHA encryption. 我正在使用SSHA加密。

Log: 日志:

java.security.invalidkeyexception: illegal key size
java.lang.illegalstateexception: cipher not initialized

The downloaded files are not the same . 下载的文件不相同

Basically the named .jar files only contain property files which enable/disable some cryptography functions. 基本上,命名的.jar文件仅包含启用/禁用某些加密功能的属性文件。 This is because of several different export/import regulations in different countries. 这是因为不同国家/地区的几种进出口规则不同。

You could also modify this files by yourself and enable/disable some cryptography functions for your application. 您也可以自己修改此文件,并为应用程序启用/禁用某些加密功能。

My doubt is, when JDK 7 already has JCE JARs, why should I specifically download the same JCE JARs and replace the existing JCE JARs again..?? 我的疑问是,当JDK 7已经具有JCE JAR时,为什么我应该专门下载相同的JCE JAR,然后再次替换现有的JCE JAR。

No. Or at least, not without understanding what the JCE error means. 不。或者至少在不理解JCE错误的含义的情况下。

If you showed us the error messages / stacktraces, maybe we could help you with that. 如果您向我们显示了错误消息/堆栈跟踪,也许我们可以为您提供帮助。


UPDATE 更新

Those errors look like problems in your code rather than in JCE. 这些错误看起来像是代码中的问题,而不是JCE中的问题。

  1. SSHA stands for Salted SHA. SSHA代表咸SHA。 SSH / SSHA are secure hash schemes, not an encryption schemes. SSH / SSHA是安全的哈希方案,而不是加密方案。 Moreover, you won't find a JCE provider for SSHA ... because it is really just a variation on SHA where you add a "salt" to the input that you are hashing. 此外,您将找不到SSHA的JCE提供程序...,因为它实际上只是SHA的一种变体,您可以在其中将“盐”添加到要散列的输入中。

  2. The "illegal key size" exception looks like you are misusing one of the API methods. “非法密钥大小”异常看起来像您在滥用API方法之一。

If you showed us the code that throws the exceptions ... and the full stacktraces ... we could give you a more definite answer. 如果您向我们展示了引发异常的代码 ...以及完整的堆栈跟踪信息...,我们可以为您提供更明确的答案。 But I'm convinced that replacing the JCE JARs will make no difference. 但是我坚信,替换JCE JAR不会有任何区别。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM