Alisahoneysmile 2015-06-17 09:49 采纳率: 0%
浏览 1950

JCE cannot authenticate the provider NUIMCSCGIBE

IbeProvider.class
package nuim.cs.crypto.ibe;

import java.security.Provider;

/**

  • This class provides a key pair generator and an El-Gamal based cipher for
  • Identity Based Encryption (IBE).
    /
    public class IbeProvider extends Provider {
    /
    * the name of the cipher and key pair generators for ibe /
    public static final String IBE = new String("ibe");
    /
    *

    • */ private static final long serialVersionUID = 1L;

    /**

    • Creates a new instance of the Crypto Group's provider for IBE.
      */
      public IbeProvider() {
      super("NUIMCSCGIBE", 1.0, "NUIM CS CG IBE Crypto Provider");

      // clears the superclass provider - don't want any surprises
      clear();
      // add in our own implementations
      put("KeyPairGenerator." + IBE, IbeKeyPairGenerator.class.getName());
      put("Cipher." + IBE, IbeCipher.class.getName());
      }
      }

错误报告:
Running nuim.cs.crypto.ibe.test.IbeProviderTest
Tests run: 3, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.594 sec <<< FAILURE!
testCipher(nuim.cs.crypto.ibe.test.IbeProviderTest) Time elapsed: 0.109 sec <<< ERROR!
java.lang.SecurityException: JCE cannot authenticate the provider NUIMCSCGIBE
at javax.crypto.Cipher.getInstance(Cipher.java:642)
at nuim.cs.crypto.ibe.test.IbeProviderTest.testCipher(IbeProviderTest.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.SecurityException: Cannot verify jar:file:/F:/Workspace/GitHub/IBE/framework/target/classes/!/
at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:406)
at javax.crypto.JarVerifier.verifyJars(JarVerifier.java:322)
at javax.crypto.JarVerifier.verify(JarVerifier.java:250)
at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:161)
at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:187)
at javax.crypto.Cipher.getInstance(Cipher.java:638)
... 26 more
Caused by: java.security.PrivilegedActionException: java.io.FileNotFoundException: F:\Workspace\GitHub\IBE\framework\target\classes (拒绝访问。)
at java.security.AccessController.doPrivileged(Native Method)
at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:384)
... 31 more
Caused by: java.io.FileNotFoundException: F:\Workspace\GitHub\IBE\framework\target\classes (拒绝访问。)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:215)
at java.util.zip.ZipFile.(ZipFile.java:145)
at java.util.jar.JarFile.(JarFile.java:154)
at java.util.jar.JarFile.(JarFile.java:91)
at sun.net.www.protocol.jar.URLJarFile.(URLJarFile.java:93)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69)
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:109)
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89)
at javax.crypto.JarVerifier$2.run(JarVerifier.java:399)
... 33 more

testCreateCipher(nuim.cs.crypto.ibe.test.IbeProviderTest) Time elapsed: 0 sec <<< ERROR!
java.lang.SecurityException: JCE cannot authenticate the provider NUIMCSCGIBE
at javax.crypto.Cipher.getInstance(Cipher.java:642)
at nuim.cs.crypto.ibe.test.IbeProviderTest.testCreateCipher(IbeProviderTest.java:147)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.SecurityException: Cannot verify jar:file:/F:/Workspace/GitHub/IBE/framework/target/classes/!/
at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:406)
at javax.crypto.JarVerifier.verifyJars(JarVerifier.java:322)
at javax.crypto.JarVerifier.verify(JarVerifier.java:250)
at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:161)
at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:187)
at javax.crypto.Cipher.getInstance(Cipher.java:638)
... 26 more
Caused by: java.security.PrivilegedActionException: java.io.FileNotFoundException: F:\Workspace\GitHub\IBE\framework\target\classes (拒绝访问。)
at java.security.AccessController.doPrivileged(Native Method)
at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:384)
... 31 more
Caused by: java.io.FileNotFoundException: F:\Workspace\GitHub\IBE\framework\target\classes (拒绝访问。)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:215)
at java.util.zip.ZipFile.(ZipFile.java:145)
at java.util.jar.JarFile.(JarFile.java:154)
at java.util.jar.JarFile.(JarFile.java:91)
at sun.net.www.protocol.jar.URLJarFile.(URLJarFile.java:93)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69)
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:109)
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
at sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:89)
at javax.crypto.JarVerifier$2.run(JarVerifier.java:399)
... 33 more

  • 写回答

2条回答 默认 最新

  • frank_20080215 2015-06-17 14:39
    关注

    java加密安全包没有合适的,寻找第三方的jar。
    在ORACLE网站上https://forums.oracle.com/forums/thread.jspa?threadID=1529450发现了解决方法:

    removed javahome/jre/lib/jce.jar
    added javahome/jre/lib/ext/cryptix-jce-api.jar
    added javahome/jre/lib/ext/cryptix-jce-provider.jar
    问题就解决了。

    评论

报告相同问题?

悬赏问题

  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)