maven 3- JCE cannot authenticate the provider NUIMCSCGIBE

问题描述

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.0NUIM 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:WorkspaceGitHubIBEframeworktargetclasses (拒绝访问。)
at java.security.AccessController.doPrivileged(Native Method)
at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:384)
... 31 more
Caused by: java.io.FileNotFoundException: F:WorkspaceGitHubIBEframeworktargetclasses (拒绝访问。)
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:WorkspaceGitHubIBEframeworktargetclasses (拒绝访问。)
at java.security.AccessController.doPrivileged(Native Method)
at javax.crypto.JarVerifier.verifySingleJar(JarVerifier.java:384)
... 31 more
Caused by: java.io.FileNotFoundException: F:WorkspaceGitHubIBEframeworktargetclasses (拒绝访问。)
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

解决方案

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
问题就解决了。

解决方案二:
有可能连接改了。还有java加密安全包受美国安全控制(不要紧张,就是哪些密码长度太大,会受到限制),访问oracle网站会受到干扰

时间: 2024-09-14 00:24:51

maven 3- JCE cannot authenticate the provider NUIMCSCGIBE的相关文章

bcprov-jboss7.1.1下JCE cannot authenticate the provider BC

问题描述 jboss7.1.1下JCE cannot authenticate the provider BC 1.我的代码中引用了bcprov-jdk16-146.jar,在部署到jboss7.1.1时报如下异常: Caused by: java.lang.SecurityException: JCE cannot authenticate the provider BC at javax.crypto.SunJCE_b.a(DashoA13*..) at javax.crypto.Secre

ASP.NET Authentication Provider

asp.net ASP.NET 提供了一些新型的Authentication 和 Authorization 方案,对于开发人员来说这将是和以前不同的一种方式.可喜的是ASP.NET提供的方案多样更加灵活:可惜的是这种方案是基于IIS的.我知道,有些人并不喜欢IIS,认为它容易受攻击.只是一直不喜欢ASP的方式,杂乱的HTML标记中夹杂着代码,难于维护也难于调试.现在有了新的解决方案,让我们看看.      新型ASP.NET Authentication Provider(下面我会用ASP.N

不通用版(从SVN取版本,通过MAVEN生成JAVA包,通过SALTSTACK传送到远程服务器并自动重启TOMCAT服务)PYTHON代码

从昨晚写到今天啊, 第一版测试成功了. PHP和JAVA的更新相对来说,PHP的自动化更新是简单多啦~~ 当然,这只是运维工作当中的一环~~ #!/usr/bin/env python # -*- coding: utf-8 -*- import os,sys,commands,subprocess import re,time,logging from optparse import OptionParser #启动日志模块 logging.basicConfig(level=logging.

spring-在用eclipse启动maven项目的时候报的错误 这是什么情况

问题描述 在用eclipse启动maven项目的时候报的错误 这是什么情况 在用eclipse启动maven项目的时候报的错误,如果我用eclipse插件启用项目就报下面的错误,但是我用server的方式启动就不会报这个错,这是怎么回事啊?求大神们指教 14:51:31.297 [main] DEBUG o.s.v.b.OptionalValidatorFactoryBean - Failed to set up a Bean Validation provider javax.validati

【我的Android进阶之旅】快速创建和根据不同的版本类型(Dev、Beta、Release)发布Android 开发库到Maven私服

前言 由于项目越来越多,有很多公共的代码都可以抽取出一个开发库出来传到公司搭建好的Maven私服,以供大家使用. 之前搭建的Maven仓库只有Release和Snapshot两个仓库,最近由于开发库有时候不稳定有bug,不便于测试.因此领导说要搭建三个版本的仓库,分别为Release版本.Beta版本.Dev版本,Snapshot版本废弃掉,下面来分别介绍下这三个版本仓库的意义. Dev版本:是用于开发库维护人员能够很快的新增代码并上传到Maven仓库,这样其他开发人员就能够很快的获取该Dev版

rt jar-求java大神帮忙,java使用MAVEN编译时提示找不到类,但是类是属于rt.jar的

问题描述 求java大神帮忙,java使用MAVEN编译时提示找不到类,但是类是属于rt.jar的 java 版本: 1.6.0_10-rc2 maven 版本: 3.0.4 maven编译插件 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <s

通向架构师的道路(第十九天)使用maven构建Spring工程

一.前言 上次大家拿了我上传的工程后,有些人自己通过spring3,struts1.3,hibernate3的download的包自行去装配jar包到工程的WEB-INF\lib目录下.有些是通过我上传的alpha_lib包把里面的jar文件一股脑的copy到了工程的WEB-INF\lib目录下去. 有时经常还会发生少包了,ClassNotFound这样的错误,或者是一些因为缺包还引起的各种莫名奇妙的错误,呵呵,是不是够折腾的啊? 尝过苦头了,才知道幸苦!那么我们有没有一种更好的方式,比如说:

spring-Spring security 注册的 authentication provider 不起作用?

问题描述 Spring security 注册的 authentication provider 不起作用? 在spring mvc web module中添加使用spring security 模块,需要注入用户验证模块,可是加入配置的验证模块后,其中获取用户验证的部分没有被执行,反而老是执行匿名过滤,想问一下这个到底是什么问题? 配置代码: <security:http auto-config="true" use-expressions="true" a

Spirng+SpringMVC+Maven+Mybatis+MySQL项目搭建(转)

这篇文章主要讲解使用eclipse对Spirng+SpringMVC+Maven+Mybatis+MySQL项目搭建过程,包括里面步骤和里面的配置文件如何配置等等都会详细说明. 如果还没有搭建好环境(主要是Maven+MySQL的配置)的猿友可以参考博主以前的一篇文章: http://blog.csdn.net/u013142781/article/details/50300233 接下来马上进入项目搭建过程: 1.创建表,并插入数据: CREATE DATABASE `ssi` /*!4010